rich:calendar programmatically problem
zaquas Dec 22, 2010 1:20 PMHello to all, and excuse for my English...
If I try create a rich:calendar component programmatically the numbers of the days are hidden.
I doing this:
public class FieldPlusHandler extends TagHandler { private final TagAttribute backingBeanTag; private final TagAttribute fieldTag; private final TagAttribute valueTag; public FieldPlusHandler(TagConfig config) { super(config); this.backingBeanTag = this.getRequiredAttribute("backingBean"); this.fieldTag = this.getRequiredAttribute("field"); this.valueTag = this.getRequiredAttribute("value"); } public void apply(FaceletContext faceletsContext, UIComponent aParent) throws IOException, FacesException, FaceletException, ELException { if (!faceletsContext.getFacesContext().getRenderKit().getResponseStateManager().isPostback(faceletsContext.getFacesContext())) { ValueExpression valueExpression = valueTag.getValueExpression(faceletsContext, Object.class); //final HtmlCalendar calendar = (HtmlCalendar) FacesContext.getCurrentInstance().getApplication().createComponent(HtmlCalendar.COMPONENT_TYPE); HtmlCalendar calendar = new HtmlCalendar(); calendar.setValueExpression("value", valueExpression); calendar.setPopup(true); calendar.setShowApplyButton(false); calendar.setCellWidth("24px"); calendar.setCellHeight("22px"); calendar.setDatePattern("d MMM yyyy"); calendar.setStyle("width:200px;"); aParent.getChildren().add(calendar); final HtmlAjaxSupport htmlAjaxSupport = (HtmlAjaxSupport) FacesContext.getCurrentInstance().getApplication().createComponent(HtmlAjaxSupport.COMPONENT_TYPE); htmlAjaxSupport.setEvent("onchanged"); calendar.getChildren().add(htmlAjaxSupport); } } }
And when try to use the calendar....
Somebody have a idea?
Thanks in advance
Stefano Zaccaria.