setting an initial value for the first element

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

setting an initial value for the first element

burkina faso
hi there,

i am trying to realize auto-generation of ids.
for that purpose i expand the xforms-bookcast sample app.
in my example every book now has an id-element (type xs:id, pattern: book/d).
i already implemented the functionality, that if i add a new book, the id ist generated (book2, book3, book4 etc.) automatically. my problem is, that i have to type the first id manually (book1).
when i start the application there is the empty form for the first book.
i want, that for this first book die fiel id is filled with the value book1 automatically.

i already experienced with the xforms-ready-event - but it somehow doesn't work.

any hints?

thank you in advance
Reply | Threaded
Open this post in threaded view
|

Re: setting an initial value for the first element

Erik Bruchez
Administrator
You should be able to use binds to do this. One approach I have used  
looks like this to set random id values on elements:

<xforms:bind nodeset="//*/@id[. = '']"
              calculate="concat('ID', digest(string(random(true)),  
'MD5', 'hex'))"/>

You could do something similar.

-Erik

On Feb 8, 2008, at 11:02 AM, burkina faso wrote:

>
> hi there,
>
> i am trying to realize auto-generation of ids.
> for that purpose i expand the xforms-bookcast sample app.
> in my example every book now has an id-element (type xs:id, pattern:
> book/d).
> i already implemented the functionality, that if i add a new book,  
> the id
> ist generated (book2, book3, book4 etc.) automatically. my problem  
> is, that
> i have to type the first id manually (book1).
> when i start the application there is the empty form for the first  
> book.
> i want, that for this first book die fiel id is filled with the  
> value book1
> automatically.
>
> i already experienced with the xforms-ready-event - but it somehow  
> doesn't
> work.
>
> any hints?
>
> thank you in advance
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws