cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paloma Gomez" <paloma...@gmail.com>
Subject CForms: Time widget binding problem
Date Wed, 12 Jul 2006 23:10:13 GMT
Hi all,

After having a look at the CForms samples I'm trying to create my
first form. This is the first time I'm doing it, so maybe there are
things I think I understand and actually  I don't ;).

I'm having problems with the binding of a time widget to a bean and I
can't find any example of time widgets in cocoon samples. (I'm only
interested in the time, I know there are examples with dates).

Here is the widget definition:

<fd:field id="time" required="true">
   <fd:label>Time (hh:mm):</fd:label>
   <fd:datatype base="date">
	<fd:convertor datatype="date" variant="time" type="formatting">
		<fd:patterns>
			<fd:pattern>kk:mm</fd:pattern>
		</fd:patterns>
	 </fd:convertor>
    </fd:datatype>
</fd:field>

Now the binding:
<fb:value id="time" path="time">
   <fd:convertor datatype="date" variant="time" type="formatting">
       <fd:patterns>
          <fd:pattern>kk:mm</fd:pattern>
        </fd:patterns>
   </fd:convertor>
    </fd:datatype>
</fb:value>	
(I've tried some variants of this without success)

(There is something I don't understand well: why do I need two convertors?)

And finally the bean (I include only the fragments related to this widget)

[...]
import java.sql.Time;
[...]
public class EventBean {
[...]
private Time time;
[...]
public Time getTime() {
        return time;
    }

    public void setTime(Time time) {
        this.time = time;
    }
[...]
}

I use the datatype java.sql.Time because I want to use it to query a
database. I don't know if this is relevant or not.

I get the following error message:
[...]
Caused by: org.apache.commons.jxpath.JXPathException: Cannot modify
property: module.EventBean.time; Cannot convert value of class
java.lang.String to type class java.sql.Time;
org.apache.commons.beanutils.ConversionException

My system:
* cocoon-2.1.10-dev
* jetty
* Ubuntu Linux

Any hints would be appreciated.

Thanks

Paloma

--
Paloma Gomez

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message