Extend a standard Oracle MSCA/MWA page
source:http://apps2fusion.com/at/43-ss/293-extend-a-standard-oracle-mscamwa-page
In this Article, we will see how to extend a standard Oracle MSCA/MWA pages.
It
is a common requirement by most of the customers to do some
modifications to standard Mobile forms to suit their requirements
better. Most common requirements include:
-
Add a field to a page
-
Hide a field
-
Make a field Read only.
-
Change a LOV to Text and Vice versa.
-
Change the Labels
-
Default some values to a field. etc
I assume that the readers of this article have already gone through my previous articles as they need basic understanding of the MSCA/MWA Architecture.
As MSCA/MWA is based on Java, we can easily achieve this by the OOPS Concept "Inheritance". We create a new Java Class which inherits the Standard Oracle Java Class. In the new extended Java class, we have freedom to change the standard page behaviour without touching the Oracle Standard Java Source Code.
The Normal flow in MSCA Applications is described in the following diagram:
After we do the extension, the flow in the application will be like
-
Extend the MWA Function Class and make it point to the Extended page.
-
Extend the MWA Page Class.
-
Extend the MWA Listener Class.
-
Modify the Function Name in AOL to point to the New extended Function Class name.
public XXShipLPNFunction() {
super();
//Setting the page name to new custom page
setFirstPageName("xxx.oracle.apps.inv.wshtxn.server.XXShipLPNPage");
}
}
import oracle.apps.mwa.beans.ButtonFieldBean;
import oracle.apps.mwa.beans.TextFieldBean;
import oracle.apps.mwa.container.Session;
import oracle.apps.mwa.eventmodel.AbortHandlerException;
import oracle.apps.mwa.eventmodel.DefaultOnlyHandlerException;
import oracle.apps.mwa.eventmodel.InterruptedHandlerException;
import oracle.apps.mwa.eventmodel.MWAEvent;
import oracle.apps.mwa.eventmodel.MWAListener;
public class XXShipLPNPage extends ShipLPNPage {
public XXShipLPNPage(Session s) {
mTxtField = new TextFieldBean();
mTxtField.setName("XX_TEXT");
mTxtField.setPrompt("New Text");
mTxtField.addListener(xxListener);
mTxtField.setValue("Initial Text");
this.addFieldBean(3, mTxtField);
}
public void pageEntered(MWAEvent e) throws AbortHandlerException,
InterruptedHandlerException,
DefaultOnlyHandlerException {
super.pageEntered(e);
//Initialize Extended page.
initCustomPage(e);
//The purpose of this method will be explained in later articles.
public void initCustomPage(MWAEvent e) {
//Doc Door LOV initialization
String[] inputs =
{ " ", "TXN.DOCK", "ORGID", "xxx.oracle.apps.inv.wshtxn.server.XXShipLPNPage.ShipLPN.DockDoor" };
getDockDoorFld().setInputParameters(inputs);
//LPN Lov initialization
String[] lpnInputs =
{ " ", "ORGID", "LOCATORID", "TRIPID", "TRIPSTOPID",
"xxx.oracle.apps.inv.wshtxn.server.XXShipLPNPage.ShipLPN.LPN" };
getLpnFld().setInputParameters(lpnInputs);
Session session = e.getSession();
//Continue button initialization
ButtonFieldBean continueButton =
(ButtonFieldBean)session.getFieldFromCurrentPage("ShipLPN.Ship");
continueButton.removeListener((MWAListener)continueButton.getListeners().firstElement());
continueButton.addListener(xxListener);
}
XXShipLPNFListener xxListener = new XXShipLPNFListener(new Session());
}
import oracle.apps.mwa.container.Session;
public XXShipLPNFListener(Session s) {
super(s);
}
}
For MSCA/OAF consulting kindly contact us at senthilkumar.s.shanmugam@gmail.com