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 (44.7 KiB) Viewed 4678 times
And when it is unsinstalled and restarted, the button disappeared when records are selected.

PluginAbsent.png (37.04 KiB) Viewed 4678 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 (33.37 KiB) Viewed 4678 times
Then in the InfoProcess' DisplayLogic.

InfoProcessDIsplayLogic.png (47.14 KiB) Viewed 4678 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.
Site Admin
Posts: 2762
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Return to iDempiere

Who is online

Users browsing this forum: No registered users and 1 guest