2012-10-19 107 views
0

我試圖更新放置在tabView中的Gmap。但我越來越訪問primefaces中的不可見標籤

java.lang.IllegalArgumentException: tab2 

錯誤。我已經搜索了一下這個問題,並注意到它只有在選項卡可見時纔可用。那麼我能做什麼?代碼塊低於:

<h:form id="form"> 
     <p:tabView orientation="left" id="tabView" styleClass="tabView"> 

      <p:ajax event="tabChange" listener="#{sucBean.onTabChange}" 
       update=":form:tabView:map" /> 

      <p:tab title="Bütün Suçlar" id="tab1"> 

       <p:gmap zoom="10" type="HYBRID" center="40.78470,29.94873" id="map" 
        model="#{sucBean.advancedModel}" 
        style="width:740px;height:500px;margin:-14px 0 0 -10px;"> 

        <p:ajax event="overlaySelect" listener="#{sucBean.onMarkerSelect}" /> 

        <p:gmapInfoWindow> 
         <p:outputPanel 
          style="text-align:justify;display:block;margin:auto:"> 
          <p:panelGrid columns="2" cellpadding="8"> 

           <h:outputText value="Suç Tipi:" style="color:red" /> 
           <h:outputText value="#{sucBean.marker.data.sucTipi}" /> 

           <h:outputText value="Tarih: " style="color:red" /> 
           <h:outputText value="#{sucBean.marker.data.islenmeZamani}" /> 

           <h:outputText value="Adres: " style="color:red" /> 
           <h:outputText value="#{sucBean.marker.data.adres}" /> 

           <h:outputText value="Suçu İşleyen:" style="color:red" /> 
           <h:outputText value="#{sucBean.marker.data.isleyenBilgisi}" /> 
          </p:panelGrid> 
         </p:outputPanel> 

        </p:gmapInfoWindow> 



       </p:gmap> 

      </p:tab> 

      <p:tab title="Suç Ara" id="tab2"> 
       <p:fieldset legend="Ayrıntılı Arama" styleClass="searchField" 
        id="fieldSet"> 

        <p:panelGrid columns="4" cellpadding="10"> 
         <p:inputText value="#{sucBean.arananKelime}" style="width:300px" /> 
         <h:outputText value=" Kriter:" /> 
         <p:selectOneMenu value="#{sucBean.aramaKriteri}"> 
          <f:selectItem itemLabel="Suç Tipi" itemValue="sucTipi" /> 
          <f:selectItem itemLabel="Adres" itemValue="adres" /> 
          <f:selectItem itemLabel="İşlenme Zamanı" itemValue="zaman" /> 
          <f:selectItem itemLabel="Cinsiyet" itemValue="cinsiyet" /> 
          <f:selectItem itemLabel="Yaş" itemValue="yas" /> 
         </p:selectOneMenu> 

         <p:commandButton value="Ara" 
          actionListener="#{sucBean.sucKaydiAra}" update="aramaSonucu" /> 
        </p:panelGrid> 

       </p:fieldset> 

       <p:dataTable var="suc" value="#{sucBean.sucModel}" paginator="true" 
        rows="10" id="aramaSonucu" selection="#{sucBean.selectedSuc}"> 

        <p:column selectionMode="multiple" style="width:18px"></p:column> 

        <p:column headerText="Suç Tipi"> 
         <h:outputText value="#{suc.sucTipi}" /> 
        </p:column> 

        <p:column headerText="İşlenme Zamanı"> 
         <h:outputText value="#{suc.islenmeZamani}" /> 
        </p:column> 

        <p:column headerText="Adres"> 
         <h:outputText value="#{suc.adres}" /> 
        </p:column> 

        <p:column headerText="Suçu İşleyen"> 
         <h:outputText value="#{suc.isleyenBilgisi}" /> 
        </p:column> 

<!--      <f:facet name="footer"> --> 

<!--      </f:facet> --> 

       </p:dataTable> 

       <p:commandButton id="multiSelectButton" actionListener="#{sucBean.secilenleriGetir}" update=":form:tabView:tab2:map2" 
          value="Secilenleri Haritada Göster" icon="ui-icon-pin-s" /> 

       <p:gmap zoom="12" type="HYBRID" center="40.78470,29.94873" 
        id="map2" model="#{sucBean.advancedModel2}" 
        style="width:740px;height:300px;margin:10px 0 0 -10px;"> 

回答

0

當你引用類似TabView的或可摺疊容器組件內部的組件,您不需要在您的更新對象的實際標籤ID。

在你的情況下update=":form:tabView:map2"將是正確的更新目標。

+0

非常感謝「akoskm」!自昨天以來,我一直在解決這個問題。再次感謝:) – yns89