我正试图在更改复选框时进行民意调查。但是在bean中只成功调用了一个轮询。
<h:form id="route_form">
<p:poll interval="10" listener="#{userAction.getVehicleLocFromMap}" onstart="startloading();single();" oncomplete="closeloading();" update="@form" rendered="#{userAction.showAllCabs eq false}"></p:poll>
<p:poll interval="10" listener="#{userAction.getAllVehiclesForTracking}" onstart="startloading();all();" oncomplete="closeloading();complete();" update="@form" rendered="#{userAction.showAllCabs eq true}"></p:poll>
<h:inputHidden id="passengers" value ="#{userAction.passengerlistJSON}" rendered="#{userAction.showAllCabs eq false}"/>
<h:inputHidden id="current_loc_lat" value="#{userAction.triptoTrack.veh_latitude}" rendered="#{userAction.showAllCabs eq false}"/>
<h:inputHidden id="current_loc_lon" value="#{userAction.triptoTrack.veh_longitude}" rendered="#{userAction.showAllCabs eq false}"/>
<h:inputHidden id="vehicle_number" value="#{userAction.triptoTrack.vehicle_RegNo}" rendered="#{userAction.showAllCabs eq false}"/>
<h:inputHidden id="cabsJSON" value="#{userAction.allVehicles}" rendered="#{userAction.showAllCabs eq true}"/>
<div class="row">
<div class="span4" align="left" style="vertical-align: middle">
<p:selectBooleanCheckbox id="showAllCabs" value="#{userAction.showAllCabs}">
<p:ajax listener="#{userAction.backButtonTest}" onstart="startloading();" oncomplete="closeloading();" update="@form" onsuccess="location.reload(true);"></p:ajax>
</p:selectBooleanCheckbox>
<h:outputText value="Show all cabs" styleClass="dropdown_label" style="padding-left: 10px; padding-bottom: 5px"/>
</div>
</div>
</h:form>
我尝试以不同的形式进行投票。但是没有用。