This content has been marked as final.
Show 4 replies
-
1. Re: AJAX rerender from within a uicomponent
ilya_shaikovsky Nov 17, 2008 10:56 AM (in response to dreuzel)reRender attribute could be EL binded to some bean property and filled on the server according to your logic.
-
2. Re: AJAX rerender from within a uicomponent
dreuzel Nov 18, 2008 2:37 AM (in response to dreuzel)the problem is not the EL logic.
it is the Decode method in the UIComponent that decides when and where the ajax expand is made.
so I need to call it from within the UIComponent -
3. Re: AJAX rerender from within a uicomponent
ilya_shaikovsky Nov 18, 2008 6:18 AM (in response to dreuzel)So you should use ajax context like this:
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context); Set<String> renderedAreas = ajaxContext.getAjaxRenderedAreas(); renderedAreas.add(SOMEUICOMPONENT.getClientId(context));
-
4. Re: AJAX rerender from within a uicomponent
dreuzel Nov 18, 2008 9:55 AM (in response to dreuzel)I gave it a shot but it does not seem to work
maybe I'm doing it badly
key contains comma separated id's the different components are found.public void render(FacesContext ctx,String key) { if (key==null) return; AjaxContext ajaxContext = AjaxContext.getCurrentInstance(ctx); Set<String> renderedAreas = ajaxContext.getAjaxRenderedAreas(); if (key instanceof String) { String[] ids= ((String) key).split(",");//all the id's handle an encapsulation UIComponent par=this;//find the topmost parrent UIComponent ob; while ((ob=par.getParent())!=null) {par=ob;}//get the root parent for (int i=0;i< ids.length;i++) //for all id components { UIComponent comp=par.findComponent(ids);//find the components if (comp ==null) log.info("[ ajax upd component "+ids+" not found "); else renderedAreas.add(comp.getClientId(ctx)); } } }
Just to be on the save side for rendering I added a button using the same (ids) appending to my UIComponent
there is no automatic updat when the decode routine activates the above routine
ther is automatic update when I ajaxCommand the above
I'm I getting your suggestion wrong ?