Hi All,
I have created a new component, it has a form widget, with FirstName,
LastName and Submit Button.
the target of my form is processFirstForm and method is post.
I am able to see the firstname, lastname, submit button but when I fill up
the form and click submit it goes to my desired new screen - OneFormScreen
but its blank.
I have added java handler in controller.xml
My Screen is
***********************************************************************************************
<screen name="OneFormScreen">
<section>
<widgets>
<decorator-screen name="xhtml-decorator">
<decorator-section name="body">
<label text="A Screen with just 1 form."/>
<include-form name="FirstForm"
location="component://calculator/widget/calculator/calcForms.xml"/>
<section>
<condition><not><if-empty field-name="parameters.submit"/></not></condition>
<widgets>
<container><label text="firstName: ${parameters.firstName}"/>
</container>
<container><label text="lastName: ${parameters.lastName}"/>
</container>
<container><label text="combined: ${parameters.combined}"/>
</container>
<container><label text="submit: ${parameters.submit}"/></container>
<container><label text="All the parameters we received:"/>
</container>
<container><label text="${parameters.allParams}"/></container>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
***********************************************************************************************
controller.xml has
***********************************************************************************************
<request-map uri="processFirstForm">
<event type="java" path="org.ofbiz.calculator.calculator.calculatorEvents"
invoke="processFirstForm"/>
<response name="success" type="view" value="OneFormScreen"/>
</request-map>
<view-map name="OneFormScreen" type="screen"
page="component://calculator/widget/calculator/calcScreens.xml#OneFormScreen"/>
***********************************************************************************************
My Java class is
*******************************************************************************************
public class calculatorEvents {
public static String processFirstForm(HttpServletRequest
request,HttpServletResponse response){
String firstName = request.getParameter("firstName");
String lastName = request.getParameter("lastName");
request.setAttribute("combined", firstName + " " + lastName);
request.setAttribute("allParams", UtilHttp.getParameterMap(request));
request.setAttribute("submit", "Submitted");
return "success";
}
}
*******************************************************************************************
I would really appreciate your help.
Thanks in advance.
--
View this message in context:
http://www.nabble.com/Java-Class-tp24637295p24637295.html
Sent from the OFBiz - User mailing list archive at Nabble.com.