jsf - displaying the value of the p:dataTable cell on click event of the p:panelGrid using p:ajax -


i have p:datatable, inside column have panelgrid want value of ouputtext on click of panelgrid without page refresh. code 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 working, value seen on page refresh...! wrong here? :(

if need update table, can use following

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

if need update output text need use following

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

with type of format @([id$= value1]), can update component out of behavior of others.