I am using PowerBuilder 6.5. My question has 2 parts. The goal is to create a dropdowndatawindow at run time for one of the columns in a datawindow.
How can I set the dddw for a particular row within the column, while leaving the rest of the rows in that column alone?
The dddw, itself, takes a retrieval argument. How can I get the code to populate the dddw without it prompting me to enter the retrieval argument?
I have come up with the below code which does not work completely. It is within the rowfocuschanged event of my datawindow.
It doesn't meet the requirement for part 1 because it sets all rows in the column to the dddw.
It doesn't meet the requirement for part 2 because as soon as the dddw.name property is set, I am prompted for the retrieval argument. I don't think that an InsertRow(0) will work to suppress the prompt for the retrieval argument, because that window pops up immediately upon setting the dddw.name property.
In order of priority, I would like to get Part 2 to work before getting Part 1 to work.
//CODE BEGINS HERE
int li_thetype, li_theid, li_row
li_thetype = this.object.datatype[currentrow]
li_theid = this.object.itemid[currentrow]
IF li_thetype = 0 THEN
this.object.StringValue.dddw.name = "d_list_port_info_ddw"
this.object.StringValue.dddw.displaycolumn = "listitem"
this.object.StringValue.dddw.datacolumn = "itemid"
this.object.StringValue.dddw.useasborder = "yes"
ll_rtn = dw_edit.getChild( "StringValue", dwc)
dwc.SetTransObject( SQLCA )
IF ll_rtn = -1 THEN
MessageBox("Error Data Window Message", "Not a valid child Data Window ")
dwc.Retrieve( li_theid )
this.object.StringValue.dddw.name = ""
this.object.StringValue.dddw.displaycolumn = ""
this.object.StringValue.dddw.useasborder = "no"
//CODE ENDS HERE