Xavier
Xavier

Reputation: 97

Cannot find component with identifier in view

I have a problem are that when I try update a component that not are in same xhtml.

Somebody know how to do?

thx PD: im using primefaces 3.2

Sorry for my english

I think that I dnot explain very well.

I have a xhtml father with tis structure:

<h:panelGrid id="tabla">

    <h:form id="formTripu" prependId="false">
        <h:panelGrid id="fichaTripulante">
            <ui:include src="path1" />
            <p:spacer height="5px" />
            <p:tabView dynamic="false" cache="true">
                <p:tab title="#{bundleTrip.datosAdministrativos}">
                    <ui:include
                        src="path2" />
                </p:tab>
                <p:tab title="Datos Operativos ">
                    <ui:include
                        src="path3" />
                </p:tab>

I wish to do are when for example in path1 I use a h:selectBooleanCheckbox like:

                    <h:selectBooleanCheckbox inmediate="true" id="checkExt"
                        value="#{bean.Obj.field}">
                        <f:ajax render="estadoTripu"
                            actionListener="#{bean.method}" />
                    </h:selectBooleanCheckbox>

estadoTripu are in path2 (otherxthml but in same form).

<p:panel>
    <h:panelGrid id="datos" columns="5">
        <p:column>

                <h:selectOneMenu id="estadoTripu" 
                    value="#{bean.Obj.Field2}">
                    <f:selectItems
                        value="#{bean.list}" var="item"
                        itemValue="#{item.id}" immediate="true"
                        itemLabel="#{item.desc}">
                    </f:selectItems>
                </h:selectOneMenu>
            </h:panelGrid>
        </p:column>
    </h:panelGrid>
</p:panel>  

Witch is paht in render o f:ajax????

thx everyone

Upvotes: 0

Views: 2704

Answers (3)

Xavier
Xavier

Reputation: 97

I find that component should be in same form an call ids start in form to component, its prefered put id every panelgrid, panel, etc because you have to call every component englobe comoponent that you want render.

Upvotes: 0

Daniel
Daniel

Reputation: 37061

try this: (Its a trick I learned from BalusC :) )

add binding="#{components.mySelecOneMenu}" to your h:selectOneMenu

<h:selectOneMenu binding="#{components.mySelecOneMenu}" .....

This how you button should look like (more or less)

<h:commandButton value="doSomeThing">
    <f:ajax render="#{components.mySelecOneMenu.clientId}"/>
</<h:commandButton>

add this to your faces-config.xml

<managed-bean>
    <description>Holder of all component bindings.</description>
    <managed-bean-name>components</managed-bean-name>
    <managed-bean-class>java.util.HashMap</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

Here some detailed explanation of what I just recommend you to do

How do I break the tyranny of the clientID?

JSF component binding without bean property

Upvotes: 1

roel
roel

Reputation: 2003

if they are not in the same xhtml, do you include one in the other? If not, just change page and it will show the correct one.

But I don't think I correctly understand your question.

Add some code please

Upvotes: 0

Related Questions