0

我试图更新放置在 tabView 中的 Gmap。但我得到了

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;">
4

1 回答 1

0

当您在容器组件(如 tabView 或手风琴)中引用组件时,您不需要在更新目标中包含实际的选项卡 ID。

在您的情况下update=":form:tabView:map2",将是正确的更新目标。

于 2012-10-19T06:58:03.930 回答