1. Malek Taha
  2. PowerBuilder
  3. Wednesday, 26 June 2024 17:17 PM UTC

Hi

   I have a userobject u_dw_1 inherited from (PFC) U_dw with dataobject d_no_hall.

The user object is on a window when executed the window opens and display the data. called dw_1

 

I placed a button on the window when clicked, i execute the following to switch the dataobject and retrieve

i get no error but the datawindow disappears 

dw_1.dataobject = 'd_first_hall'
dw_1.settransobject(sqlca)
dw_1.Retrieve ( ic_Mode, is_Destination)

 

Am i missing something

If it is a datawindow placed on the window and not a user object all is good

Please advise

Thank

Malek

 

 

Who is viewing this page
Arnd Schmidt Accepted Answer Pending Moderation
  1. Thursday, 27 June 2024 21:31 PM UTC
  2. PowerBuilder
  3. # 1

Hi Malek Taha,

if the datawindow can not be found during runtime:

Use a PBR or compile your application using PBDs/DLLs.

https://docs.appeon.com/pb2022r3/pbug/Distributing_resources.html

And yes... there is no warning or an exception if you code something like:

dw_test.dataobject = "you_will_never_see_me"

hth

Arnd

 

Comment
There are no comments made yet.
Malek Taha Accepted Answer Pending Moderation
  1. Thursday, 27 June 2024 17:02 PM UTC
  2. PowerBuilder
  3. # 2

Hi The retrieve returns -1 after the switch

 

Comment
There are no comments made yet.
Malek Taha Accepted Answer Pending Moderation
  1. Wednesday, 26 June 2024 21:48 PM UTC
  2. PowerBuilder
  3. # 3

Hi Chris

     I am not sure how to debug. what do you mean by a "Ghost" DWO in the PBL?

 

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 26 June 2024 23:48 PM UTC
The PB IDE on updating any class in a PBL "logically" deletes the object 1st and then adds a new instance to the PBL. Thus, older copies of that object are present i any PBL. If the PB Loader ar runtime chooses the wrong copy, you could get an older - even none run-able object definition. The fix for that though is easy. Just optimize your PBL(s).

The other thing that can easily mess you up if is somehow the PBL and/or PBD that houses the DWO(s) is not present at runtime. Thus, check your App's Library List & the resulting PBD's at deployment for that missing DWO.
  1. Helpful
There are no comments made yet.
Malek Taha Accepted Answer Pending Moderation
  1. Wednesday, 26 June 2024 20:19 PM UTC
  2. PowerBuilder
  3. # 4

Hi

   The whole datawindow dissapears.

I debug and after the switch the datawindow returns -1

 

Comment
  1. René Ullrich
  2. Thursday, 27 June 2024 07:16 AM UTC
What returns -1? SetTransObject? Retrieve?
  1. Helpful
There are no comments made yet.
Malek Taha Accepted Answer Pending Moderation
  1. Wednesday, 26 June 2024 20:15 PM UTC
  2. PowerBuilder
  3. # 5

Hi Chris

      The data windows worked fine I can open both and retrieve with no issue 

If i switch the datawindows on the window manually in the ide then run the app both datawindows retrieves with no issues.

 

This issue only appears when i do the switch of dw at runtime

There is no errors the app works fine after the switch, the datawindow just disappears  

Thanks

Malek

 

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 26 June 2024 20:34 PM UTC
Can you try ...

dw_1.Reset ( )

dw_1.dataobject = ""

dw_1.dataobject = 'd_first_hall'

dw_1.settransobject(sqlca)

dw_1.Retrieve ( ic_Mode, is_Destination)

Also, what are the Return codes on the STO & Retrieve commands?
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 26 June 2024 20:14 PM UTC
  2. PowerBuilder
  3. # 6

Hi, Malek - 

Does the entire DataWindow control vanish or only its contents?

If no rows are returned, you will not see any contents in the DataWindow control... so how many rows are returned by the dw_1.Retrieve after setting a new data object and assigning the transaction object? If none, you may have to issue an InsertRow(0) method to see the DW's data object.

Best regards, John

Comment
There are no comments made yet.
Malek Taha Accepted Answer Pending Moderation
  1. Wednesday, 26 June 2024 19:55 PM UTC
  2. PowerBuilder
  3. # 7

Sorry Chris

     PB 2021 build 1509

Comment
There are no comments made yet.
Malek Taha Accepted Answer Pending Moderation
  1. Wednesday, 26 June 2024 19:53 PM UTC
  2. PowerBuilder
  3. # 8

Hi Chris It is happeneing with both IDE and EXE   PB 2023R3

Thanks

Malek

 

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 26 June 2024 20:02 PM UTC
That sounds like either: A) Corrupt DWO; B) A misspelling of the DWO name; C) A special character in the DWO name; or D) maybe a "ghost" DWO image in the PBL.

What happens when you open the DWO in the DB Painter and run it via Preview?
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 26 June 2024 19:17 PM UTC
  2. PowerBuilder
  3. # 9

Hi Malek;

  Is this issue when running the App from the IDE, EXE or both?

Regards ... Chris

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.