-
1. Re: Submit a form with rendered component
ilya_shaikovsky Dec 10, 2009 8:56 AM (in response to denebj)request bean - should be session scoped in order rendered values should be restrored between requests.
-
2. Re: Submit a form with rendered component
denebj Dec 10, 2009 10:38 AM (in response to denebj)I do not want to put my bean is session scope :-/
-
3. Re: Submit a form with rendered component
nbelaevski Dec 10, 2009 7:04 PM (in response to denebj)Viable alternative is a4j:keepAlive or Seam conversation scoped-beans.
-
4. Re: Submit a form with rendered component
denebj Dec 11, 2009 3:28 PM (in response to denebj)I cannot put an a4j:keepAlive because I have an extanded data table and I have an exception (like the compenent is not serializable).
I used the getRequestParamMap() for retrieving my info, it is not perfect but at least it seem to be clean. -
5. Re: Submit a form with rendered component
nbelaevski Dec 11, 2009 5:45 PM (in response to denebj)I used the getRequestParamMap() for retrieving my info, it is not perfect but at least it seem to be clean.
Note that this may affect application security if it's based on "rendered" attribute. -
6. Re: Submit a form with rendered component
ilya_shaikovsky Dec 14, 2009 3:14 AM (in response to denebj)Just made some redesign in order to have data in session scoped(conversational) beans and UI components instances if you need to bind them to be put in request. -
7. Re: Submit a form with rendered component
denebj Dec 15, 2009 1:30 PM (in response to ilya_shaikovsky)Ok great !!!
It is rising an other question, I am trying to have a rendered attribute on my button (id="apply change" in my example), but when I have the condition that renders it, if I click on the button, nothing is happening, it is not submiting or loading my action in my bean. I guess because the button was not rendered in the first place it is somewhat not in the "DOM tree" so there is no action link to my bean.
Is there a way to make it work ? I am pretty sure that I am not the only one trying to do something like that but I have trouble to find information on the internet about that :-/
Thanks for your help !
-
8. Re: Submit a form with rendered component
nbelaevski Dec 15, 2009 2:16 PM (in response to denebj)Well, Ilya and me already suggested how to make that work. -
9. Re: Submit a form with rendered component
denebj Dec 15, 2009 3:27 PM (in response to nbelaevski)My bad, I read it to fast lol -
10. Re: Submit a form with rendered component
nbelaevski Dec 15, 2009 5:41 PM (in response to denebj)Just recalled that you can also modify "rendered" attribute directly in component instance, e.g. via binding components to model beans or extracting them from server events. -
11. Re: Submit a form with rendered component
denebj Dec 17, 2009 11:00 AM (in response to nbelaevski)Hum I tried to find the component on the server and rendered it , but the action on this component is still not working ^^
I did that :
HtmlAjaxCommandButton butt = (HtmlAjaxCommandButton)context.getViewRoot().findComponent("requestsListForm:applyChange");
butt .setRendered(true);I thought it would be enough hum, I need to try by binding to see if I can make it work.
EDIT:
OK !! It is working perfeclty I used that approach :
HtmlAjaxCommandButton butt = (HtmlAjaxCommandButton)context.getViewRoot().findComponent("requestsListForm:applyChange");
butt .setRendered(true);and everything is working
Thanks you guys !!