0

How can I change the status bar text in an ADempiere window in order to show a message when a new record is created?

Also, how can I create a pop-up that appears when a new record is created?

pnuts
  • 58,317
  • 11
  • 87
  • 139

2 Answers2

0

You can put a message in center of window when a new record is created, this function already exists on iDempiere, but on ADempiere you'll need to change code for each docaction, or for each table you code is listening for.

On Idempiere you can check the code of class AbstractADWindowContent.java on package org.adempiere.ui.zk check this link , line 2104

Arthur Melo
  • 454
  • 5
  • 13
0

You can put a status message in status bar in Adempiere using the following method in org.compiere.model.GridTable

/**
 *  Create and fire Data Status Info Event
 *  @param AD_Message message
 *  @param info additional info
 */
protected void fireDataStatusIEvent (String AD_Message, String info)
{
    DataStatusEvent e = createDSE();
    e.setInfo(AD_Message, info, false,false);
    fireDataStatusChanged (e);
}

You will find an example of its use within the same class, when a row is saved via the dataSave(boolean) method. If all goes to plan and record is saved at the end of the method you'll see

fireDataStatusIEvent("Saved", "");

This puts the default “Saved” message see in the application when you click save in any tab.

There are two recommended approaches to customising Adempiere.

  1. Callouts; are used to add complex defaulting & validation in the User Interface
  2. Model Validators; are used to apply business logic or validation when a number of data model events, such as a record being saved, occur. But, not all changes are happening at the time the UI events are occurring... as with the accounting module, for example, so the model validator mechanisms assume no user interface exists.

Your requirement to have something happen in the UI when a data model event occurs falls between the two. For your requirement it might be easiest just to modify this default message (highlighted above in dataSave()) to display what you would like. But GridTable is at the core of the application so keep in mind that any time you update/upgrade Adempiere in the future you will need to make this modification again!

Colin Rooney
  • 439
  • 7
  • 15