-
1. Re: a4j:support dynamic creation issue
fil78 Jun 13, 2009 4:21 AM (in response to fil78)Hey folks, does anybody know the answer? I do need help...
-
2. Re: a4j:support dynamic creation issue
nbelaevski Jun 13, 2009 7:27 AM (in response to fil78)Hi,
What is "affected" you are referring to? -
3. Re: a4j:support dynamic creation issue
fil78 Jun 13, 2009 11:11 AM (in response to fil78)Hi,
I mean generated javascript code.. I checked correctly working code and found out that there is something like 'affected':['form_id:field1_id','form_id:fild2_id'] presents.. It is clear that all field id's to rerender listed there. I do not know why in my case it is not generated although I do ajaxSupport.setReRender(getClientId(context) + "," + LIST_BOX). Could you give me a hint? Thanks. -
4. Re: a4j:support dynamic creation issue
nbelaevski Jun 13, 2009 5:12 PM (in response to fil78)Well, I'm checking out: http://livedemo.exadel.com/richfaces-demo/richfaces/commandLink.jsf?c=commandLink&tab=usage. Here is "onclick" handler code copied from Firebug:
A4J.AJAX.Submit('_viewRoot','j_id353',event,{'parameters':{'j_id353:j_id357':'j_id353:j_id357'} ,'actionUrl':'/richfaces\x2Ddemo/richfaces/commandLink.jsf','similarityGroupingId':'j_id353:j_id357'} );return false;
- no "affected" are present. Definitely, there was a case when "affected" was used, however I can't remember what case produced such code (maybe limitToList usage?). Also note that reRender list can be a dynamic list created on the server; so "affected" is not necessary on the client side at all.
Try assigning this:AjaxRendererUtils.asSet("...ids to reRender")
as the value of "reRender" attribute. -
5. Re: a4j:support dynamic creation issue
fil78 Jun 15, 2009 8:06 AM (in response to fil78)Thanks Nick, I checked the livedemo - it is true that no ids to rerender are mentioned in the generated AJAX.Submit code..
Regarding AjaxRendererUtils.asSet - it would not work..
Could it be the problem that I combined 3 components programmatically (HtmlSelectOneListbox and HtmlButton added after super.encodeEnd) and inherited from javax.faces.component.html.HtmlInputText? or
Could it be the problem that I am trying to reRender component itself?
but everytime when onkeyup fires encodeBegin and encodeEnd properly invokes... and no changes on UI..(( -
6. Re: a4j:support dynamic creation issue
fil78 Jun 17, 2009 10:20 AM (in response to fil78)Hi,
I fixed this issue - I just placed my component on the a4j panel.. But now I've got another question. I am implementing something like a search button and I want just to reRender part of a page without any action invoking. So I am trying to do something like:HtmlAjaxCommandButton searchButton = new HtmlAjaxCommandButton(); searchButton.setId("ajButton"); searchButton.setStyleClass(STYLE_SEARCH_BUTTON); String action = ""; ExpressionFactory factory = context.getApplication().getExpressionFactory(); MethodExpression methodExpression = factory.createMethodExpression(context.getELContext(), action, null, new Class<?>[0]); searchButton.setActionExpression(methodExpression); searchButton.setImage("/images/searchFieldBtn.gif"); searchButton.setReRender(AjaxRendererUtils.asSet(getClientId(context) + "," + LIST_BOX + "," + getReRender())); searchButton.setEventsQueue(eventsQueue); searchButton.setActionExpression(actionExpression); searchButton.encodeAll(context);
But it generates an exception.. If I put:String action = "dummyString";
It invokes something like an ajax request because a4j status triggers, but it does not reRender the page at all. what is the best practice just to reRender a piece of page without invoking actions? What am I doing wrong? -
7. Re: a4j:support dynamic creation issue
fil78 Jun 18, 2009 10:26 AM (in response to fil78)Hey folks, do not be shy to answer, please..
-
8. Re: a4j:support dynamic creation issue
fil78 Jun 18, 2009 12:50 PM (in response to fil78)All was fixed by:
UIComponent form = getCurrentForm(this); if (form != null) { form.getChildren().add(searchButton); }
Thanks..