1. Kevin Ridley
  2. PowerBuilder
  3. Tuesday, 22 December 2020 14:09 PM UTC

Windos 10, PB 2019 R2

This is blowing my mind, must be missing something easy, should be a no brainer.  I feel like I've done this a million times, but it's not working.  I've got a single column dw (external source) with 1 column (string 10).  Edit on the column is a dddw.  The dddw used has 2 columns (string 10, and string 30).  Data to fill it comes from a web service which is working fine.  I populate an instance datastore with the 2 columns worth of data and it has 35 rows.  I do a getchild on the dw and it returns 1.  Then I do ds.sharedata(dwc) which returns 1.  Rowcount on the dwc returns 35.  I have done dw.insertrow(0) so there's a blank row in the dw, but the dropdown is blank.

 

I have another external source dw on the same window that I populate using dw.importjson.  This dw has 7 columns, 1 of the columns is string 10 like the other one - edit dddw, and I also populate it with a web service.  dddw and columns are similar to the other and I use almost identical code to retrieve and populate the dddw and it works great.  In both cases I display the description and the id column (string 10) is the data column.  Any thoughts?

 

Thanks,

Kevin

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 25 December 2020 19:46 PM UTC
  2. PowerBuilder
  3. # 1

Are you using the same datawindowChild variable for different columns? If so, then see what happens if you don't and use a separate variable for each of the columns.

Also, if you still do anything with the dwChild before or after sharing the data maybe you have to do the GetChild() again.

(It's a bit difficult to see exactly what you're doing without any code).

Regards,

 

Comment
There are no comments made yet.
Arthur Hefti Accepted Answer Pending Moderation
  1. Tuesday, 22 December 2020 15:30 PM UTC
  2. PowerBuilder
  3. # 2

Hi

according to your findings ShareData is working well. So I assume the source of the data is gone. What happens if you use RowsCopy instead of ShareData?

Regards
Arthur

 

Comment
  1. Kevin Ridley
  2. Tuesday, 22 December 2020 15:34 PM UTC
The source of the data is a webservice, but resides in an instance ds. When I do a RowCount() on the ds right before or after the share it returns 35 rows. I'll try a rowscopy anyway, who knows.
  1. Helpful
  1. Kevin Ridley
  2. Tuesday, 22 December 2020 15:47 PM UTC
Wow! Unbelievable, RowsCopy worked, but ShareData apparently didn't. Never thought to try that since ShareData returned 1. I should probably submit this as a bug. Thanks Aurthur! Exact code below, commented line does not work.



//li_return = ids_aid_years.ShareData(idwc_aid_years)

ids_aid_years.RowsCopy(1, ids_aid_years.RowCount(), primary!, idwc_aid_years, 1, primary!)



Again, crazy thing is, I use sharedata for another dropdown in a dw populated from json. Only difference is the dw from json has data already when I do the sharedata for the dropdown, but the other dw is blank and I insert a row. Crazy!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 22 December 2020 15:07 PM UTC
  2. PowerBuilder
  3. # 3

Hi Kevin;

   Also make sure that the DWO used in the DS and the DWO used as the DDDW have the columns in the same order. For example: one DWO has Col10, Col30 and the other DWO has Col30, Col10 in that order. If so, then the ShareData() will not work - even though you think the result set is the same.

Regards ... Chris

Comment
  1. Kevin Ridley
  2. Tuesday, 22 December 2020 15:14 PM UTC
I use the same dwo in the ds and dddw.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 22 December 2020 15:20 PM UTC
Excellent! Also make sure that the DS is not Destroyed / Created or its buffers "Reset()" in between UI interactions.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 22 December 2020 15:56 PM UTC
Also make sure that after the ShareData() that you do *not* reassign the DWO again.

For example: DS.DataObject = "xxxxx"
  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.