-
1. Re: How to aovid validations, when submitting AJAX request u
sergeysmirnov Apr 16, 2007 9:34 PM (in response to ckadam)Surround your selectOPneRadio with <a4j:region>
-
2. Re: How to aovid validations, when submitting AJAX request u
ckadam Apr 16, 2007 10:44 PM (in response to ckadam)Sergey, thanks for quick reply.
a4j region work. But, I also managed to get this working by defining ValueChangeListener & immediate=true on selectOneRadio, And then forcing RenderResponse on valueChangeListener code. Of course seems like, a4j region is lot cleaner, as I don't have to write any code.
However, now I am running into another issue: I am using the value of radio button to control "rendered" property of couple of Label / Input controls. I see in the AjaxResponse, to be rendered controls are returned from the server. But then it fails on the client side, when updating the HTML.
debug[19:36:12,715]: Attempt to update part of page for Id: dataSourceForm:acctNum
debug[19:36:12,715]: call getElementById for id= dataSourceForm:acctNum
warn[19:36:12,731]: Node for replace by response with id dataSourceForm:acctNum not found in document
There controls were not rendered by default on the page. But upon selection of radioButton, this extra markup should be rendered.
Obviously I am missing something here. -
3. Re: How to aovid validations, when submitting AJAX request u
ckadam Apr 16, 2007 10:50 PM (in response to ckadam)Here is markup that needs to be conditionally rendered, based on radio button selection.
<tr> <td class="formLabel"> <h:outputLabel for="roleId" value="Role Id:" styleClass="required" /> </td> <td> <h:inputText value="#{dataSourceForm.roleId}" id="roleId" size="25" required="true" rendered="#{!dataSourceForm.editMode}"> <f:validateLength maximum="50" /> </h:inputText> <h:outputText value="#{dataSourceForm.roleId}" rendered="#{dataSourceForm.editMode}" /> </td> </tr>
I tried wrapping whole TableRow inside a4j:outputPanel, and assigning rendered property to that (based on selected radio-buttons). But for some reason, these controls get rendered at the top of the page, and not inside the table row as expected. -
4. Re: How to aovid validations, when submitting AJAX request u
sergeysmirnov Apr 17, 2007 12:26 AM (in response to ckadam)surround this input with <a4j:outputPanel layout="none">
P.S. Just to prevent your next question:
#{dataSourceForm} should be a session scope bean OR saved with a4j:keepAlive component. Otherwise, the value will not be processed