1. Tracy Lamb
  2. PowerBuilder
  3. Saturday, 7 April 2018 17:43 PM UTC

My dw has a column with the dddw edit format.  The dddw requires a retrieval argument to isolate records from another table that only apply to the master record.  The retrieval argument is different from the data column specified from the master window.

How do I pre-specify the retrieval argument so the dddw doesn't pop-up and ask for the argument?

TIA, Tracy

Accepted Answer
Marco Meoni Accepted Answer Pending Moderation
  1. Sunday, 8 April 2018 17:15 PM UTC
  2. PowerBuilder
  3. # Permalink

Hello Tracy,

exactly as Roland explained:

Datawindowchild ldwc

dw_1.GetChild('columnname_with_dddw', ldwc)
ldwc.SetTransObject(sqlca)
ldwc.Retrieve()

Best,

Marco

Comment
  1. Michael Kramer
  2. Sunday, 8 April 2018 23:30 PM UTC
Hi Tracy, A little follow-up on the "internal" workings that you see in play here >>>





All DropDownDataWindows (DDDW) having no rows in the primary buffer are "auto-retrieved" when the "container" DataWindow is retrieved.



Therefore, they usually only retrieve as part of the first retrieve for the container DW.





That auto-retrieve is always similar to calling Retrieve without parameters so you need some way to circumvent this auto-retrieve when a DDDW uses retrieval arguments.

"DDDW with no rows" is the "secret weapon"!



You may design the DataWindow object for the DDDW column with one empty row (use the Data pane in the DataWindow painter)

You may from the Constructor event of the container DW insert a row explicitly into each DDDW object, where you want to disable the automatic retrieval

You may set AutoRetrieve = off for DDDW column

-- OR -- you may perform the DDDW retrieve with arguments prior to the automatic retrievals kicking in

When I learned PowerBuilder, there was no "AutoRetrieve" property so we had to learn to use option 1 or option 2 (somehow insert an empty row)









HTH /Michael

  1. Helpful
  1. Tracy Lamb
  2. Monday, 9 April 2018 17:07 PM UTC
I did set the Auto-Retrieve option off.  The reason I can't put the code into the dw constructor event is because the retrieval arguments are not available until the OPEN event of the window fires and apparently the dw constructor event fires first. 

  1. Helpful
  1. Lars Mosegaard
  2. Tuesday, 10 April 2018 01:09 AM UTC
Perhaps modify the OPEN event to retrieve the DDDW before you retrieve or insertrow to the main datawindow.. 

  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Saturday, 7 April 2018 20:31 PM UTC
  2. PowerBuilder
  3. # 1

On the main DataWindow uncheck the Auto Retrieve option. In the constructor event of the DW control, use the GetChild function to get a reference to the dropdown. You can retrieve the dropdown and pass the argument.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.