SAP Knowledge Base Article - Preview

2372929 - CR799461 PB 12.6.NET - Using SetItem() in ItemChanged shows different behavior

Symptom

Difference in behavior from PowerBuilder 12.6 Classic and PowerBuilder 12.6 .NET, when using SetItem() in the ItemChanged event:

PowerBuilder 12.6 Classic shows:
//application Open event
grid = create n_datastore
grid.DataObject = "d_state"
ll_row = grid.InsertRow(0)
grid.SetColumn("state")
ls_col = grid.GetColumnName()
grid.SetText("PA")
grid.AcceptText()

//ItemChanged Event
ls_OrigTextValue = this.gettext()  <-- value is PA
ls_OrigItemvalue = this.GetItemString(1, "state") <-- value is null;
This.SetItem(row, "state", "")
this.SetText("NJ")
li_rc = this.AcceptText()
ls_NewItem = this.GetItemString(1, "state") < -- value is NJ
ls_NewText = this.gettext() <-- value is NJ
li_rc = this.deleterow(1)
li_rc = this.insertrow(0)
this.SetColumn("state")
this.SetText("NJ")
This.SetItem(row, "state", "NJ")
ls_NewItem = this.GetItemString(1, "state") < value is NJ
ls_NewText = this.gettext() <---value is NJ
return 1

// application open event
.
.
ls_NewText = grid.GetText()  <-- value is NJ
ls_NewValue = grid.GetItemString(1, "state") <--value is NJ

PowerBuilder 12.6 .NET shows:
//application Open event
grid = create n_datastore
grid.DataObject = "d_state"
ll_row = grid.InsertRow(0)
grid.SetColumn("state")
ls_col = grid.GetColumnName()
grid.SetText("PA")
grid.AcceptText()

//ItemChanged Event
ls_OrigTextValue = this.gettext()   <-- value is PA
ls_OrigItemvalue = this.GetItemString(1, "state")  <-- value is null
This.SetItem(row, "state", "")
this.SetText("NJ")
li_rc = this.AcceptText()
ls_NewItem = this.GetItemString(1, "state")  <-- value is ""
ls_NewText = this.gettext()  <-- value is NJ
li_rc = this.deleterow(1)
li_rc = this.insertrow(0)
this.SetColumn("state")
this.SetText("NJ")
This.SetItem(row, "state", "NJ")
ls_NewItem = this.GetItemString(1, "state") <-- value is NJ
ls_NewText = this.gettext() <--value is NJ
return 1

// application open event
.
.
ls_newText = grid.GetText() <-- value is NJ
ls_newValue = grid.GetItemString(1,"state")  <-- value is PA


 


Read more...

Environment

  • SAP PowerBuilder 12.6 .NET (build 4081)

Product

SAP PowerBuilder 12.6

Keywords

powerbuilder,pb,.net,settext,settext(),itemchanged , KBA , pb , setitem , classic , .net , itemchanged , BC-SYB-PB , Powerbuilder , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.