0

I'm using PrimeFaces 5.3.5 and MyFaces 2.2.8

here is my code:

 <p:panelGrid columns="1">
  <p:panelGrid id="Input1">
    <p:inputText size="40" id="searchValue" value="#{searchWindowBean.suggest}">
      <p:ajax event="keyup" listener="#{searchWindowBean.changeOptions}" update="customeroptions" delay="300"
        partialSubmit="true" process="@this" /> <!-- this update works-->
    </p:inputText>
  </p:panelGrid>


  <p:panelGrid id="InputX">
    <p:dataTable value="#{searchWindowBean.searchColumn.searchFields}" var="field">
      <p:column>
        <h:outputText value="#{field.displayName}" />
      </p:column>
      <p:column>
        <p:inputText size="40" id="inputValue" value="#{field.value}">
          <p:ajax event="keyup" listener="#{searchWindowBean.changeOptions}" update=":customeroptions" delay="300"
            partialSubmit="true" process="@this" /> <!--this one doesn't-->
        </p:inputText>
      </p:column>

    </p:dataTable>
  </p:panelGrid>

  <p:panelGrid>
    <p:selectOneListbox value="#{searchWindowBean.selectItem}" id="customeroptions" styleClass="customeroptions"
      scrollHeight="100">
      <f:selectItems value="#{searchWindowBean.list}" />
      <p:ajax disabled="#{!searchWindowBean.dependingFields}" partialSubmit="true"
        update="contact_person" />
    </p:selectOneListbox>
  </p:panelGrid>

 </p:panelGrid>

I almost tried everything to make the second update for "customerpotions" work. But it doesn't even find the update id. The first ajax update works properly, so does the rest of my code. If I use the parentform:j_id_m:15:customeroptions it works. How could this be? It would be great to have a solution with explanation.

Lule
  • 68
  • 9
  • check this: http://stackoverflow.com/questions/8634156/how-to-find-out-client-id-of-component-for-ajax-update-render-cannot-find-compo – Kukeltje Feb 26 '16 at 13:15
  • Yes I can see that I've done it exactly as it is told there. I've already tried it without ":" and with "parentform:customeroptions" nothing worked. See my code above. – Lule Feb 26 '16 at 13:27
  • Are you **sure** _"parentform:j_idxx_customeroptions"_ works? I think there is a typo in there... (and I don't mean the xx). Also compare the id of the inputText with that of the customeroptions (both on the client side) – Kukeltje Feb 26 '16 at 13:33
  • forgot the : searchform:j_id_m:15:customeroptions. The first customeroptions update works. So the id is the right one – Lule Feb 26 '16 at 13:37
  • And where do the j_id_m and the 15 come from? Not visible in your code... So afaics, all info in the 'duplicate' is still applicable and not taken into account yet. And there still is a : missing in front of the 'parentform:j_id:15:customeroptions' in your text – Kukeltje Feb 26 '16 at 13:45
  • no there is no : missing. it works like this. not trackable where this comes from. But it doesn't really matter according to the rules. because there us no other naming container around it. It shouldn't be necessary – Lule Feb 26 '16 at 13:53
  • So you are saying the id of the 'inputValue' is `parentform:j_id_m:15:inputValue`? I doubt it... since the `p:datatable` is a namingcontainer AND has repeating elements, it most likely is something like `parentform:j_id_m:15:j_id_xx:y:inputValue` where y is again an 'index' of the row in the datatable. – Kukeltje Feb 26 '16 at 14:15
  • it works exactly like this. Yes. it's not an inputValue but a selectOneListBox as you can see above. – Lule Feb 26 '16 at 14:36
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/104645/discussion-between-kukeltje-and-lule). – Kukeltje Feb 26 '16 at 14:39

0 Answers0