This content has been marked as final.
Show 19 replies
-
15. Re: Rich Calendar and Ajax support
ilya_shaikovsky Jun 11, 2009 7:15 AM (in response to aboocs01)do you able to share complete sample sources? I will work on corrections and share the results there then.
-
16. Re: Rich Calendar and Ajax support
elf Jun 11, 2009 8:07 AM (in response to aboocs01)Here is my code:
1.<rich:page xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" markupType="xhtml" contentType="text/html" theme="simple" sidebarWidth="350" sidebarPosition="right" pageTitle="#{mngr.smallPortalName}" id="PORTAL_MAIN_PAGE"> <f:facet name="header"> <h:outputText value="#{mngr.portalName}" /> </f:facet> <f:facet name="sidebar"> <h:outputText value="" /> </f:facet>
2.public String getPortalName() { UIHelper.updatePortal(this); return UIHelper.getResLabels().getString("portalName"); }
3.
public static void updatePortal(PortalManager man){
FacesContext fc = FacesContext.getCurrentInstance();
UIComponent pP = fc.getViewRoot().findComponent(PORTAL_MAIN_PAGE);
((HtmlPage)pP).getFacets().put("sidebar", getSideBar(man));
4.
AjaxForm f = new AjaxForm();
HtmlCalendar orgCal = new HtmlCalendar();
orgCal.setPopup(false);
orgCal.setValueExpression("value",
eF.createValueExpression(eC, "#{" + DataBinding.BINDING_BEAN_NAME + ".orgDate}", Date.class));
orgCal.setValueExpression("binding",
eF.createValueExpression(eC, "#{" + DataBinding.BINDING_BEAN_NAME + ".organizerDate}", UICalendar.class));
orgCal.setMode("ajax");
HtmlAjaxSupport as = new HtmlAjaxSupport();
as.setEvent("onchanged");
as.addActionListener(new OrganizerValueChangeListener());
orgCal.getFacets().put("onchanged", as);
f.getChildren().add(orgCal);
return f;
I tried to use different mode for calendar object, different form object, different bean scopes, but looks like problem is in wrong sidebar creating. -
17. Re: Rich Calendar and Ajax support
nbelaevski Jun 11, 2009 8:37 AM (in response to aboocs01)Do not recreate components on each get* call.
-
18. Re: Rich Calendar and Ajax support
elf Jun 11, 2009 8:47 AM (in response to aboocs01)sidebar created only once, when page loading ...
-
19. Re: Rich Calendar and Ajax support
elf Jun 15, 2009 9:54 AM (in response to aboocs01)"ilya_shaikovsky" wrote:
do you able to share complete sample sources? I will work on corrections and share the results there then.
ilya, is there any news on this ?