0

I have p:dataTable, inside column I have a panelGrid where i want the value of the ouputText on the click of the panelGrid without page refresh. The code is something like:

<p:column headerText="5/5" style="width:40px; font-size:9pt;">  
    <p:panelGrid>
        <p:ajax event="click" listener="#{myBean.showSelectedValue(row)}" update=":mainForm"/>
        <h:outputText value="#{row.value1}" />  
    </p:panelGrid>
</p:column> 
</p:dataTable>
<h:panelGrid id="ForecastChartTab"> 
    <h:outputText id="value1" value="#{myBean.showValue.value1}" />  
</h:panelGrid>

This is working, but the value is seen only on page refresh...! is something wrong here? :(

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
Preeti Singh
  • 37
  • 3
  • 12

1 Answers1

1

If you need to update the table, you can use the following

update="@([id$=dtTableId])"

If you need to update the output text you need use the following

update="@([id$= value1])"

With this type of format @([id$= value1]), you can update another component out of the behavior of others.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38