Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: ON TIMER trigger in Dynamic Dialogs  (Read 9676 times)
Susobh S.
Posts: 22


« on: April 11, 2020, 05:03:35 pm »

Hi,

Is there any way that i can implement an ON TIMER trigger in dynamic dialogs?
addTrigger method doesnt seem to accept ON TIMER and ON IDLE triggers and raise runtime error

Is they any workarround for this?
Sebastien F.
Four Js
Posts: 509


« Reply #1 on: April 12, 2020, 11:43:05 am »

Hello!

We have a ticket registered for that:

  https://4js.com/support/issue/?id=FGL-05133#startissue

We plan to enhance dynamic dialogs in the next major version.

I don't think there is a workaround.

Maybe we can better help if you describe what you want to do.

You can create a support request and describe details here:

  https://4js.com/support/support-request/

Cheers and take care!
Seb
Susobh S.
Posts: 22


« Reply #2 on: April 12, 2020, 12:06:54 pm »

Hi Seb,

Ok here goes my case.

In my menu, i have multiple folder page tabs for tasks notifications etc.
And all these will have a counter badge shown on them which shows the number of items in each tab.
The items in the tab only load when we click on the Tab with the help on ON ACTION trigger of PAGE. And some tabs has quite a lot items to list or some complex queries

So for getting the count, as well we have many complex queries that too multiple times to be executed which sometime takes quite some time to return the full count.
In our current case, the menu loading is stopped while getting this count which makes the menu loading very slow

So for working around i was thinking to have a webservice running in the backend which i can use to return the count,
And from my menu, i can do an asyncResponse every 10 seconds or so, in ON TIMER block so that our menu gets loaded instantly and user can already interact with the Menu, and once the asyncResponce is received, the count will be shown to the badge

My intention is to make the menu loading faster and the count selection to be an async process using a webservice.

Hope u got what im looking up to.
Reuben B.
Four Js
Posts: 1047


« Reply #3 on: April 13, 2020, 06:05:32 am »

Susobh,

From memory the Menu screens your colleagues showed me last time I was in KL were a WebComponent. 

If you still have a Web Component, then you can setup a Javascript timer to fire an ON ACTION event every X seconds, and then your 4gl code wether a static or dynamic dialog can simply respond to that ON ACTION.  If you don't have WebComponent then add one and hide it.  I used the technique in a small game demo I once wrote to end the players turn if they took too long.  I should probably check if the issues that were preventing me publishing that example have been resolved.

The other thing that may interest you, is if it was a native mobile app we would direct you towards Push Notifications http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_mobile_push_notifications.html.  So you may want to read through that and note the interfaces, the 3 front-calls to register, de-register, and get, and the pre-defined action that is triggered after you register.

Reuben






Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Susobh S.
Posts: 22


« Reply #4 on: April 13, 2020, 06:55:25 am »

Hi Reuben,

Yes you are right, The current implementation is using WebComponent, which we have some performance issues.
So i was in the middle of re-implementing the same design using Folder Page Tabs using Dynamic form generation and dynamic dialogs + GBC customization.

So now, i will try what you have suggested by having a hidden webcomponent and firing an action from webcomponent.

Thanks for the advice.

Susobh Sugathan
Susobh S.
Posts: 22


« Reply #5 on: April 13, 2020, 08:30:17 am »

Hi Reuben,

Yes you are right, The current implementation is using WebComponent, which we have some performance issues.
So i was in the middle of re-implementing the same design using Folder Page Tabs using Dynamic form generation and dynamic dialogs + GBC customization.

So now, i will try what you have suggested by having a hidden webcomponent and firing an action from webcomponent.

Thanks for the advice.

Susobh Sugathan


Hi Reuben,

May i know how the AUTO_LOGOUT will be effected? By using an Intervel timer in webcomponent, the AUTO_LOGOUT will work as of now?
Or will it make the AUTO_LOGOUT to not work.

Thanks And Regards
Susobh Sugathan
Sebastien F.
Four Js
Posts: 509


« Reply #6 on: April 13, 2020, 11:27:51 am »

Susobh,

Dynamic dialogs have been introduced to write generic code.
For example, see Reuben's zoom library on our github: https://github.com/FourjsGenero/fgl_zoom

It sounds to me that your form with menu + folder tabs is a specific case.
Is there any reason why you don't want to use regular "static" form and multiple-dialogs (DIALOG / END DIALOG) ?
What is the added value to use dynamic dialogs in such case?
What part of your form is "dynamic"?
Can't you manage to prepare a static form, hide some pieces by default and show them when needed?

Also, while I agree that we are missing features like ON TIMER / ON IDLE in dynamic dialogs and that a workaround in better than nothing, it sounds a bit over-engineered to setup a hidden webcomponent just to get a timer event...

To achieve robustness, I tend to keep things as simple as possible, even if it's not 100% perfect for end users...
Are these automatic counters really needed?
What about adding an action that fires the queries to count, on user demand?
Check for ex https://github.com/FourjsGenero/tool_fglsqldebug, see the "Profiling" -> "Globals statistics" option.

Seb
Susobh S.
Posts: 22


« Reply #7 on: April 13, 2020, 11:54:09 am »

Hi Seb,

Quote
Is there any reason why you don't want to use regular "static" form and multiple-dialogs (DIALOG / END DIALOG) ?
What is the added value to use dynamic dialogs in such case?

Yes I could use Dynamic form Generation and regular multiple-dialogs (DIALOG / END DIALOG).
But I was interested in the dynamic trigger of the Dynamic Dialogs where by i can add ON ACTION triggers dynamically or even inside loop.
currently our Menu Design has multiple Button element styled as 'Link' each raising different actions.(100's or 1000's based on the Menu access setup)

So in a normal DIALOG, giving all these ON ACTION triggers statically is not possible, where by in DYNAMIC DIALOG's i can call DIALOG.addTrigger()  inside an array which store the actions, and can easily manage using DIALOG.nextEvent() function.

Quote
What part of your form is "dynamic"?
I have multiple Folder Tabs, each Tab having Multiple Groups aligned horizontally, each group having multiple buttons aligned vertically all dynamic(depends on MENU access setup for each user)

Quote
Can't you manage to prepare a static form, hide some pieces by default and show them when needed?
Not Possible since we have many menu items, and handling becomes difficult.


Thanks And Regards
Susobh Sugathan


Susobh S.
Posts: 22


« Reply #8 on: April 13, 2020, 11:59:55 am »

Hi,
Quote
Is there any reason why you don't want to use regular "static" form and multiple-dialogs (DIALOG / END DIALOG) ?
What is the added value to use dynamic dialogs in such case?

Yes I could use Dynamic form Generation and regular multiple-dialogs (DIALOG / END DIALOG).
But I am interested in the dynamic trigger of the Dynamic Dialogs where by i can add ON ACTION triggers dynamically or even inside loop.
currently our Menu Design has multiple Button element styled as 'Link' each raising different actions.(100's or 1000's based on the Menu access setup)

So in a normal DIALOG, giving all these ON ACTION triggers statically is not possible, where by in DYNAMIC DIALOG's i can call DIALOG.addTrigger()  inside an array which store the actions, and can easily manage using DIALOG.nextEvent() function.
Sebastien F.
Four Js
Posts: 509


« Reply #9 on: April 13, 2020, 12:15:59 pm »

Susobh,

If that form is "just" to display a global application menu, (if not done yet,) you should consider to use a treeview.
See for ex https://github.com/FourjsGenero/ex_app_menu
But I guess you have tried it, or someone already suggested it, and it was not good enough for your case.

About many actions handling:
If Genero would have a way to identify the AUI node id of the element that triggered an action, you could define a single action for all your menu options / links and identify the source node in the code ...
I think we discussed this once internally, but could not find a trace in our issue database.

Seb
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines