How to open an info window after login ?

275 views
Skip to first unread message

Nicolas Micoud

unread,
Dec 18, 2015, 9:38:11 AM12/18/15
to iDempiere
Hi,

Is there a way to open automatically an info window just after user log in ?
Not sure it would be possible using AFTER_LOGIN event.
 
My idea is to use the Action parameter in the URL (ATM only Zoom is used, i maybe could use "OpenSearchPanel")

Any idea ?

Thanks,

Nicolas

Carlos Antonio Ruiz Gomez

unread,
Dec 18, 2015, 2:03:09 PM12/18/15
to idem...@googlegroups.com
Nicolas, some time ago we the user efekto2k (from openxpertya) and I
checked for a possible way to set a set of menu entries to be opened
automatically for a user.

Could be something like adding to "Favorites" some flag to say "open at
login", maybe that exploratory idea could cover your requirement.

Regards,

Carlos Ruiz
> --

Nicolas Micoud

unread,
Dec 18, 2015, 3:50:09 PM12/18/15
to iDempiere
In fact, the role will have a single access to a info window.
He won't be able to open window, launch process, etc.
Maybe i could add a checkbox on AD_Role 'OpenThisInfoWindow'. And if its value is 'Y' then open it automatically.

What would be the best place to do that ? AdempiereWebUI ? Or - haven't tested - AFAIR, it is possible to launch a process from a dashboard. and if that process opens a window, that should work ?

But i keep in mind your idea (to select an item from menu for opening automatically ; perhaps it can be set in the UserPreference table (one field for type (window/info window), one field for the ID).

Thanks,

Nicolas

Nicolas Micoud

unread,
Jan 7, 2016, 11:43:31 AM1/7/16
to iDempiere
Here the code that i use at the end of AdempiereWebUI.loginCompleted():

        processParameters();

        if (Util_Tgi.isOpenInfoWindow()) { // here you can define your own conditions
           
MInfoWindow iw = MInfoWindow.get(<tablename>, null);
           
if (iw != null)
               
SessionManager.getAppDesktop().openInfo(iw.getAD_InfoWindow_ID());
       
}

If the logged role has access to an info window, it will open right after the login !

Regards,

Nicolas Micoud

unread,
Jan 8, 2016, 9:48:49 AM1/8/16
to iDempiere
Hi Carlos,

What do you think of this enhancement :

Add IsFavourite on AD_TreeBar (Yes/No field, mandatory)
Add AutomaticOpenSeqNo on AD_TreeBar (Numeric, non mandatory field)
Add a window based on that table

Then when a record is added on DPFavourites, we check if the AD_Menu_ID is already present in the table.
If yes, IsFavourite is set to Y.
Otherwise, we do the insert (and set IsFavourite = Y)

When a record is removed, if AutomaticOpenSeqNo is not null (means the record is automatically opened on login), we just set IsFavourite = N.
Otherwise, we remove the record (as today)

And when a user want to open a record at login, he opens the new window, search for the menu entry and write a sequence in AutomaticOpenSeqNo.
To remove it, he must empty the field or delete the record (which will also remove it from the favourites)

(Note that the records will be linked to user, not role)


Then for opening at login, we just add that code at the end of LoginCompleted :

Search record with AutomaticOpenSeqNo > 0 for current user.
For each :

if AD_Menu.Action = InfoWindow
 -> MInfoWindow iw = MInfoWindow.get("XXA_Dossier", null);

if (iw != null)
     SessionManager.getAppDesktop().openInfo(iw.getAD_InfoWindow_ID());
if AD_Menu.Action = Window
 -> ...


WDYT ?

Regards,

Nicolas




Le vendredi 18 décembre 2015 20:03:09 UTC+1, Carlos Antonio Ruiz Gómez a écrit :

Carlos Antonio Ruiz Gomez

unread,
Jan 8, 2016, 6:57:55 PM1/8/16
to idem...@googlegroups.com
Hi Nicolas, agree with your approach, to keep it simple we could just add the AutomaticOpenSeqNo (or maybe LoginOpenSeqNo).

We could not have an auto-open not in favourites - but I think that's ok.  But, if you prefer to have it complete, I'm fine with that too  :)

Regards,

Carlos Ruiz

Hiep Lq

unread,
Jan 11, 2016, 10:40:45 AM1/11/16
to iDempiere
how about when user refresh browse when already login?
i guess it will behavior like after login, i mean it also "open that windows"

Nicolas Micoud

unread,
Jan 12, 2016, 4:57:06 AM1/12/16
to iDempiere
Hello,

Patch uploaded https://idempiere.atlassian.net/browse/IDEMPIERE-3000.
I've choosen the "complete" stuff. One of my requirement is to open an info window and to refresh immediately when users logs in. (it display the work they have to do). So it is not always in the favourites panel.
You can keep it simple - you just forgot the new window. It works like before.


Regards,

Nicolas
Reply all
Reply to author
Forward
0 new messages