jsf中的按钮加弹框的两种形式
第一种:
1 <p:commandButton value="一键移除" 2 action="#{ProjectPackageManageBackingBean.removeItems}" 3 styleClass="right_btnserach pull-right"> 4 <p:confirm header="一键移除安装工程" message="你确定要移除吗?" 5 icon="pi pi-exclamation-triangle" /> 6 </p:commandButton>
以按钮加confrim框的形式,action触发后台事件,处理业务
第二种:
1 <p:commandLink value="一键分配" 2 rendered="#{ProjectPackageManageBackingBean.showLead}" 3 action="#{ProjectPackageManageBackingBean.azgc}" 4 oncomplete="PF('dlg4').show();" update=":form:dlg4" 5 styleClass="right_btnserach pull-right" style="margin-bottom:5px;margin-left:20px"> 6 </p:commandLink>
1 <p:dialog header="一键分配安装工程量" widgetVar="dlg4" modal="true" dynamic="true" id="dlg4" 2 resizable="false" width="550px" height="auto"> 3 <t:div styleClass="right_popup_content" id="azgcfeipeicontend" width="385px"> 4 <t:div styleClass="right_popup_projectinfo"> 5 <t:panelGrid styleClass="right_main_info" columns="2" 6 columnClasses="right_main_th,right_main_t2"> 7 <t:panelGroup> 8 <h:outputText value="选择部门 :" /> 9 </t:panelGroup> 10 <p:selectOneMenu styleClass="right_menu right_menu_sp5" 11 id="groupInfoUserListdemo" 12 value="#{ProjectPackageManageBackingBean.assignGroupName}"> 13 <f:selectItem itemLabel="" itemValue=""></f:selectItem> 14 <f:selectItems value="#{ProjectPackageManageBackingBean.groupListSelectItems}"></f:selectItems> 15 <p:ajax event="change" update="azgcfeipeicontend"></p:ajax> 16 </p:selectOneMenu> 17 <t:panelGroup> 18 <h:outputText value="选择人员 :" /> 19 </t:panelGroup> 20 <t:div styleClass="right_fenpei_content"> 21 <t:div styleClass="right_main_fenpei_item" id="submitcheckb4"> 22 <p:selectOneRadio id="items" value="#{ProjectPackageManageBackingBean.assignChecked}" layout="grid" columns="3" 23 forceId="true" forceIdIndex="false" > 24 <f:selectItems 25 value="#{ProjectPackageManageBackingBean.assignUserCheckBoxList}" 26 var="items" itemLabel="#{items.name}" itemValue="#{items.id}" /> 27 </p:selectOneRadio> 28 </t:div> 29 </t:div> 30 </t:panelGrid> 31 </t:div> 32 </t:div> 33 <f:facet name="footer"> 34 <p:commandLink value="确定" styleClass="btn btn-primary margin-right" 35 action="#{ProjectPackageManageBackingBean.takeMission}" 36 update=":form:message,:form:tab:azTree,:form:dlg4" 37 onclick="PF('dlg4').hide();"> 38 </p:commandLink> 39 <p:commandLink value="取消" styleClass="btn btn-default" 40 onclick="PF('dlg4').hide();"> 41 </p:commandLink> 42 </f:facet> 43 </p:dialog>
以按钮加dialog弹框的形式,同样按钮的action触发后台事件。
有关博客的疑问和勘误请发送问题至邮箱2289246359@qq.com