DisplayLogic Responsive to Plugin

The migration of Adempiere modules to iDempiere

DisplayLogic Responsive to Plugin

Postby red1 » Mon Sep 04, 2017 7:43 pm

(I wanted to do this for a long time and finally Hiep LQ gave me a good tip to use Env.setCtx.) We can make a DisplayLogic respond to whether a Plugin is present or not. For example i could make the BackOrder Management Info-Window CreateShipment Process button to disappear or appear accordingly.
Below is when the WMS Plugin is installed. Note the process buttons.

PluginInstalled.png
PluginInstalled.png (44.7 KiB) Viewed 2755 times
And when it is unsinstalled and restarted, the button disappeared when records are selected.

PluginAbsent.png
PluginAbsent.png (37.04 KiB) Viewed 2755 times
Below is how it is done. First we set the Plugin Event to record and set in Env Ctx() a value. In this case #WMS='Y'.

SetPluginInCtx.png
SetPluginInCtx.png (33.37 KiB) Viewed 2755 times
Then in the InfoProcess' DisplayLogic.

InfoProcessDIsplayLogic.png
InfoProcessDIsplayLogic.png (47.14 KiB) Viewed 2755 times
Here both plugins (BackOrder and WMS) could work more independently of each other. The code for CreateShipment can be in the other plugin and when that plugin is not installed, the process from there is not displayed in the calling plugin for use.

Thus a not found process classname error cannot occur as there is no button to call it in the first place! This is also perhaps the very first time iDempiere's OSGi feature can be made visible in the UI.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Return to iDempiere

Who is online

Users browsing this forum: Google [Bot] and 4 guests

cron