You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ubiquity XForms Developers
Hi All:
Could anyone give me some suggestion about integrating Javascript into
xform? How many ways are there integrating Javascript into xforms and
how to integrate?
John Boyer
unread,
Aug 27, 2009, 12:40:24 PM8/27/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ubiquit...@googlegroups.com
Here's a start:
1) Certain normal javascript techniques
just work with XForms. For example, if you put a class attribute
on an XForms form control (like an xf:input or xf:group) and then you use
some javascript to change the class, the result of that change is seen
on the screen.
2) There is a basic javascript function
extension mechanism available that allows you to define javascript functions
that can be called by XPaths used XForms, including computes (e.g. calculate,
constraint, required, relevant and readonly), bindings (e.g. ref, nodeset)
and other XPaths (e.g. the value attribute). The loan-lowercase.html
example in the samples directory, combined with the file format.js, show
you how to do this. It's quite easy.
3) You can set up your own event listeners
for events in the XForms processing lifecycle, and then you can run your
own javascript code. That code can invoke the Ubiquity processor's
functions that implement XForms actions such as setvalue, insert and delete.
You can also directly change data, then set various model flags such
as the rebuild and recalculate flags, and then you can call deferredUpdate()
on the model.
Cheers,
John M. Boyer, Ph.D.
STSM, Interactive Documents and Web 2.0 Applications
Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boy...@ca.ibm.com