ImageButtonController.jpf Sample

This topic inludes the source code for the ImageButtonController.jpf Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui/imageButton/

Sample Source Code


001 package tagSamples.netui.imageButton;
002 import com.bea.wlw.netui.pageflow.FormData;
003 import com.bea.wlw.netui.pageflow.Forward;
004 import com.bea.wlw.netui.pageflow.PageFlowController;
005 import java.util.Date;
006 
007 /**
008  * @jpf:controller
009  * @jpf:view-properties view-properties::
010  <!-- This data is auto-generated. Hand-editing this section is not recommended. -->
011  <view-properties>
012  <pageflow-object id="pageflow:/tagSamples/netui/imageButton/ImageButtonController.jpf"/>
013  <pageflow-object id="action:begin.do">
014  *   <property value="80" name="x"/>
015  *   <property value="120" name="y"/>
016  </pageflow-object>
017  <pageflow-object id="action:processA.do#tagSamples.netui.imageButton.ImageButtonController.ProcessDataForm">
018  *   <property value="240" name="x"/>
019  *   <property value="240" name="y"/>
020  </pageflow-object>
021  <pageflow-object id="page:index.jsp">
022  *   <property value="80" name="x"/>
023  *   <property value="240" name="y"/>
024  </pageflow-object>
025  <pageflow-object id="page:showData.jsp">
026  *   <property value="240" name="x"/>
027  *   <property value="120" name="y"/>
028  </pageflow-object>
029  <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@">
030  *   <property value="80,80,80,80" name="elbowsX"/>
031  *   <property value="164,180,180,196" name="elbowsY"/>
032  *   <property value="South_1" name="fromPort"/>
033  *   <property value="North_1" name="toPort"/>
034  *   <property value="success" name="label"/>
035  </pageflow-object>
036  <pageflow-object id="forward:path#success#showData.jsp#@action:processA.do#tagSamples.netui.imageButton.ImageButtonController.ProcessDataForm@">
037  *   <property value="240,240,240,240" name="elbowsX"/>
038  *   <property value="196,180,180,164" name="elbowsY"/>
039  *   <property value="North_1" name="fromPort"/>
040  *   <property value="South_1" name="toPort"/>
041  *   <property value="success" name="label"/>
042  </pageflow-object>
043  <pageflow-object id="formbeanprop:tagSamples.netui.imageButton.ImageButtonController.ProcessDataForm#firstname#java.lang.String"/>
044  <pageflow-object id="formbeanprop:tagSamples.netui.imageButton.ImageButtonController.ProcessDataForm#lastname#java.lang.String"/>
045  <pageflow-object id="formbean:tagSamples.netui.imageButton.ImageButtonController.ProcessDataForm"/>
046  <pageflow-object id="action-call:@page:showData.jsp@#@action:begin.do@">
047  *   <property value="204,160,160,116" name="elbowsX"/>
048  *   <property value="112,112,112,112" name="elbowsY"/>
049  *   <property value="West_1" name="fromPort"/>
050  *   <property value="East_1" name="toPort"/>
051  </pageflow-object>
052  <pageflow-object id="action-call:@page:index.jsp@#@action:processA.do#tagSamples.netui.imageButton.ImageButtonController.ProcessDataForm@">
053  *   <property value="116,160,160,204" name="elbowsX"/>
054  *   <property value="232,232,232,232" name="elbowsY"/>
055  *   <property value="East_1" name="fromPort"/>
056  *   <property value="West_1" name="toPort"/>
057  </pageflow-object>
058  </view-properties>
059  * ::
060  */
061 public class ImageButtonController extends PageFlowController
062 {
063 
064 
065     // Uncomment this declaration to access Global.app.
066     // 
067     //     protected global.Global globalApp;
068     // 
069 
070     // For an example of page flow exception handling see the example "catch" and "exception-handler"
071     // annotations in {project}/WEB-INF/src/global/Global.app
072 
073     /**
074      * This method represents the point of entry into the pageflow
075      * @jpf:action
076      * @jpf:forward name="success" path="index.jsp"
077      */
078     protected Forward begin()
079     {
080         return new Forward("success");
081     }
082 
083     /**
084      * @jpf:action
085      * @jpf:forward name="success" path="showData.jsp"
086      */
087     protected Forward processA(ProcessDataForm form)
088     {
089         getRequest().setAttribute("submittedData", form);
090         return new Forward("success");
091     }
092 
093 
094     /**
095      * FormData get and set methods may be overwritten by the Form Bean editor.
096      */
097     public static class ProcessDataForm extends FormData
098     {
099         private String lastname;
100 
101         private String firstname;
102 
103         public void setFirstname(String firstname)
104         {
105             this.firstname = firstname;
106         }
107 
108         public String getFirstname()
109         {
110             return this.firstname;
111         }
112 
113         public void setLastname(String lastname)
114         {
115             this.lastname = lastname;
116         }
117 
118         public String getLastname()
119         {
120             return this.lastname;
121         }
122     }
123 }