This content has been marked as final.
Show 3 replies
-
1. Re: problem with input fields inside table
fabmars Mar 28, 2008 3:25 PM (in response to mocha)Use <a4j:commandButton/> or <a4j:commandLink/> WITH the attribute ajaxSingle="true"
Also you should read this:
http://ishabalov.blogspot.com/2007/08/sad-story-about-uiinput.html -
2. Re: problem with input fields inside table
mocha Apr 1, 2008 11:52 AM (in response to mocha)Thanks for the suggestion and link to article Fabien.
Unfortunately ajaxSingle="true" on the commandLinks doesn't work - I still lose the values from the input fields. This is what I did:<a:outputPanel id="questionPanel"> <h:dataTable value="#{questionnaire.questions}" var="question"> <h:column> <f:facet name="header">Question Text</f:facet> <h:inputText id="description" value="#{question.description}" required="true"/> </h:column> <h:column> <a:commandLink value="delete" reRender="questionPanel" action="#{questionnaire.removeQuestion(question)}" ajaxSingle="true" /> </h:column> </h:dataTable> </a:outputPanel> <a:commandButton value="add a question" reRender="questionPanel" action="#{questionnaireController.removeQuestion(question)}" ajaxSingle="true" /> <h:commandButton value="save" action="#{questionnaireController.save}"/>
Any have also tried using <a4j:region> around the links but of course this just results in the input fields being ignored during processing and then lost during the reRender.
Any other suggestions anyone? I only other option I have is to take the user to a new page to add/edit/remove records from the table. I really want to avoid this as it's a bit old school and I'd prefer to be able to edit in place without navigating to new pages.
Thanks -
3. Re: problem with input fields inside table
sergeysmirnov Apr 1, 2008 1:10 PM (in response to mocha)In you case, the ajaxSingle works exactly like it should. I.e. the a:commandLink is processed while the other components (h:inputText in your case) is bypassed