Paloma Gomez wrote:
<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]
Hmm, that's strange, it appears JXPath isn't able to do whatever it
needs to do to create the jxpathPointer (JXPath is still sort of voodoo
to me ;-) ). Are you sure the path is correct? Are you able to save to
other properties on your bean?
Does the load-form portion work, or are you doing save only?
Maybe try this instead (uses the bean directly rather than jxpath's
pointer):
<fb:javascript id="time" path=".">
<fb:load-form>
widget.setValue(jxpathContext.getNode().getTime());
</fb:load-form>
<fb:save-form>
var time = new java.sql.Time(widget.getValue().getTime());
jxpathContext.getNode().setTime(time);
</fb:save-form>
</fb:javascript>
I'm not sure, but I think this does not work:
var time = new java.sql.Time(widget.getValue().getTime());
Nah, that part should be fine. The error is happening before the
javascript is even being executed, while it's setting up the JXPath
context/pointer.
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):
Should be right, as long as you're saving directly to your bean.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]