Compiere 3.1

org.compiere.web.sample
Class SampleWindowImpl

java.lang.Object
  extended by org.compiere.web.sample.SampleWindowImpl
All Implemented Interfaces:
WindowImplIntf

public class SampleWindowImpl
extends Object
implements WindowImplIntf

Sample WindowImpl class for creating custom Forms for the Compiere Web UI.

Author:
gwu

Constructor Summary
SampleWindowImpl(int windowNO, Ctx serverCtx, WindowCtx windowCtx, UWindowID uid)
           
 
Method Summary
 WindowVO.ClientWindowType getClientWindowType()
          Implement this method to indicate the type of client-side UI that should be used to render this window.
 ArrayList<ComponentImplIntf> getComponents()
           
 Box getLayout()
          Implement this method to return a custom layout for the components.
 String getName()
          Implement this method to return the translated name for the window.
 ChangeVO processCallback(String sender)
          This method allows the WindowImplIntf to handle callbacks from the client.
 void validateResponse(ResponseVO responseVO)
          This method provides a mechanism for the server-side code to signal errors or warnings to the client upon the initial loading of the window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleWindowImpl

public SampleWindowImpl(int windowNO,
                        Ctx serverCtx,
                        WindowCtx windowCtx,
                        UWindowID uid)
Method Detail

getClientWindowType

public WindowVO.ClientWindowType getClientWindowType()
Description copied from interface: WindowImplIntf
Implement this method to indicate the type of client-side UI that should be used to render this window. Only GENERIC_STACK is officially supported for 3rd party custom windows in this release.

Specified by:
getClientWindowType in interface WindowImplIntf
Returns:
The client window type, or null to use the default.

getComponents

public ArrayList<ComponentImplIntf> getComponents()
Specified by:
getComponents in interface WindowImplIntf
Returns:
The list of ComponentImplIntf objects that handle the data retrieval for each component in the window.

getLayout

public Box getLayout()
Description copied from interface: WindowImplIntf
Implement this method to return a custom layout for the components. Note that this layout mechanism is currently only supported for client window type of GENERIC_STACK.

Specified by:
getLayout in interface WindowImplIntf
Returns:
The layout specified using the Box model, or null to use the default layout.

getName

public String getName()
Description copied from interface: WindowImplIntf
Implement this method to return the translated name for the window. The language should be identified via the Ctx object passed in through the constructor.

Specified by:
getName in interface WindowImplIntf
Returns:
The translated name of the window, or null to not display the name.

processCallback

public ChangeVO processCallback(String sender)
Description copied from interface: WindowImplIntf
This method allows the WindowImplIntf to handle callbacks from the client. By default, the fields that are buttons or have FieldVO.isImpactsValue = true will automatically trigger a callback to this method to allow server-side processing, e.g. dynamically changing the window layout, or perform database operations.

Specified by:
processCallback in interface WindowImplIntf
Parameters:
sender - The name of the field that initiated the callback.
Returns:
The ChangeVO indicating the types of changes that should be reflected in the client UI, e.g. changed field values, message pop-ups, new window layouts, etc.

validateResponse

public void validateResponse(ResponseVO responseVO)
Description copied from interface: WindowImplIntf
This method provides a mechanism for the server-side code to signal errors or warnings to the client upon the initial loading of the window. This is done by calling ResponseVO.addError() or ResponseVO.addWarning() if error conditions are detected. Note that if you want to use this method for validation during processCallback(), you need to call this method explicitly yourself.

Specified by:
validateResponse in interface WindowImplIntf
Parameters:
responseVO - The ResponseVO object that will be passed back to the client.

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.