【发布时间】:2016-07-11 17:03:33
【问题描述】:
我正在使用引导模式来显示选定的数据列表。当托管 bean 中的列表不为空时,如何显示模式。
我的模态是
<div id="modalPanel-1" data-backdrop="static" class="modal hide fade in">
<div class="modal-header"><a data-dismiss="modal" class="close" id="closeModal" onclick="reconstruct()">×</a>
<h3>Selected Trips</h3></div>
<div class="modal-body" style="width: 100%;">
<p:panel style="border: medium none;" id="modalPanel-1-panel">
<h:form id="modalForm">
<h:selectOneMenu style="width:25%;"
value="#{userAction.assignVehicleSelectedVehicleID}">
<f:selectItem itemLabel="Select Vehicle"></f:selectItem>
<f:selectItems value="#{userAction.allVehicleList}"></f:selectItems>
<p:ajax listener="#{userAction.assignVehicleChangeHandler}"
process="@this" update="@form"/>
</h:selectOneMenu>
<h:selectOneMenu id="driver" style="width:25%; margin-left: 10px;"
value="#{userAction.assignVehicleSelectedDriverID}">
<f:selectItem itemLabel="Select Driver"></f:selectItem>
<f:selectItems value="#{userAction.drivername}"/>
</h:selectOneMenu>
<h:commandButton
styleClass="btn btn-success" value="New Ride"
style="margin-left: 20px; margin-top: -10px;">
<p:ajax listener="#{userAction.linkVehicleForAssignVehicle}"
process="@form" update="@form, :treeTableForm" oncomplete="clearModalErr();"></p:ajax>
</h:commandButton>
<div>
<ul></ul>
</div>
<p:dataTable value="#{userAction.selectedMatchedTripDTOs}" var="trip"
rendered="true" expandedRow="true">
<p:column headerText="Group ID">
<h:outputText value="#{trip.groupId}"></h:outputText>
</p:column>
<p:column headerText="Route">
<h:outputText value="#{trip.route}"></h:outputText>
</p:column>
<p:column headerText="Requester">
<h:outputText value="#{trip.userName}"></h:outputText>
</p:column>
<p:column headerText="Count">
<h:outputText value="#{trip.count}"></h:outputText>
</p:column>
<p:column headerText="Ride ID">
<h:outputText value="#{trip.rideId}"></h:outputText>
</p:column>
<p:column>
<f:facet name="header">Action</f:facet>
<h:commandLink rendered="true" disabled="false">
<i class="fa fa-trash" title="Delete"></i>
<p:ajax listener="#{userAction.removeTripFromSelectedList(trip)}"
update=":modalForm"/>
</h:commandLink>
</p:column>
<p:rowExpansion>
<ul><h:outputText value="#{trip.startDate}"
style="color: darkblue; font-size: 16px; padding-left: 400px;"/>
</ul>
<pm:content rendered="#{not empty trip.custom}">
<ul style="width: 100%;"><h:outputText value="Notes"
style="font-size: 14px"
rendered="#{not empty trip.custom}"/> <h:outputText
rendered="#{not empty trip.custom}"
value="#{trip.custom}"
style="color: #999999; font-size: 14px; "/></ul>
</pm:content>
</p:rowExpansion>
</p:dataTable>
</h:form>
</p:panel>
</div>
</div>
我可以将模态框包含在这样的东西中吗?
<pm:content rendered="#{not empty trip.customList}"> </pm:content>
或者当某些东西被添加到托管 bean 的列表中时,我可以触发模式吗?
请帮帮我。
【问题讨论】:
-
你使用 if 子句,还是 jsp 没有那个?
-
我可以触发模态显示在 IF 子句中吗?
-
是的,你可以跳起来
-
我试过了,还是不行,请帮帮我。
-
这个问题如何直接与 PrimeFaces 相关(我“使用”PrimeFaces 不是正确答案 ;-))
标签: jquery ajax bootstrap-modal