Re: RE: Re: RE: XForms/XPath expressions in 'value' of xforms:setvalue; how to generate a random string (to be used as password)

Posted by Hank Ratzesberger on
URL: https://discuss.orbeon.com/XForms-XPath-expressions-in-value-of-xforms-setvalue-how-to-generate-a-random-string-to-be-used-as-p-tp43363p43367.html


Denis,

Without using an intermediate control, it is complicated, I am not sure
how you can do this.

If you had a web service for your JavaScript and your web page to get  
the
instance data from... It might be possible to use the default submission
to update (from javascript) instance data.

There would be side effects like what xforms events are fired (or not),
the page might refresh.

One instance containing the serialized text of another, plus a hidden  
control
to hold the text, plus a way to create a DOM object in javascript  
from the text
is the solution Orbeon designed.

Regards,
Hank

On May 11, 2009, at 12:52 AM, Denis Galiana wrote:

> Thanks Hank,
>
> In fact I would like to set/get data to/from the data model  
> (without using a
> control).
> Is it possible ?
>
> Thanks
>
>
> -----Message d'origine-----
> De : Hank Ratzesberger [mailto:[hidden email]]
> Envoyé : jeudi 7 mai 2009 17:21
> À : [hidden email]
> Objet : [ops-users] Re: RE: XForms/XPath expressions in 'value' of
> xforms:setvalue; how to generate a random string (to be used as  
> password)
>
>
> Yes, you can get/set a control from JS.
>
> http://www.orbeon.com/ops/doc/reference-xforms-extensions#xforms- 
> javascript-
> get-set-value
>
> By default, password controls are also encrypted in JS.
>
> http://www.orbeon.com/ops/doc/reference-xforms-configuration#d165e1221
>
> Regards,
> Hank
>
>
>
>> I’ve succeeded with this code :
>>
>>
>>
>>
>> <xforms:setvalue ref="instance('local-data')/GeneratedPassword"
>>
>>
>> value="concat(substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs
>> tuvwxy z0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),
>>
>>
>> substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
>> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1),
>>
>>
>> substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
>> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1),
>>
>>
>> substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
>> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1),
>>
>>
>> substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
>> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1),
>>
>>
>> substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
>> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1),
>>
>>
>> substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
>> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1),
>>
>>
>> substring
>> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
>> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1))"/>
>>
>>
>>
>>
>>
>>
>>
>> Do you know, if I can xform:setvalue from javascript ?
>>
>>
>>
>> Best Regards,
>>
>>
>>
>>
>>
>> De : Denis Galiana [mailto:[hidden email]]
>> Envoyé : jeudi 7 mai 2009 15:13
>> À : [hidden email]
>> Objet : [ops-users] XForms/XPath expressions in 'value' of
>> xforms:setvalue; how to generate a random string (to be used as
>> password)
>>
>>
>>
>> Hi,
>>
>>
>>
>> I’m trying to generate a random password string in a  
>> <xforms:setvalue>
>> sentence.
>>
>> Could anybody help me ?
>>
>>
>>
>> Best regards,
>>
>> Denis
>>
>>
>>
>>
>
>
>
>
> --
> 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
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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