Guest User

Untitled

a guest
May 9th, 2011
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.43 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml"
  5.     xmlns:f="http://java.sun.com/jsf/core"
  6.     xmlns:h="http://java.sun.com/jsf/html"
  7.     xmlns:ui="http://java.sun.com/jsf/facelets"
  8.     xmlns:p="http://primefaces.prime.com.tr/ui"
  9.     xmlns:fn="http://java.sun.com/jsp/jstl/functions">
  10.  
  11. <h:head>
  12.     <title>Primefaces Testing Lab</title>
  13. </h:head>
  14.  
  15. <h:body>
  16.     <p:layout fullPage="true">
  17.         <p:layoutUnit position="top" height="50" collapsible="false">
  18.             <h1 class="title ui-widget-header ui-corner-all"
  19.                 style="padding: 5px; font-size: 150%; font-weight: bold; text-align: center; margin: 5px;">
  20.                 Primefaces Testing Lab
  21.             </h1>
  22.         </p:layoutUnit>
  23.  
  24.         <p:layoutUnit position="center" scrollable="true">
  25.                         <p:ajaxStatus style="width:16px;height:16px;">
  26.                 <f:facet name="start">
  27.                     Loading .......
  28.                 </f:facet>
  29.                 <f:facet name="complete">
  30.                     <h:outputText value="" />
  31.                 </f:facet>
  32.             </p:ajaxStatus>
  33.            
  34.             <h:form prependId="false">
  35.                 <p:focus />
  36.                 <p:growl id="messages" globalOnly="true" />
  37.                 <p:fieldset legend="User Search Filter" toggleable="true" toggleSpeed="500"  >
  38.                     <h:panelGrid columns="2">
  39.                         <h:outputLabel for="UserId" value="User Id" />
  40.                         <h:panelGroup>
  41.                             <h:inputText label="User Id" value="#{testUserBean.userIdFilter}"
  42.                                 id="UserId" />
  43.                             <p:message for="UserId" />
  44.                         </h:panelGroup>
  45.  
  46.                         <h:outputLabel for="UserName" value="User Name" />
  47.                         <h:panelGroup>
  48.                             <h:inputText label="User Name" value="#{testUserBean.userNameFilter}"
  49.                                 id="UserName" />
  50.                             <p:message for="UserName" />
  51.                         </h:panelGroup>
  52.  
  53.                         <f:facet name="footer">
  54.                             <p:commandButton value="Search" process="@parent" update="tblUser"
  55.                                 action="#{testUserBean.actionSearch}" />
  56.                         </f:facet>
  57.                     </h:panelGrid>
  58.                 </p:fieldset>
  59.  
  60.                 <p>
  61.                     Click on the modify record link to modify the record, and refresh it
  62.                     <br/>
  63.                     After clicking on the modify, 2 things should happen, the modify button will not be renderered,
  64.                     <br/>
  65.                     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>
  66.                 </p>
  67.                 <p:dataTable id="tblUser" var="user"
  68.                     value="#{testUserBean.userList}">
  69.                     <f:facet name="header">
  70.                         List
  71.                     </f:facet>
  72.  
  73.                     <p:columnGroup type="header">
  74.                         <p:row>
  75.                             <p:column headerText="Modify" />
  76.                             <p:column headerText="User Id" />
  77.                             <p:column headerText="User Name" />
  78.                             <p:column headerText="Modified Status" />
  79.                         </p:row>
  80.                     </p:columnGroup>
  81.  
  82.                     <p:column>
  83.                         <p:commandLink
  84.                             value="modify record"
  85.                             process="@this"
  86.                             action="#{testUserBean.modifyRecord(user)}"
  87.                             update="@this"
  88.                             rendered="#{not testUserBean.isRecordModified(user)}" />
  89.                     </p:column>
  90.                     <p:column>
  91.                         <h:outputText value="#{user.userId}" />
  92.                     </p:column>
  93.                     <p:column>
  94.                         <h:outputText value="#{user.userName}" />
  95.                     </p:column>
  96.                     <p:column>
  97.                         <h:outputText value="#{user.modifiedStatus ? 'modified' : 'not modified'}" />
  98.                     </p:column>
  99.                     <f:facet name="footer">
  100.                         #{fn:length(testUserBean.userList)} users<br />
  101.                     </f:facet>
  102.                 </p:dataTable>
  103.             </h:form>
  104.         </p:layoutUnit>
  105.     </p:layout>
  106. </h:body>
  107. </html>
Advertisement
Add Comment
Please, Sign In to add comment