Hi Jason,
Thanks for your answer.
You only need the converter in the binding if your target object expects
a String representation of the widget's value, such as when you're
binding to an XML document. In your case you're not saving to a String
so you don't need it.
OK, this makes things clearer :).
You will, however, need something else to convert between the datatype
of the widget (java.util.Date) and your bean property (java.sql.Time).
I'm not sure if there's a better way to do it, but one approach would be
a javascript binding:
<fb:javascript id="time" path="time">
<fb:load-form>
// no conversion necessary since Time extends Date:
widget.setValue(jxpathPointer.getValue());
</fb:load-form>
<fb:save-form>
// create a Time from the Date:
var time = new java.sql.Time(widget.getValue().getTime());
jxpathPointer.setValue(time);
</fb:save-form>
</fb:javascript>
I'm almost there but it still doesn't work. Now I get:
[quote]
org.apache.commons.jxpath.JXPathException: Exception trying to create
xpath time; Factory
[EMAIL PROTECTED]
could not create an object for path: /time
[/quote]
I'm not sure, but I think this does not work:
var time = new java.sql.Time(widget.getValue().getTime());
I've also tried
var time = new java.sql.Time(widget.getValue());
and got the same result. Any ideas?
BTW, I have set the path to "/" like in the bean binding examples (I
hope that's ok):
<fb:context xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" path="/" >
Thanks,
Paloma
--
Paloma Gomez
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]