Create a page as per below.
Requirement is when you click on Swap button what ever the text you will have in the Enter some text column , it should be display on that Entered Text field.
So create one controller on main region and in Process form request write below code and import the related package.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item1");
OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.findChildRecursive("item2");
mst.setValue(pageContext,name);
}
}
and To clear the Enter some text filed value after clicking on the Swap button use below code.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item1");
OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.findChildRecursive("item2");
mst.setValue(pageContext,name);
OAMessageTextInputBean mtib =(OAMessageTextInputBean)webBean.findChildRecursive("item1");
mtib.setValue(pageContext,null);
}
}
Requirement is when you click on Swap button what ever the text you will have in the Enter some text column , it should be display on that Entered Text field.
So create one controller on main region and in Process form request write below code and import the related package.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item1");
OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.findChildRecursive("item2");
mst.setValue(pageContext,name);
}
}
and To clear the Enter some text filed value after clicking on the Swap button use below code.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item1");
OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.findChildRecursive("item2");
mst.setValue(pageContext,name);
OAMessageTextInputBean mtib =(OAMessageTextInputBean)webBean.findChildRecursive("item1");
mtib.setValue(pageContext,null);
}
}
No comments:
Post a Comment