Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:p="http://primefaces.prime.com.tr/ui"
- xmlns:fn="http://java.sun.com/jsp/jstl/functions">
- <h:head>
- <title>Primefaces Testing Lab</title>
- </h:head>
- <h:body>
- <p:layout fullPage="true">
- <p:layoutUnit position="top" height="50" collapsible="false">
- <h1 class="title ui-widget-header ui-corner-all"
- style="padding: 5px; font-size: 150%; font-weight: bold; text-align: center; margin: 5px;">
- Primefaces Testing Lab
- </h1>
- </p:layoutUnit>
- <p:layoutUnit position="center" scrollable="true">
- <p:ajaxStatus style="width:16px;height:16px;">
- <f:facet name="start">
- Loading .......
- </f:facet>
- <f:facet name="complete">
- <h:outputText value="" />
- </f:facet>
- </p:ajaxStatus>
- <h:form prependId="false">
- <p:focus />
- <p:growl id="messages" globalOnly="true" />
- <p:fieldset legend="User Search Filter" toggleable="true" toggleSpeed="500" >
- <h:panelGrid columns="2">
- <h:outputLabel for="UserId" value="User Id" />
- <h:panelGroup>
- <h:inputText label="User Id" value="#{testUserBean.userIdFilter}"
- id="UserId" />
- <p:message for="UserId" />
- </h:panelGroup>
- <h:outputLabel for="UserName" value="User Name" />
- <h:panelGroup>
- <h:inputText label="User Name" value="#{testUserBean.userNameFilter}"
- id="UserName" />
- <p:message for="UserName" />
- </h:panelGroup>
- <f:facet name="footer">
- <p:commandButton value="Search" process="@parent" update="tblUser"
- action="#{testUserBean.actionSearch}" />
- </f:facet>
- </h:panelGrid>
- </p:fieldset>
- <p>
- Click on the modify record link to modify the record, and refresh it
- <br/>
- After clicking on the modify, 2 things should happen, the modify button will not be renderered,
- <br/>
- and the status of that record is changed from <span style="font-weight: bold">not modified</span> to <span style="font-weight: bold">modified</span>
- </p>
- <p:dataTable id="tblUser" var="user"
- value="#{testUserBean.userList}">
- <f:facet name="header">
- List
- </f:facet>
- <p:columnGroup type="header">
- <p:row>
- <p:column headerText="Modify" />
- <p:column headerText="User Id" />
- <p:column headerText="User Name" />
- <p:column headerText="Modified Status" />
- </p:row>
- </p:columnGroup>
- <p:column>
- <p:commandLink
- value="modify record"
- process="@this"
- action="#{testUserBean.modifyRecord(user)}"
- update="@this"
- rendered="#{not testUserBean.isRecordModified(user)}" />
- </p:column>
- <p:column>
- <h:outputText value="#{user.userId}" />
- </p:column>
- <p:column>
- <h:outputText value="#{user.userName}" />
- </p:column>
- <p:column>
- <h:outputText value="#{user.modifiedStatus ? 'modified' : 'not modified'}" />
- </p:column>
- <f:facet name="footer">
- #{fn:length(testUserBean.userList)} users<br />
- </f:facet>
- </p:dataTable>
- </h:form>
- </p:layoutUnit>
- </p:layout>
- </h:body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment