# PageInputController.jpf Sample

This topic inludes the source code for the PageInputController.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_databinding/declarePageInput/

## Sample Source Code

`001 package tagSamples.netui_databinding.declarePageInput; 002 import com.bea.wlw.netui.pageflow.Forward; 003 import com.bea.wlw.netui.pageflow.PageFlowController; 004 import com.bea.wlw.netui.pageflow.FormData; 005 import tagSamples.netui_databinding.declarePageInput.ItemsDBControl; 006 import java.sql.SQLException; 007 import tagSamples.netui_databinding.declarePageInput.ItemsDBControl.Item; 008 009 /** 010 * @jpf:controller 011 * @jpf:view-properties view-properties:: 012 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 013 * <view-properties> 014 * <pageflow-object id="pageflow:/tagSamples/netui_databinding/declarePageInput/PageInputController.jpf"/> 015 * <pageflow-object id="action:begin.do"> 016 * <property value="60" name="x"/> 017 * <property value="60" name="y"/> 018 * </pageflow-object> 019 * <pageflow-object id="action:simple.do"> 020 * <property value="60" name="x"/> 021 * <property value="140" name="y"/> 022 * </pageflow-object> 023 * <pageflow-object id="action:next.do"> 024 * <property value="60" name="x"/> 025 * <property value="220" name="y"/> 026 * </pageflow-object> 027 * <pageflow-object id="action-call:@page:index.jsp@#@action:simple.do@"> 028 * <property value="324,210,210,96" name="elbowsX"/> 029 * <property value="52,52,132,132" name="elbowsY"/> 030 * <property value="West_1" name="fromPort"/> 031 * <property value="East_1" name="toPort"/> 032 * </pageflow-object> 033 * <pageflow-object id="page:index.jsp"> 034 * <property value="360" name="x"/> 035 * <property value="60" name="y"/> 036 * </pageflow-object> 037 * <pageflow-object id="action-call:@page:simple.jsp@#@action:next.do@"> 038 * <property value="324,210,210,96" name="elbowsX"/> 039 * <property value="143,143,212,212" name="elbowsY"/> 040 * <property value="West_2" name="fromPort"/> 041 * <property value="East_1" name="toPort"/> 042 * </pageflow-object> 043 * <pageflow-object id="page:simple.jsp"> 044 * <property value="360" name="x"/> 045 * <property value="140" name="y"/> 046 * </pageflow-object> 047 * <pageflow-object id="action-call:@page:next.jsp@#@action:begin.do@"> 048 * <property value="324,210,210,96" name="elbowsX"/> 049 * <property value="212,212,52,52" name="elbowsY"/> 050 * <property value="West_1" name="fromPort"/> 051 * <property value="East_1" name="toPort"/> 052 * </pageflow-object> 053 * <pageflow-object id="page:next.jsp"> 054 * <property value="360" name="x"/> 055 * <property value="220" name="y"/> 056 * </pageflow-object> 057 * <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@"> 058 * <property value="96,210,210,324" name="elbowsX"/> 059 * <property value="52,52,52,52" name="elbowsY"/> 060 * <property value="East_1" name="fromPort"/> 061 * <property value="West_1" name="toPort"/> 062 * <property value="success" name="label"/> 063 * </pageflow-object> 064 * <pageflow-object id="forward:path#simple#simple.jsp#@action:simple.do@"> 065 * <property value="96,210,210,324" name="elbowsX"/> 066 * <property value="132,132,132,132" name="elbowsY"/> 067 * <property value="East_1" name="fromPort"/> 068 * <property value="West_1" name="toPort"/> 069 * <property value="simple" name="label"/> 070 * </pageflow-object> 071 * <pageflow-object id="forward:path#success#next.jsp#@action:next.do@"> 072 * <property value="96,210,210,324" name="elbowsX"/> 073 * <property value="212,212,212,212" name="elbowsY"/> 074 * <property value="East_1" name="fromPort"/> 075 * <property value="West_1" name="toPort"/> 076 * <property value="success" name="label"/> 077 * </pageflow-object> 078 * <pageflow-object id="control:tagSamples.netui_databinding.declarePageInput.ItemsDBControl#itemsDB"> 079 * <property value="26" name="x"/> 080 * <property value="34" name="y"/> 081 * </pageflow-object> 082 * <pageflow-object id="formbeanprop:tagSamples.netui_databinding.declarePageInput.PageInputController.SimpleForm#stringProperty#java.lang.String"/> 083 * <pageflow-object id="formbean:tagSamples.netui_databinding.declarePageInput.PageInputController.SimpleForm"/> 084 * </view-properties> 085 * :: 086 */ 087 public class PageInputController extends PageFlowController 088 { 089 protected global.Global globalApp; 090 091 /** 092 * @common:control 093 */ 094 private tagSamples.netui_databinding.declarePageInput.ItemsDBControl itemsDB; 095 096 /** 097 * This method represents the point of entry into the pageflow 098 * @jpf:action 099 * @jpf:forward name="success" path="index.jsp" 100 */ 101 protected Forward begin() 102 { 103 return new Forward("success"); 104 } 105 106 107 /** 108 * @jpf:action 109 * @jpf:forward name="simple" path="simple.jsp" 110 */ 111 public Forward simple() 112 { 113 Forward f = new Forward("simple"); 114 115 f.addPageInput("fooBean", new FooBean()); 116 f.addPageInput("barBean", new BarBean()); 117 f.addPageInput("simpleForm", new SimpleForm()); 118 return f; 119 } 120 121 122 /** 123 * @jpf:action 124 * @jpf:forward name="success" path="next.jsp" 125 */ 126 public Forward next() 127 throws SQLException 128 { 129 Item[] items = itemsDB.getAllItems(); 130 return new Forward("success", "items", items); 131 } 132 133 134 public static class FooBean 135 { 136 private String foo = "A Foo String"; 137 138 public String getFoo() 139 { 140 return foo; 141 } 142 143 public void setFoo(String foo) 144 { 145 this.foo = foo; 146 } 147 } 148 149 public static class BarBean 150 { 151 private String bar = "A Bar String"; 152 private boolean barBoolean = true; 153 154 public boolean getBarBoolean() 155 { 156 return barBoolean; 157 } 158 159 public String getBar() 160 { 161 return bar; 162 } 163 164 public void setBar(String bar) 165 { 166 this.bar = bar; 167 } 168 } 169 170 public static class SimpleForm 171 extends FormData 172 { 173 private String stringProperty = "A String Property"; 174 175 public String getStringProperty() 176 { 177 return stringProperty; 178 } 179 180 public void setStringProperty(String stringProperty) 181 { 182 this.stringProperty = stringProperty; 183 } 184 } 185 }`