Template |
Description |
Simple Declarative Action |
Adds a @Jpf.SimpleAction annotation to the controller class.
@Jpf.Controller(simpleActions = {
@Jpf.SimpleAction(name = "simpleDeclarativeAction", ...) }
public class CustomerManagementController extends PageFlowController
|
Basic Method Action |
Adds a minimal action method to the controller class.
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "customers.jsp") })
public Forward basicMethodAction(FormBean form) {
Forward forward = new Forward("success");
return forward;
}
|
Control Method Call |
Adds an action method that (1) takes a Form Bean parameter
(provided the control method takes input), (2) calls a control
method, and (3) forwards the result of the control method
to a page input (provided the control method returns something
other than void).
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "customers.jsp", actionOutputs = { @Jpf.ActionOutput(name = "returnValueName", type = model.Customer.class) }) })
public Forward controlMethodCall(FormBean form) {
Forward forward = new Forward("success");
java.lang.Integer id = form.getCustomer().getId();
model.Customer returnValueName = customerControl.getCustomerById(id);
forward.addActionOutput("returnValueName", returnValueName);
return forward;
}
|
Get Item For Display Via Control |
Adds an action that takes an item off the user request
and forwards the item as an action output to a JSP page input.
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "customers.jsp", actionOutputs = { @Jpf.ActionOutput(name = "returnValueName", type = model.Customer.class) }) })
public Forward getItemForDisplay() {
Forward forward = new Forward("success");
String param1 = getRequest().getParameter("id");
java.lang.Integer id = TypeUtils.convertToIntegerObject(param1);
model.Customer returnValueName = customerControl.getCustomerById(id);
forward.addActionOutput("returnValueName", returnValueName);
return forward;
}
|
Get Item For Edit Via Control |
Adds an action that takes an item off the user request
and forwards the item as an output form.
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "customers.jsp") })
public Forward getItemForEdit() {
Forward forward = new Forward("success");
String param1 = getRequest().getParameter("id");
java.lang.Integer id = TypeUtils.convertToIntegerObject(param1);
model.Customer returnValueName = customerControl.getCustomerById(id);
GetItemForEditFormBean outputForm = new GetItemForEditFormBean();
outputForm.setReturnValueName(returnValueName);
forward.addOutputForm(outputForm);
return forward;
}
|
Delete Item Via Control |
Adds an action that takes an item off the user request
and invokes a delete method on the control.
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "customers.jsp", actionOutputs = { @Jpf.ActionOutput(name = "returnValueName", type = model.Customer.class) }) })
public Forward deleteItem() {
Forward forward = new Forward("success");
String param1 = getRequest().getParameter("id");
java.lang.Integer id = TypeUtils.convertToIntegerObject(param1);
model.Customer returnValueName = customerControl.deleteCustomerById(id);
forward.addActionOutput("returnValueName", returnValueName);
return forward;
} |
Add Item Via Control |
Add an action that takes data from the posted form and
invokes an add method on the control.
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "customers.jsp", actionOutputs = { @Jpf.ActionOutput(name = "returnValueName", type = model.Customer.class) }) })
public Forward addItem(FormBean form) {
Forward forward = new Forward("success");
java.lang.Integer id = form.getCustomer().getId();
model.Customer returnValueName = customerControl.getCustomerById(id);
forward.addActionOutput("returnValueName", returnValueName);
return forward;
}
|
Update Item Via Control |
Takes data from the posted form and invokes an update method
on the control.
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "customers.jsp", actionOutputs = { @Jpf.ActionOutput(name = "returnValueName", type = model.Customer.class) }) })
public Forward updateItem(FormBean form) {
Forward forward = new Forward("success");
java.lang.Integer id = form.getCustomer().getId();
model.Customer returnValueName = customerControl.getCustomerById(id);
forward.addActionOutput("returnValueName", returnValueName);
return forward;
}
|