如何激活某些素数:同时就地

时间:2013-02-27 17:21:46

标签: jsf primefaces

我希望在激活第一个时激活第二个暗示。

<p:inplace id="selectableInplaceProvincia" label="#{clientesMB.empClienteEditar.nombreProvinciaEmpresa}" effectSpeed="fast" >  
    <p:selectOneMenu id="idprov1" value="#{clientesMB.prov}"  effect="fade" converter="ccConverter" style="width: 300px;">  
        <f:selectItems value="#{clientesMB.itemsProv}" var="player" itemLabel="#{player.nombre}" itemValue="#{player}"/>  
        <f:ajax execute="@this"  listener="#{clientesMB.llenarParaconvertermuni}" render="idmuni1" />
    </p:selectOneMenu> 
</p:inplace> 

<h:outputText value="Municipio: " style="font-size: 12px"/>  
<p:inplace id="selectableInplaceMunicipio" label="#{clientesMB.empClienteEditar.nombreMunicipioEmpresa}" effectSpeed="fast" >  
    <p:selectOneMenu id="idmuni1" value="#{clientesMB.munic}" effect="fade" converter="muniConverter" style="width: 300px; height: auto">  
        <f:selectItems value="#{clientesMB.itemsMuni}" var="player2" itemLabel="#{player2.nombreMunicipio}" itemValue="#{player2}"/>  
    </p:selectOneMenu>  
</p:inplace>

1 个答案:

答案 0 :(得分:2)

在第二个widgetVar上定义<p:inplace/>并在其上调用show()函数。 <p:inplace/>没有将javasscript事件定义为属性,因此您必须将其包装在容器组件中或在封闭组件上触发它:

<h:panelGrid style="width=20px" onclick="secondPlace.show()">  
 <p:inplace id="selectableInplaceProvincia" label="#{clientesMB.empClienteEditar.nombreProvinciaEmpresa}" effectSpeed="fast" >

      <p:selectOneMenu onchange="secondInplace.show()" id="idprov1" value="#{clientesMB.prov}"  effect="fade" converter="ccConverter" style="width: 300px;" >  
           <f:selectItems value="#{clientesMB.itemsProv}" var="player" itemLabel="#{player.nombre}" itemValue="#{player}"/>  
           <f:ajax execute="@this"  listener="#{clientesMB.llenarParaconvertermuni}" render="idmuni1" />
      </p:selectOneMenu> 
 </p:inplace> 
</h:panelGrid>  
 <h:outputText value="Municipio: " style="font-size: 12px"/>  
 <p:inplace id="selectableInplaceMunicipio" widgetVar="secondInplace" label="#{clientesMB.empClienteEditar.nombreMunicipioEmpresa}" effectSpeed="fast" >  
    <p:selectOneMenu id="idmuni1" value="#{clientesMB.munic}" effect="fade" converter="muniConverter" style="width: 300px; height: auto">  
        <f:selectItems value="#{clientesMB.itemsMuni}" var="player2" itemLabel="#{player2.nombreMunicipio}" itemValue="#{player2}"/>  
  </p:selectOneMenu>  
 </p:inplace>