-
1. Re: Passing variables with ajax request
sergeysmirnov May 15, 2007 1:13 PM (in response to tomba)It hard for me to understand how it might work fine if you have onchange="submit()" that means to perform a regular non-ajax request with full page reloading.
...or may be submit() means something also in your code? -
2. Re: Passing variables with ajax request
alexsmirnov May 15, 2007 2:35 PM (in response to tomba)You can add parameter to ajax request :
<a4j:support onsubmit="Richfaces.showModalPanel('busy')" event="onchange" oncomplete="Richfaces.hideModalPanel('busy');sortables_init()" reRender="projectlist"> <f:param name="consulting" value="#{params.consulting}" /> </a4j:support>
-
3. Re: Passing variables with ajax request
tomba May 16, 2007 3:54 AM (in response to tomba)Sorry for the submit() call, it was a leftover in my code and should not have been here.
Anyway, the a4j manual says the following:In this example the request contains only the input component causes the request generation, not all the components contained on a form, because of "ajaxSingle=true" usage.
Since I have not set ajaxSingle, I would expect also hidden input fields to be sent on the ajax request.
As for the f:param, can you also explain where I have to handle that parameter? It doesn't help putting it in the value function of the to-be-rerendered component.
Thanks for the help -
4. Re: Passing variables with ajax request
tomba May 16, 2007 5:42 AM (in response to tomba)So I tried with an f:param and even an f:attribute and with adding an actionListener in the a4j tag. However, in neither case I get the actual value but always null :(
-
5. Re: Passing variables with ajax request
ilya_shaikovsky May 16, 2007 6:24 AM (in response to tomba)Put please latest sources with f:param here. And describe the behaviour you expected for the code step by step please.
B.t.w. One more component to set some value to the backing bean directly, while sending an ajax request, is a4j:actionparam -
6. Re: Passing variables with ajax request
tomba May 16, 2007 7:47 AM (in response to tomba)Well I have solved the problem now. The problem to overcome was to still have the initial GET parameters available across different ajax requests.
Therefore, I made an init-param for my managed-bean and put a inputHidden field in the form.
Greetings,
Steven De Groote