I have trouble getting f:ajax
to work on a h:panelGroup
.
Here\'s what i\'m doing:
JSF code:
I think the panelGroup will be swallowed since there is only one component inside. Maybe jsf optimizes it.
Then there is only the h:outputText
left and this component doesn't implement the javax.faces.component.behavior.ClientBehaviorHolder interface which is required for a component that gets ajax attached.
You could use h:outputLink
or maybe h:outputLabel
instead.
did small POC for ajax may be useful for others
This chunk will show that we can call managed bean method and Ajax together and it works using JSF2.0
<h:form>
<h:inputText id="comments" value="#{photoManagedBean.name}"></h:inputText>
<h:commandButton value="Comments Input" >
<f:ajax execute="comments" listener="#{photoManagedBean.saveComments()}" render="displayRecentComments" />
</h:commandButton>
<br/>
<table width="600" border="0" height="80">
<td>
<h:outputText id="displayRecentComments" value="#{photoManagedBean.name}"/>
</td>
</table>
</h:form>
ManagedBean:
public void saveComments() { //ur code//}