Hi all!
On selecting a DIV element, i take the value of the selected DIV's hidden element and pass it on to a form with hidden element in it. This form is then submitted. Below are pieces of my code.
The value of the hidden input inside the form is correctly set on selecting the DIV and the form is also submitted but the valueChangeListener is not fired.
Every hint is welcome!
-choesang
Form with hidden element:
<a4j:form id="currentForumPost" ajaxSubmit="true"
onsubmit="console.log('currentForumPost is submitted');
console.log(jQuery('#currentForumPost:currentPostId').val())" >
<h:inputHidden id="currentPostId"
valueChangeListener="#{forumController.changeListenerSelectedForumPost}"
immediate="true"/>
</a4j:form>
DIV element:
<div class="block ui-accordion ui-widget ui-helper-reset"
onclick="var x = jQuery(this).find('.hiddenInputText').val();
jQuery(this).closest('#RightPane').find('#currentForumPost:currentPostId').val(x);
jQuery(this).closest('#RightPane').find('#currentForumPost').submit();">
<h:inputText value="#{post.uuid}" styleClass="hiddenInputText"/>
......
</div>
Java
public void changeListenerSelectedForumPost(final ValueChangeEvent event) {
setSelectedForumPost(event.getComponent().getAttributes().get("value").toString());
}