(RDMLX) OpenForm Stack from a PopOver Form

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
MarcusLancaster
Posts: 48
Joined: Wed Nov 06, 2013 1:28 am

(RDMLX) OpenForm Stack from a PopOver Form

Post by MarcusLancaster »

Hi all.

I've got a form, which in certain situations shows a PopOver form. Amongst other things, the Popover shows a button which when pressed runs a piece of offline javascript which does various things and then initiates an OpenForm operation with presentmode STACK to fire up a second form.

The problem is that although the second, new form appears, the popover from the previous form stays visible, overlaying the new form.

I've tried various combinations of attempting to set ShowPopOver false, apply changes, refreshform, etc etc but whatever I do the popover seems to really want to stay visible. Interestingly, if I take out the OpenForm and just let my javascript set ShowPopover to FALSE, the popover disappears as expected, although (of course) I remain on the first form.

So... in an offline scenario, what is the correct sequence of commands to get rid of the popover AND fire up a new form as STACK?

Sorry if this is answered elsewhere... again I've had a good look around and couldn't see anything relevant.

Cheers for now.

Marcus.
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: (RDMLX) OpenForm Stack from a PopOver Form

Post by tsupartono »

This sounds like a bug to me.
Can you file a bug report with LANSA Support?
What is the urgency on this?
MarcusLancaster
Posts: 48
Joined: Wed Nov 06, 2013 1:28 am

Re: (RDMLX) OpenForm Stack from a PopOver Form

Post by MarcusLancaster »

Hi.

Sorry for delayed feedback - but I can confirm that the latest version of LR fixes this problem. :-)

Thanks Tony!
MarcusLancaster
Posts: 48
Joined: Wed Nov 06, 2013 1:28 am

Re: (RDMLX) OpenForm Stack from a PopOver Form

Post by MarcusLancaster »

Hi all.

Bizarrely, 18 months on, I've encountered a similar, but slightly strange problem...

I've simplified it a little here, but in essence initially I've got an offline RDMLX form. "onload" logic on that form causes a popover to show. On that popover I've got a button which when pressed fires off some javascript to open a second offline form. The script looks like this;

...

function()
{
this.q_setProperties({'SharedStates.MYGLOBALVAR':'FALSE'});
this.q_apply();
},

function()
{
this.q_setProperties({'RunOperation.Type':'OpenForm','RunOperation.Name':'LRFORMB','RunOperation.PresentMode':'STACK'});
},

null


That all works and the second form is displayed... but when I use the back button to return to the first form, the popover is still displayed. Now ideally I want that popover to have been hidden on the first form.

So... I added this javascript

this.q_setProperties({'form.showpopover':'FALSE'});

to the above code to give;

function()
{
this.q_setProperties({'SharedStates.MYGLOBALVAR':'FALSE','form.showpopover':'FALSE'});
this.q_apply();
},

function()
{
this.q_setProperties({'RunOperation.Type':'OpenForm','RunOperation.Name':'LRFORMB','RunOperation.PresentMode':'STACK'});
},

null


The bizarre thing is now that instead of hiding the popover on the first form, it now persists onto the second??!?

So... is there a way for me to force a shut down of the popover on the first form, before leaving for the second form? As with my original post I've tried various combinations of q_apply, refreshform etc... but either the popover persists through to the second form, or the popover is still there when I go back to the first form.

Any suggestions would be most welcome.

Cheers for now.

Marcus.
jasonzhou
Posts: 130
Joined: Wed Jan 11, 2017 3:26 pm

Re: (RDMLX) OpenForm Stack from a PopOver Form

Post by jasonzhou »

Hi Marcus,

An OnReturn event will be fired when return to first form. Your can close popover in it.

The JavaScript code looks like this:

Code: Select all

function() 
{ 
    this.q_setProperty({..., 'RunOperation.OnReturn':'FormClosed'});
}, 
RDMLX:

Code: Select all

When (= FormClosed)
    #Com_Owner.Set_Form Show_Popover(FALSE)

Thanks
Jason
MarcusLancaster
Posts: 48
Joined: Wed Nov 06, 2013 1:28 am

Re: (RDMLX) OpenForm Stack from a PopOver Form

Post by MarcusLancaster »

Hi Jason.

That onReturn could be very, very useful... but how do I detect it / code for it when the caller form is offline?

I've tried defining a set_OP_Execscript to listen for the event... something like...

#com_owner.set_OP_execscript event('/form.FormClosed') resource(...) script(...)

but I get syntax errors at runtime because that event isn't valid. What syntax should I use? How do i pick up that event in an offilne RDMLX form?

Cheers for now.

Marcus.
jasonzhou
Posts: 130
Joined: Wed Jan 11, 2017 3:26 pm

Re: (RDMLX) OpenForm Stack from a PopOver Form

Post by jasonzhou »

Hi Marcus,

You can specify Execscript operation to OnReturn event. For example:

Open form

Code: Select all

this.q_setProperties({...
                      'RunOperation.PresentMode':'STACK',
                      'RunOperation.OnReturn.Operation.Type':'Execscript',
                      'RunOperation.OnReturn.Operation.Resource':'closepopover.js'}); 
Close popover (closepopover.js)

Code: Select all

lrexec( 
    function() 
    { 
        this.q_setProperties({'Form.ShowPopover':'False'});
        this.q_apply();
    }, 
    
    null 
);
Thanks
Jason
Post Reply