3 Replies Latest reply on Sep 24, 2011 5:06 PM by Ilya Shaikovsky

    a4j:param and date datatype

    Dana Heath Newbie

      All,

       

      I've got the following code in my .xhtml file:

       

      <a4j:param name="selectedDate" value="#{bean.selectedDate}" assignTo="#{otherBean.selectedDate}" >

      </a4j:param>

       

      but it's blowing chunks on the date type with the following error:

       

      Cannot convert [object Object] of type class java.lang.String to class java.util.Date

       

      The data type of both backing beans is java.util.Date. How do I get this to work?

       

      Thanks

        • 1. Re: a4j:param and date datatype
          iabughosh Master

          Hi Dana,

          where did use the a4j:param ?, please post more of your xhtml code.

           

          regards.

          • 2. Re: a4j:param and date datatype
            Dana Heath Newbie

            It's inside a <a4j:commandLink>

             

            I created a work-around by just storing the selected date in its own bean and adding the dateBean to the other needed beans.

             

            It would be nice, however, to know how to pass date objects between beans

            • 3. Re: a4j:param and date datatype
              Ilya Shaikovsky Master

              You could use <f:setPropertyActionListener> to make pure server side assignment.

               

              a4j:param designed to brind data to the client and then submit back assigning to proper object. That allows us to pass client parameters as far as just perform pure server side assignments. But for that we paying by nessesity to define converter for the objects used in param.

               

                              <a4j:commandLink value="assign" render="@form">

                                        <a4j:param converter="javax.faces.DateTime" value="#{calendarBean.selectedDate}" assignTo="#{calendarBean.selectedDate2}"/>

                              </a4j:commandLink>

              works for me.