ajax4jsf/RichFaces
- is an open source framework that adds
Step 1: (add jar files & make changes into the web.xml file)
...
context-param param-nameorg.richfaces.SKIN
param-valueblueSky
filter-mapping
filter-namerichfaces
Step 2:
class Bean {
private int first;
private int second;
private int result;
public String action() {
result = first+second;
return null;
}
}
Step 3:
index.jsp
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<rich:panel header="Calculate Sum" style="width:200px" > <!--allows to place the page elements in rectangle
panel that can be skinned -->
First: <h:inputText
value="#{Bean.first}" /> <br>
Second: <h:inputText
value="#{Bean.second}" /> <br>
<%--reRender contains
the element id(or multiple ids) which will be updated after the
reRender="result" />
value="#{Bean.result}" id="result" /> </rich:panel>
</h:form>
No comments:
Post a Comment