iLogic form, how to check if form is shown?

hollypapp65
Explorer
Explorer

iLogic form, how to check if form is shown?

hollypapp65
Explorer
Explorer

How to check if an iLogic form is active/shown?

0 Likes
Reply
Accepted solutions (1)
124 Views
6 Replies
Replies (6)

CCarreiras
Mentor
Mentor

I believe is not possible to check that.

 

...only the old way... looking to the screen 😅

CCarreiras

EESignature

hollypapp65
Explorer
Explorer

It is not a Dockable window.

I'll dig deeper.

0 Likes

mslosar
Advisor
Advisor
Accepted solution

best i could think of is put it in a try/catch.  Though, the form not showing would have to actually trigger an error. There is no 'formSuccess' function or anything.  You can detect if they click yes/no/cancel, but I am not aware of anything telling if it displayed or not.

0 Likes

hollypapp65
Explorer
Explorer

I'm making an "interactive" form.

Using check box to enable/disable different options.

Also change options in multilist properties.

Using a rule trigger by "Any user parameter change".

I want to "disable" the trigger when form is not shown.

So I'm try to add:

If Form.shown then

'only run update when form is active/shown

End if

0 Likes

mslosar
Advisor
Advisor

I get the idea, but i'm not sure the option exists. I would think, in theory, if you're triggering a box on a parameter change, that you'd make you choices in the box and 'OK' it so the box goes away, then any subsequent change triggers a new box.  If you're going to leave it on the screen, you'd need to detect it's presences, clear it, and reload it.

 

Not sure it's within the realm of ilogic, but you could use a rule to trigger the form, and something in it along the lines of 'if Launched = 1 then nothing, else show form.  In your form, when it initializes, set launched = 1. When you close the form, set Launched = 0. That gives you something to key on, but there there's no built in event for this. If you are trying to keep this solely within ilogic, you'd have to assume the form always successfully launches. In which case you could do something like

 

if Launched = 0 then

   Launched = 1

   show.form

   Launched = 0 'not sure if this works in ilogic the way it does in .net where it doesn't pass show.form until you close the form.

else

   'form is already open, so do nothing

end if

 

Only thing is, not sure there is a way in pure ilogic to set Launched back to 0 when you close the form. You can do it in .net or VBA though, but then it won't trigger as a rule most likely.

hollypapp65
Explorer
Explorer

I use True/False user parameter.

It work only when form is modal.

Parameter("FormActive") = True
iLogicForm.Show("Cab Config Test", FormMode.Modal)
Parameter("FormActive") = False
0 Likes