Hi,

 

I am trying to write a custom component and am having some trouble with the binding. Specifically I Create 2 MyFaces Components in my renderer class, for some reason the two date components are not binding. If anyone can help or point me to a custom component article that renders compnents inside of components, that’d be great. Thanks! Here’s the code I have

 

 

Custom Component:

 

 

    private HtmlInputDate fromControl;

    private HtmlInputDate toControl;

   

            ...

writer.startElement("td");

HtmlDateRenderer dRenderer = new HtmlDateRenderer();

      dRenderer.encodeEnd(context, fromControl);

      writer.endElement("td");

 

Custom Component Tag:

 

 

//set the  properties

        if (value != null) {

            if (isValueReference(value)) {

              ValueBinding vb =

                FacesContext.getCurrentInstance().

                  getApplication().

                    createValueBinding(value);

             

              component.getAttributes().put("value", vb.getValue( FacesContext.getCurrentInstance()));

             

              ((ReportHeader)component).setFromControl(new HtmlInputDate());

              ((ReportHeader)component).setToControl(new HtmlInputDate());

             

             

             

              ValueBinding fromDateVB =

                  FacesContext.getCurrentInstance().

                    getApplication().

                      createValueBinding("#{"+value.replaceAll("[\\{\\}\\#]*", "")+".availStartDay.sqlDate}");

             

             

              ((ReportHeader)component).getFromControl().setValueBinding("value", fromDateVB);

 



NOTICE: This message, including all attachments transmitted with it, is for the use of the addressee only. It may contain proprietary, confidential and/or legally privileged information belonging to Litle & Co. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, you must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message. If you believe you have received this message in error, please delete it and all copies of it from your system and notify the sender immediately by reply e-mail. Thank you.

Reply via email to