1. Pierre Couvreur
  2. PowerServer 2020 or older (Obsolete)
  3. Friday, 1 March 2019 10:36 AM UTC

Hi !

Sorry to have at least one issue per day in this period...

I create a user object called uo_dw inherited from datawindow.

Inside uo_dw, I declare a dwobject instance variable : dwobject    idwo_currentItem

I also create a user event called ue_help().

In uo_dw's itemfocusChanged event, I store the dwo argument in the instance variable idwo_currentItem : idwo_currentItem = dwo

In uo_dw's doubleclicked event, I post the ue_help user event : this.event post ue_help()

In ue_help(), I display the current item's type :

   IF isValid(idwo_currentitem) THEN
       messagebox("ancestor ue_help", "type : " + string(idwo_currentitem.type))
   ELSE
       messagebox("","not valid")
   END IF

It works perfectly in PB classic mode, but not in WEB mode where the variable idwo_currentItem is not valid anymore. However, it also works perfectly in WEB mode as soon as I trigger ue_help instead of posting it.

Work around may exists but it could potentially be a big amount of work to adapt a big app.

Double-clic in PB classic mode :

                 

 

Double-clic in WEB mode :

                

Attached zip file contains source file for uo_dw and a window that implements it.

Thank you all !

PIerre

Attachments (1)
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 1 March 2019 16:40 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Pierre;

   That is a known limitation of PowerServer.  FYI: From the PS 2017 Help ...

Using instance variables or global variables to store the dwo argument (argument type is dwobject) for a DataWindow event is unsupported.

HTH

Regards ... Chris

PS: Don't feel bad .. I got caught in this restriction years ago in my frameworks. I had to read the documentation a few times before I realized this restriction.

 

 

 

Comment
  1. Pierre Couvreur
  2. Monday, 4 March 2019 08:01 AM UTC
Hi Chris,

Thank you to point me in that limitation ! However the code works perfectly if I trigger the event 'ue_help" instead of posting it, but I guess I should avoid it anyway...

Pierre

  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 4 March 2019 17:56 PM UTC
Yes, its the POST that is the issue. I changed my frameworks to use the Trigger as the workaround.
  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.