1. Tracy Lamb
  2. PowerBuilder
  3. Saturday, 20 August 2022 15:46 PM UTC

Hi all,

I've got a datawindow with 3 DropDownDW's.  I can't retrieve the drop-downs until after the parent dw is retrieved.  The Auto Retrieve is checked OFF on all three .  In the parent DW's RetrieveEnd event I've got the following code:

ll_TmdeID = this.GetItemNumber( 1, "tmde_id")
this.GetChild('tmde_attachments', ldwc_tmde_doc)
ldwc_tmde_doc.SetTransObject(sqlca)
ldwc_tmde_doc.Retrieve(ll_TmdeID)

ll_EquipID = this.GetItemNumber(1,"equipment_id")
this.GetChild('equip_attachments', ldwc_equip_doc)
ldwc_equip_doc.SetTransObject(sqlca)
ldwc_equip_doc.Retrieve(ll_EquipId)

ls_cal_procedure = this.GetItemString( 1, "tmde_cal_procedure")
this.GetChild('attachments', ldwc_procedure_doc)
ldwc_procedure_doc.SetTransObject(sqlca)
ldwc_procedure_doc.Retrieve(ls_cal_procedure)

ldwc_equip_doc and ldw_procedure_doc work fine.  But for some reason, ldw_tmde_doc shows the doc_id field instead of the FileName, even though FileName is the display column.  The doc_id field isn't even visible in the dddw object.  If I click on the drop-down arrow the FileName displays correctly. I can select it, then the ldw_tmde_doc object shows the FileName.

I tried adding ldwc_tmde_doc.SetRow(1), and ldwc_tmde_doc.SelectRow(1,TRUE)... no luck.

Any idea why this works in 2 of 3 DDDW's?

~~~Tracy

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Saturday, 20 August 2022 17:45 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Tracy,

Open the datawindow that's associated to your "tmde_attachments" column. Let's call that dw 'X',.

Do a retrieve of 'X', using the value you would have gotten in ll_TmdeID when running the code.

Most likely that value doesn't exist (anymore?) on the result set of dw 'X'. In other words, the doc_id doesn't exist in the resultset of the dddw. In that case it cannot show any description (like the filename), but instead, will just show you the code value, in this case the doc_id.

- check your code value for the dddw on "tmde_attachments", the code value should be the id field, because it looks like that's what has been recorded in the database as the value of the column on which you use the dddw.

- Just in case: make sure you don't have your dddw somewhere duplicated in another library as the one you think it is. Maybe you're retrieving the values, but in reality another copy of that dw is being found in any library higher up in the library list.

regards,

miguelL

 

Comment
  1. Tracy Lamb
  2. Saturday, 20 August 2022 18:20 PM UTC
Checked the value I got in ll_TmdeID. Double-checked the database to ensure that number is there. It's correct. The DDDW retrieves the correct rows, it just doesn't display the right field on initial retrieve.
  1. Helpful
  1. Tracy Lamb
  2. Saturday, 20 August 2022 18:29 PM UTC
Thank you Miguel!

You were right, I had to set the Data Column in the DW Edit style to ID, not doc_id.

Many Thanks!!!
  1. Helpful
  1. Miguel Leeuwe
  2. Saturday, 20 August 2022 18:51 PM UTC
Yw Tracy, glad it works now.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 20 August 2022 16:09 PM UTC
  2. PowerBuilder
  3. # 1

Hi Tracy;

  FWIW: After each GetChild() you should use the IsValid() to check that your DWO pointer is valid. If not, the other commands will fail. Thus, no data.

Regards... Chris 

Comment
  1. Tracy Lamb
  2. Saturday, 20 August 2022 16:34 PM UTC
Thanks for the feedback. But that's not the problem... the dddw has the right data, but initially displays the wrong column. And just on 1 of 3 ddw's.
  1. Helpful
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.