1 Attachment(s)
WebColumnCombo value removed
Hi all,
I have a WebColumnCombo (oBenRelationCol) which is being populated through a webservice.
I am able to select the values and everything is working as it should.
However when I click back on a row which had the value selected, the value in this WebColumnCombo is removed.
[video]https://drive.google.com/file/d/1mXAve3ER7_Gy5hed0F17SasJ-7Qcy9m-/view?usp=sharing[/video]
In the same WebList, which has no databinding, I have another WebColumnCombo which is being populated manually by the AddComboItem and is working properly.
[CODE]
Object oBenRelationCol is a cWebColumnCombo
Set psCaption to "Relation"
Set piWidth to 20
Procedure onFill
Forward Send OnFill
Integer iNum i
//
Get wsGetListofRelations of oWsInternal to mBenRelationList
//
Move (SizeOfArray(mBenRelationList)) to iNum
//
For i from 0 to (iNum-1)
Send AddComboItem mBenRelationList[i].sRelation mBenRelationList[i].sRelation
Loop
//
End_Procedure
End_Object
Object oBenGenderCol is a cWebColumnCombo
Set psCaption to "Gender"
Set piWidth to 20
Procedure onFill
Forward Send OnFill
//
Send AddComboItem "<Undefined>" "<Undefined>"
Send AddComboItem "M" "Male"
Send AddComboItem "F" "Female"
//
End_Procedure
End_Object
[/CODE]
[ATTACH=CONFIG]14106[/ATTACH]
Thanks in advance.
Re: WebColumnCombo value removed
Are all the relation names unique? Does it still fail if you hard-core the relations?
Re: WebColumnCombo value removed
Thanks for you reply Harm.
I can confirm that the Relations are unique.
I tried hard-coding the relations and the problem does not happen.
Thanks once again
Re: WebColumnCombo value removed
Hi, I just had an issue that was very similar to what you describe and the solution was to trim away some added spaces to the strings I got back from the database as I filled the combo.
Send AddComboItem (Trim(file_tags.tag)) (Trim(file_tags.tag))
Re: WebColumnCombo value removed
Hi Johan,
Thanks for the update. I tried it but it didn't work on mine. I think it is something more deep down in the pits.
Re: WebColumnCombo value removed
Sorry to hear. But I would probably start to try to hardcode the/some values as you do in the Relation Combo as you do in the Gender combo to see if that solves your issue with loosing values. If it does, then there is something with the formating of those values. Otherwise, I guess you have to look further.
Re: WebColumnCombo value removed
While i'm not sure why this happens, maybe you could try a workaround solution where you'd get the list somewhere else in your code - for example the OnShow of the view (set pbServerOnShow to true as well) - and store it in a WebProperty. Then WebGet this property again in the OnFill and use it to populate the combo.
This will make sure that there's not something with the WebService or webservice call at fault during the filling process and i think it might actually be more efficient (less WS calls) too. :)
Re: WebColumnCombo value removed
Hi Henri,
I changed the code to fill the columncombo from a property list but still not working.
There seems to be nothing special about this cWebColumnCombo. I also checked whether this object is being called somewhere else in the code but it is not.
[CODE]
Object oBenRelationCol is a cWebColumnCombo
Set psCaption to "Relation"
Set piWidth to 20
Procedure onFill
Forward Send OnFill
Integer iNum i
tWStBenRelationList[] mBenRelationList
//
WebGet psBenRelationList of oAddPolicy to mBenRelationList
//Get wsGetListofRelations of oWSLaferla1 to mBenRelationList
//
Move (SizeOfArray(mBenRelationList)) to iNum
//
For i from 0 to (iNum-1)
Send AddComboItem mBenRelationList[i].sRelation mBenRelationList[i].sRelation
Loop
//
End_Procedure
End_Object
[/CODE]
Re: WebColumnCombo value removed
Just a guess, does the data returned from the web service have carriage returns or other 'non-printable' characters, by chance. It seems to me that the value really isn't the same so it can't find what it should & clears out the value. Like I said, just a guess.
Jeff
Re: WebColumnCombo value removed
That could very well be true in that case, you might want to double check the values you're getting.