0
votes

Hi i have this sceneario, i have 2 forms each of them with preprendId=false, the first one have a h:panelGroup that i want to update from the second h:form. The problem that i have is that i dont know what String i have to put for update my panelGroup. I tried with this strings:

panelGroupComboId and :panelGroupComboId

But i always get: Cannot find component with expression ":panelGroupComboId" referenced from...

Because i need to use preprendId=false at least in the first form (where my panelGroup is) i cannot set preprendIf=true, but if i did it i could update my component with any problem using: :loginFormRegistroId:panelGroupComboId

But remember i NEED to use preprendId= false, when i use preprendId=false i can see using firebug that my h:panelGroup is converted as a div with the id panelGroupComboId, then thats why i dont how do i have to call for update it.

Is preprendId=true the only way to this works?

FIRST FORM

 <h:form id="loginFormRegistroId" prependId="false">
    <h:panelGroup id="panelGroupComboId" layout="block">
        <select id="comboCarreraId" name="comboCarreraId" class="form-control">
            <ui:repeat value="#{miBean.list}" var="obj">
                <option value="#{obj.id}">#{obj.name}</option>
            </ui:repeat>
        </select>
    </h:panelGroup>
</h:form>

SECOND FORM

 <h:form prependId="false">
    <p:remoteCommand
        name="cargarCarrerasRemoteCommand"
        process="@this"
        actionListener="#{miBean.myListener}"
        update="panelGroupComboId">
    </p:remoteCommand>
</h:form>

By the way i DONT want to update the entire first FORM, just my h:panelGroup

1
prependId is one of the worst additions to JSF 1.2 They should never have added it. Get rid of it. It really solves nothing unsolvable and creates only new problems.BalusC

1 Answers

1
votes

Remove prependId from the forms. Update the code as

<h:form>
    <p:remoteCommand
        name="cargarCarrerasRemoteCommand"
        process="@this"
        actionListener="#{miBean.myListener}"
        update=":loginFormRegistroId:panelGroupComboId">
    </p:remoteCommand>
</h:form>