Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <p:tab title="食品分类" id="foodtab">
- <h:form id="foodcategoryform">
- <f:facet name="header">
- </f:facet>
- <p:dataTable id="categorytable" var="foodcategories"
- value="#{foodManagerController.foodCategories}"
- editable="true"
- paginator="true"
- paginatorPosition="bottom"
- paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
- rowsPerPageTemplate="5,10,15" rows="5"
- paginatorAlwaysVisible="false"
- emptyMessage="当前系统没有分类数据"
- editMode="row"
- resizableColumns="true"
- >
- <p:ajax event="rowEdit" update="@this" listener="#{foodManagerController.updateFoodCategory}" />
- <p:column headerText="名称" style="width:25%">
- <p:growl id="categorymsg"></p:growl>
- <p:cellEditor>
- <f:facet name="output"><h:outputText value="#{foodcategories.typeName}" /></f:facet>
- <f:facet name="input">
- <p:inputText value="#{foodcategories.typeName}" >
- <f:validator validatorId="foodCateIsExistValidator" />
- <f:attribute name="objectid" value="#{foodcategories.id}"></f:attribute>
- <p:ajax update="categorymsg" event="keyup" />
- </p:inputText>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="描述" style="width:25%">
- <p:cellEditor>
- <f:facet name="output"><h:outputText value="#{foodcategories.typeDesc}" /></f:facet>
- <f:facet name="input"><p:inputText value="#{foodcategories.typeDesc}" ><f:validateRequired/></p:inputText></f:facet>
- </p:cellEditor>
- </p:column>
- <p:column style="width:6%" headerText="修改">
- <p:rowEditor />
- </p:column>
- <p:column style="width:6%" headerText="删除">
- <f:facet name="header">
- <h:outputText value="删除" />
- </f:facet>
- <p:commandButton id="deletebutton" update="categorytable" icon="ui-icon-close" title="删除" actionListener="#{foodManagerController.deletedFoodCatery(foodcategories)}" ajax="true">
- </p:commandButton>
- </p:column>
- </p:dataTable>
- <p:panel header="新加种类" toggleable="true" toggleSpeed="500" id="addcategorypanel" >
- <p:growl id="addcategorymsg" showDetail="true" life="3000" autoUpdate="true"/>
- <p:outputLabel for="typename" value="种类名称" >
- </p:outputLabel>
- <p:inputText id="typename" value="#{foodManagerController.foodCateName}" >
- <f:validateRequired/>
- <f:validator validatorId="foodCateIsExistValidator" />
- <p:ajax update="addcategorymsg" event="keyup"/>
- </p:inputText>
- <p:outputLabel for="typedesc" value="种类描述"></p:outputLabel>
- <p:inputText id="typedesc" required="true" requiredMessage="请添加描述" value="#{foodManagerController.foodCateDesc}">
- <f:validateRequired/>
- <p:ajax update="addcategorymsg" event="keyup" />
- </p:inputText>
- <p:commandButton id="addacate" update="addcategorymsg,categorytable" value="添加" actionListener="#{foodManagerController.addFoodCatery}" ajax="true"/>
- </p:panel>
- </h:form>
- </p:tab>
- p:component('compentid')
- <p:commandButton ... update=":#{p:component('compentid')}" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement