1

Iam using Mojarra 2.2.11 (WildFly 9.0.1) with PF 5.3.

In relation with my original question: <p:ajax update="...> cell or row update inside PF subTable

I am still struggling with the following line: <p:ajax update=":tabView1:form1:mainTable".../>

The following part has been changed: #{subTableView.getAllheaders(tabview)}. Below references have been used but the datatable refresh does not seem to work.

I have done several researches and tried multiple options without success. The operation looks easy: I need to process a selectOneRadio value to update the outputLabel in the next column of the datatable. I am not getting any error: but the radio selection comes back to the initial position when another radio is clicked without updating the outputlabel.

  1. I paid attention that outputLabel is surrounded by a panelGroup (see reference). NamingContainer with proper syntax has been tried:

  2. I tried with RequestContext#update("tabView1:form1:mainTable:panel") with the below references:

  3. <f:ajax execute="" render=""/> has been tried

    • Reference: Mastering JSF 2.2 Book
  4. I was thinking about the last jQuery option but I still think it is doable with JSF.

Thank you for your time.

<p:tabView id ="tabView1" value="#{bean.titles}" var="tabItem" >

   <p:tab id="tab1" title="#{tabItem}" >

     <h:form id="form1" >

   <p:dataTable  id="mainTable" value="#{subTableView.getAllHeaders(tabItem)}" var="head" > 

     <p:subTable id="subTable1" value="#{head.questions}" var="question" >  

        <f:facet name="header">
            #{head.name}
        </f:facet>

        <p:column id="questionColumn">
            #{question.question}            
        </p:column>

        <p:column id="radioColumn">

            <p:selectOneRadio id="mainSelect" value="#{question.select1}" >

                <f:selectItem itemLabel="Yes" itemValue="#{question.responseOfYes}" />
                <f:selectItem itemLabel="No" itemValue="#{question.responseOfNo}" />

                    // here is my pain:
                <p:ajax update=":tabView1:form1:mainTable"  process="@this"

                 listener="#{subTableView.updateSecond(question.select1)}"/>

            </p:selectOneRadio>

        </p:column> 


        <p:column id="responseColumn">

            <h:panelGroup id="panel" >
                <h:outputLabel id="display1" value="#{question.select1}" />                 
            </h:panelGroup>

        </p:column>

    </p:subTable>

  </p:dataTable>    

  </h:form>

    </p:tab>

 </p:tabView>
Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40
LEK
  • 83
  • 2
  • 11
  • Is the client ID of the table really `tabView1:form1:mainTable`? (you checked the generated HTML output on that as instructed?) You've there a dynamic tabview, not a static tabview, so its iteration index would also be prepended. – BalusC Nov 10 '15 at 20:26
  • @BalusC: Iam not getting any referencing error: I suppose the ID is correct (not checked the HTML). prependId set to true or false for the TabView: not working. – LEK Nov 10 '15 at 20:43
  • http://stackoverflow.com/questions/8634156 clearly says to look in HTML output for real client ID. – BalusC Nov 10 '15 at 20:49
  • it contains iteration index like :0:, :1: e.g.: `tabView1:1:form1:mainTable:0:subTable1:0:panel`. Not mentioned but also tried: `styleClass="myClass"` with `update="@(.myClass)"` – LEK Nov 10 '15 at 20:56
  • @BalusC: to make my table "traceable" would you suggest to use `` OR to follow the following [link](http://stackoverflow.com/questions/5713718/how-to-make-a-grid-of-jsf-composite-component)? Thank you – LEK Nov 11 '15 at 14:11

0 Answers0