I need some help on ajax submission with some dynamic hidden field values. On a listing page, I have a list of entities. On each entity user can click a button to pop up a form and submit with Ajax (I use <a:commandLink/>). My current solution is to have a single <h:form/> in the page wrapping around multiple similar UI popup forms, one for each entity. Within each entity's pop form I have a <a:commandLink/> and use <f:param/> within to pass the entity id.
This is obviously not the elegant solution because the popup form fields are duplicated. I am thinking of having one pupup for all entities, and using a hidden field to pass the entity id (like and then set it with document.forms.entityId.value=foo on user click event). My problem is that I don't know how to pass this field to the action. I am using seam 1.2.1 on the server side. I am not sure how to bind the hidden value to a bean property. Anyone has ideas? Thanks.
a4j:commandLink triggers for submission how any non-ajax command components do. So, if you assign a form field with value, it will be available on the server side. You can do it using 'onclick' that is invoked before the submission