1. Yiannis Papadomichelakis
  2. PowerBuilder
  3. Sunday, 19 April 2020 13:13 PM UTC

Hi PBers

The same syntax is used to create a datastore and a datawindow. 

The datastore succeeds, the datawindow fails but without any error!

 

The syntax is correct because, the datastore is created successful and because I am able to create it inside IDE (by edition the source of an existing datawindow replacing it with the content of the p_syntax).

 

Any ideas on how this is even possible????

Accepted Answer
Yiannis Papadomichelakis Accepted Answer Pending Moderation
  1. Tuesday, 21 April 2020 07:56 AM UTC
  2. PowerBuilder
  3. # Permalink

My app is using a datastore, inside a nvo to generate syntax for creating a datawindow, on the surface of a visual object. The syntax was applied in two steps.

On the first step, the syntax was created by using syntaxFromSQL() on the datastore, applying some visual modifications, adding retrieval arguments and changing the SQL.

On the second step, the syntax that is generated on the first step is applied to the datawindow. But before this action, a number of other visual objects / tab pages are created / initialized.

In order to "solve" my problem, I had to implement both operations in one step, so after the initialization of the other visual obejcts, I create the syntax and I apply it to dw.

 

I am not sure why is this happening, but now my problem disappeared. 

Unfortunately, I am not able to reproduce this problem in a small, simple application that I can upload on a bug ticket...

Comment
  1. Miguel Leeuwe
  2. Tuesday, 21 April 2020 08:50 AM UTC
Glad you could solve it!

As for the reason, "Guessing in the dark", but I could only think of something weird happening with maybe "create on demand of tabpages", constructor events being triggered AFTER other events or your dw_main not yet being really initialized somehow before you tried to work on it.



regards
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Monday, 20 April 2020 20:40 PM UTC
  2. PowerBuilder
  3. # 1

Are you trying to create a DW on a non-visual object? I don't think that's allowed.

That would explain why the DS works but the DW fails.


Olan

Comment
  1. Yiannis Papadomichelakis
  2. Tuesday, 21 April 2020 07:22 AM UTC
I am aware of that, you can not use datawindow as nvo. The DataWindow is on the surface of a visual user object.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 20 April 2020 12:59 PM UTC
  2. PowerBuilder
  3. # 2

Hi Yiannis,

Can you post the string for the create? So we can try.

regards

Comment
  1. Miguel Leeuwe
  2. Tuesday, 21 April 2020 07:29 AM UTC
Could it be that the create() triggers some event on the dw_main which could be interfering?

Does the dw_main maybe have an non-existing dataobject assigned?

  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 21 April 2020 07:35 AM UTC
Just as a test: drop a new datawindow control on your window / object and see if the syntax works on that one.
  1. Helpful
  1. Yiannis Papadomichelakis
  2. Wednesday, 22 April 2020 07:30 AM UTC
The datawindow main have no datawindow assigned, which is valid in order to dynamically create a layout using syntaxFromSQL.

The datawindow was new. The control that the dw sits on was new, so I assume that it wont made any difference. But I managed to solve my problem by merging the 2 steps in 1 (as I said in an other reply).
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 19 April 2020 21:16 PM UTC
  2. PowerBuilder
  3. # 3

Hi Yiannis;

   What does the ls_error variable contain after the Create() function command?

Regards ... Chris

Comment
  1. Yiannis Papadomichelakis
  2. Sunday, 19 April 2020 21:31 PM UTC
It's empty!

You can see that on the screen shot.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 20 April 2020 00:24 AM UTC
If you edit the "source" of the DWO ... what release number does it reflect vs your PB version?
  1. Helpful
  1. Yiannis Papadomichelakis
  2. Monday, 20 April 2020 11:22 AM UTC
Yes, it does (Release 19).

The syntrax is generated using SyntaxFromSQL(), then I apply retrieval arguments and modify the layout.



Unfortunately, I cant reproduce the error by creating a simple app that demonstrates the problem....
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.