-
1. Re: is ajaxSingle really working in s:support ?
henrik.lindberg May 1, 2007 6:52 AM (in response to henrik.lindberg)I found some other advice that I tried. If adding a <a4j:region> around each check box element I get the effect that I want
I think the documentation should state this. (Or make ajaxSingle do what you expect it to do - submit only a single value).
I used this form in combination with a rich:modalPanel which led to more confusion, because there the documentation says something like ... in order to submit you must have a form in your panel... - the effect of adding a second form is quite confusing - things are cleared, and it is not behaving as you would expect (unless you are an expert I guess).
Anyway - to help others searching for a solution to this - here is my working example:<f:view> <a href="javascript:Richfaces.showModalPanel('popupForm:panel');">searchoptions</a> <h:form id="popupForm" > <rich:modalPanel id="panel" width="400" height="300"> <!-- <f:facet name="header"> <h:outputText value="Search Options"/> </f:facet> --> <a4j:region> <h:selectBooleanCheckbox id="comp" value="#{searchOptions.searchComponents}" title="Components" > <a4j:support event="onchange" ahaxSingle="true" /> </h:selectBooleanCheckbox> </a4j:region> <a4j:region> <h:selectBooleanCheckbox id="cspec" value="#{searchOptions.searchComponentSpecs}" title="CSpecs" > <a4j:support event="onchange" ahaxSingle="true" /> </h:selectBooleanCheckbox> </a4j:region> <a4j:region> <h:selectBooleanCheckbox value="#{searchOptions.searchComponentQueries}" title="CQueries"> <a4j:support event="onchange" ahaxSingle="true" /> </h:selectBooleanCheckbox> </a4j:region> <a4j:region> <h:selectBooleanCheckbox value="#{searchOptions.searchBillOfMaterials}" title="Boms"> <a4j:support event="onchange" ahaxSingle="true" /> </h:selectBooleanCheckbox> </a4j:region> <a href="javascript:Richfaces.hideModalPanel('popupForm:panel')">Close</a> </rich:modalPanel> </h:form> </f:view>
Regards
- henrik -
2. Re: is ajaxSingle really working in s:support ?
henrik.lindberg May 1, 2007 7:27 AM (in response to henrik.lindberg)Ooops... all those "ahaxSingle" were obviously wrong...
But I was wrong - that example does not work at all. It always sets the boolean values to FALSE !!!
(...trying something else...) -
3. Re: is ajaxSingle really working in s:support ?
henrik.lindberg May 1, 2007 8:02 AM (in response to henrik.lindberg)about to give up - It works fine if it is not in a modalPanel.
When in a modal panel - I can get it to set the values to false (but not to true even if checkboxes flip) if the modalPanel does not have a form inside it, or to not set values at all (but still change checkboxes) if it has a form inside (as documentation states is needed for correct operation on IE).
I am using FF, and get the same behavior in IE.
Both richfaces and ajax4jsf are May 01 snapshots -
4. Re: is ajaxSingle really working in s:support ?
sergeysmirnov May 1, 2007 9:39 AM (in response to henrik.lindberg)modal panel should always have an own form. It is true for both - FF and IE.
-
5. Re: is ajaxSingle really working in s:support ?
henrik.lindberg May 1, 2007 11:02 AM (in response to henrik.lindberg)I don't understand what you mean. There is only one form in the example !
-
6. Re: is ajaxSingle really working in s:support ?
sergeysmirnov May 1, 2007 11:23 AM (in response to henrik.lindberg)The form must be INSIDE the rich:modalPanel
-
7. Re: is ajaxSingle really working in s:support ?
henrik.lindberg May 1, 2007 1:36 PM (in response to henrik.lindberg)Thanks Sergey, with only a single form inside the ModalPanel my code works.
I think the documentation should be changed. The section for modalPanel has examples that has a form around (outside) the modalPanel. This is misleading.
It should state that the form should be inside and that the entire construct in turn should not be nested inside an outer form (which also does not work).
Regards -
8. Re: is ajaxSingle really working in s:support ?
sergeysmirnov May 1, 2007 1:42 PM (in response to henrik.lindberg)3.0.0 does not required the form inside. 3.0.1 does.
What the example you mean? -
9. Re: is ajaxSingle really working in s:support ?
henrik.lindberg May 1, 2007 4:09 PM (in response to henrik.lindberg)Here for instance: http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone/docs/devguide/index.html
It only says "3.0" (something like 3.0.1 is not supposed to break the API right :)
Look at "Detail of Usage" for Modal panel. The code has the form outside of the modalPanel. -
10. Re: is ajaxSingle really working in s:support ?
sergeysmirnov May 1, 2007 4:58 PM (in response to henrik.lindberg)Ok, you mean the documentation, not examples. The documentation must be corrected. It takes time and resources. So, I cannot guaranty the documentation text will updated instantly.
-
11. Re: is ajaxSingle really working in s:support ?
henrik.lindberg May 2, 2007 4:37 AM (in response to henrik.lindberg)Hi, I understand that documentation can not be updated instantly - no problem.
What is the best way I can help?
Here is an attempt to write a text that would be helpful in the documentation:
"In versions > 3.0.0 - the <rich:modalPanel> should no longer be contained in a form. A form should instead be placed inside the modal panel if submits are wanted of input elements in the modalPanel. No form is required if you do not need submits (ajax or regular)."
Regards -
12. Re: is ajaxSingle really working in s:support ?
sergeysmirnov May 2, 2007 1:44 PM (in response to henrik.lindberg)Yes, you are correct.