Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
jvx:client:gui:screen_parameters [2021/07/08 06:40]
admin created
jvx:client:gui:screen_parameters [2021/07/08 10:48] (current)
admin
Line 1: Line 1:
 ~~NOTRANS~~ ~~NOTRANS~~
-~~Title: ​WorkScreen ​Parameters~~+~~Title: ​Workscreen ​Parameters~~ 
 + 
 +A works-creen parameter is useful if you want to transfer information between screens. If you have a persons screen and it opens opens the contact screen, it would be useful to know the selected person in the contact screen. This is only one use-case another use-case could be that you control the layout of a screen. If you open a screen as popup, it could be useful to know that the screen is in popup mode. 
 + 
 +If you want to set a work-screen parameter, you have two options: 
 + 
 +1) set the parameter at custruction time \\  
 +2) set the parameter at any time 
 + 
 +An example: 
 + 
 +<code java> 
 +//​construction time 
 +IWorkScreen screen = getApplication().openWorkScreen("​com.apps.demo.ContactWorkScreen",​ new Parameter("​CONTACT_ID",​ rdb.getValue("​ID"​)));​ 
 + 
 +//later 
 +screen.setParameter("​MODE_CONTACT",​ Boolean.TRUE);​ 
 +</​code>​ 
 + 
 +It's also possible to listen on parameter changes in your work-screen:​ 
 + 
 +<code java> 
 +eventParameterChanged().addListener(this,​ "​doAnyParameterChanged"​);​ 
 +eventParameterChanged("​MODE_CONTACT"​).addListener(this,​ "​doModeContactChanged"​);​ 
 + 
 +public void doAnyParameterChanged(WorkScreen pScreen, String pParameter, Object pOldValue, Object pNewValue) throws Throwable 
 +
 +
 + 
 +//also possible 
 +//public void doModeContactChanged(WorkScreen pScreen, String pParameter, Object pOldValue, Object pNewValue) throws Throwable 
 +public void doModeContactChanged() throws Throwable 
 +
 +
 +</​code>​ 
 + 
 +If you read a parameter from a work-screen,​ e.g. 
 + 
 +<​code>​ 
 +screen.getParameter("​APPMODE"​) 
 +</​code>​  
 +and the parameter was not found in the work-screen,​ then the parameter will be requested from the application. The application also has getParameter. If the parameter is not set in the application,​ the [[jvx:​client:​gui:​application_parameters|launcher]] will be used. This mechanism makes it possible for a screen to configure itself based on launcher, application or a screen parameter. For the screen it makes no difference where the parameter was set. But be careful because the event listeners only work if you register on the right component. It's not possible to register a listener for a parameter of a screen and expect a change event, if you set the parameter in the application.
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information