xxforms:repeat-current problems

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

xxforms:repeat-current problems

Ryan Puddephatt

Hi all,

            I’m having a problem using xxforms:repeat-current, it doesn’t seem to return anything, and in the attached example it gives me an error, any ideas why?

 

Ryan

 

Ryan Puddephatt

Software Engineer

TFX Group - IT UK

1 Michaelson Square

Livingston

West Lothian

Scotand

EH54 7DP

 

* [hidden email]

( 01506 407 110

7  01506 407 108

 

 



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

test.xhtml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: xxforms:repeat-current problems

Ryan Puddephatt

Hi all,

            I’ve also tried using xxforms:context(‘repeat-id’), this gave me an error

 

XForms error: A sequence of more than one item is not allowed as the first argument of string()

 

Thanks Ryan

 

Ryan Puddephatt

Software Engineer

TFX Group - IT UK

1 Michaelson Square

Livingston

West Lothian

Scotand

EH54 7DP

 

* [hidden email]

( 01506 407 110

7  01506 407 108

 


From: Ryan Puddephatt [mailto:[hidden email]]
Sent: 29 June 2006 20:25
To: [hidden email]
Subject: [ops-users] xxforms:repeat-current problems

 

Hi all,

            I’m having a problem using xxforms:repeat-current, it doesn’t seem to return anything, and in the attached example it gives me an error, any ideas why?

 

Ryan

 

Ryan Puddephatt

Software Engineer

TFX Group - IT UK

1 Michaelson Square

Livingston

West Lothian

Scotand

EH54 7DP

 

* [hidden email]

( 01506 407 110

7  01506 407 108

 

 



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:repeat-current problems

Erik Bruchez
Administrator
In reply to this post by Ryan Puddephatt
Ryan,

That's because you wrote "current-repeat" instead of "repeat-current".
Change that and it works like a charm ;-)

-Erik

Ryan Puddephatt wrote:

> Hi all,
>
>             I’m having a problem using xxforms:repeat-current, it
> doesn’t seem to return anything, and in the attached example it gives me
> an error, any ideas why?
>
>  
>
> Ryan
>
>  
>
> *Ryan Puddephatt*
>
> Software Engineer
>
> TFX Group - IT UK
>
> 1 Michaelson Square
>
> Livingston
>
> West Lothian
>
> Scotand
>
> EH54 7DP
>
>  
>
> * [hidden email]
>
> ( 01506 407 110
>
> 7  01506 407 108
>
>  
>
>  
>
>
> ------------------------------------------------------------------------
>
> Group Criteria Selection 1 Selected:
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: xxforms:repeat-current problems

Ryan Puddephatt
Erik,
        Ok that works for the example I gave you, but I'm trying to use it
within a xforms:dispatch/@if and xforms:setvalue/@ref (within a custom
event) and it doesn't return anything I keep getting the following

XForms error: Cannot convert string "" to a double

Any ideas why?

Thanks Ryan

Ryan Puddephatt
Software Engineer
TFX Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

>-----Original Message-----
>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>Sent: 30 June 2006 10:57
>To: [hidden email]
>Subject: Re: [ops-users] xxforms:repeat-current problems
>
>Ryan,
>
>That's because you wrote "current-repeat" instead of "repeat-current".
>Change that and it works like a charm ;-)
>
>-Erik
>
>Ryan Puddephatt wrote:
>> Hi all,
>>
>>             I'm having a problem using xxforms:repeat-current, it
>> doesn't seem to return anything, and in the attached example it gives me
>> an error, any ideas why?
>>
>>
>>
>> Ryan
>>
>>
>>
>> *Ryan Puddephatt*
>>
>> Software Engineer
>>
>> TFX Group - IT UK
>>
>> 1 Michaelson Square
>>
>> Livingston
>>
>> West Lothian
>>
>> Scotand
>>
>> EH54 7DP
>>
>>
>>
>> * [hidden email]
>>
>> ( 01506 407 110
>>
>> 7  01506 407 108
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> Group Criteria Selection 1 Selected:
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>--
>Orbeon - XForms Everywhere:
>http://www.orbeon.com/blog/




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:repeat-current problems

Erik Bruchez
Administrator
In reply to this post by Ryan Puddephatt
The xxforms:context() function will return the context as of
xforms:repeat, which is determined by the @nodeset attribute. Therefore,
the context is your example contains a sequence of 6 attribute nodes.

Now this raises an interesting question, which is whether
xforms:setvalue/@value should fail as it does now when passed a node-set
with more than one node, or just take the first node. I think the
expected behavior is the latter one, as per XPath 1.0. I noticed that it
fails only because the semantics of string() have changed slightly
between XPath 1.0 and XPath 2.0.

The bottom line is that this should be fixed now :-)

-Erik

Ryan Puddephatt wrote:

> Hi all,
>
>             I’ve also tried using xxforms:context(‘repeat-id’), this
> gave me an error
>
>  
>
> XForms error: A sequence of more than one item is not allowed as the
> first argument of string()
>
>  
>
> Thanks Ryan
>
>  
>
> *Ryan Puddephatt*
>
> Software Engineer
>
> TFX Group - IT UK
>
> 1 Michaelson Square
>
> Livingston
>
> West Lothian
>
> Scotand
>
> EH54 7DP
>
>  
>
> * [hidden email]
>
> ( 01506 407 110
>
> 7  01506 407 108
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* Ryan Puddephatt [mailto:[hidden email]]
> *Sent:* 29 June 2006 20:25
> *To:* [hidden email]
> *Subject:* [ops-users] xxforms:repeat-current problems
>
>  
>
> Hi all,
>
>             I’m having a problem using xxforms:repeat-current, it
> doesn’t seem to return anything, and in the attached example it gives me
> an error, any ideas why?
>
>  
>
> Ryan
>
>  
>
> *Ryan Puddephatt*
>
> Software Engineer
>
> TFX Group - IT UK
>
> 1 Michaelson Square
>
> Livingston
>
> West Lothian
>
> Scotand
>
> EH54 7DP
>
>  
>
> * [hidden email]
>
> ( 01506 407 110
>
> 7  01506 407 108
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:repeat-current problems

Erik Bruchez
Administrator
In reply to this post by Ryan Puddephatt
Ryan,

It's hard to tell without more information. setvalue should not try to
do a conversion to double so I suspect there is something else, like
xforms:insert?

-Erik

Ryan Puddephatt wrote:

> Erik,
> Ok that works for the example I gave you, but I'm trying to use it
> within a xforms:dispatch/@if and xforms:setvalue/@ref (within a custom
> event) and it doesn't return anything I keep getting the following
>
> XForms error: Cannot convert string "" to a double
>
> Any ideas why?
>
> Thanks Ryan
>
> Ryan Puddephatt
> Software Engineer
> TFX Group - IT UK
> 1 Michaelson Square
> Livingston
> West Lothian
> Scotand
> EH54 7DP
>  
> * [hidden email]
> ( 01506 407 110
> 7  01506 407 108
>  
>
>> -----Original Message-----
>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>> Sent: 30 June 2006 10:57
>> To: [hidden email]
>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>
>> Ryan,
>>
>> That's because you wrote "current-repeat" instead of "repeat-current".
>> Change that and it works like a charm ;-)
>>
>> -Erik
>>
>> Ryan Puddephatt wrote:
>>> Hi all,
>>>
>>>             I'm having a problem using xxforms:repeat-current, it
>>> doesn't seem to return anything, and in the attached example it gives me
>>> an error, any ideas why?
>>>
>>>
>>>
>>> Ryan
>>>
>>>
>>>
>>> *Ryan Puddephatt*
>>>
>>> Software Engineer
>>>
>>> TFX Group - IT UK
>>>
>>> 1 Michaelson Square
>>>
>>> Livingston
>>>
>>> West Lothian
>>>
>>> Scotand
>>>
>>> EH54 7DP
>>>
>>>
>>>
>>> * [hidden email]
>>>
>>> ( 01506 407 110
>>>
>>> 7  01506 407 108
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> Group Criteria Selection 1 Selected:
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> --
>>> 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
>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>
>> --
>> Orbeon - XForms Everywhere:
>> http://www.orbeon.com/blog/
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: xxforms:repeat-current problems

Ryan Puddephatt
Erik,
        I've tried using context but it doesn't work, or I'm not using it
right, attached is the page I'm using, it's a bit bulky, but I don't really
think I can reduce it

Thanks

Ryan

Ryan Puddephatt
Software Engineer
TFX Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

>-----Original Message-----
>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>Sent: 30 June 2006 12:27
>To: [hidden email]
>Subject: Re: [ops-users] xxforms:repeat-current problems
>
>Ryan,
>
>It's hard to tell without more information. setvalue should not try to
>do a conversion to double so I suspect there is something else, like
>xforms:insert?
>
>-Erik
>
>Ryan Puddephatt wrote:
>> Erik,
>> Ok that works for the example I gave you, but I'm trying to use it
>> within a xforms:dispatch/@if and xforms:setvalue/@ref (within a custom
>> event) and it doesn't return anything I keep getting the following
>>
>> XForms error: Cannot convert string "" to a double
>>
>> Any ideas why?
>>
>> Thanks Ryan
>>
>> Ryan Puddephatt
>> Software Engineer
>> TFX Group - IT UK
>> 1 Michaelson Square
>> Livingston
>> West Lothian
>> Scotand
>> EH54 7DP
>>
>> * [hidden email]
>> ( 01506 407 110
>> 7  01506 407 108
>>
>>
>>> -----Original Message-----
>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>>> Sent: 30 June 2006 10:57
>>> To: [hidden email]
>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>
>>> Ryan,
>>>
>>> That's because you wrote "current-repeat" instead of "repeat-current".
>>> Change that and it works like a charm ;-)
>>>
>>> -Erik
>>>
>>> Ryan Puddephatt wrote:
>>>> Hi all,
>>>>
>>>>             I'm having a problem using xxforms:repeat-current, it
>>>> doesn't seem to return anything, and in the attached example it gives
>me
>>>> an error, any ideas why?
>>>>
>>>>
>>>>
>>>> Ryan
>>>>
>>>>
>>>>
>>>> *Ryan Puddephatt*
>>>>
>>>> Software Engineer
>>>>
>>>> TFX Group - IT UK
>>>>
>>>> 1 Michaelson Square
>>>>
>>>> Livingston
>>>>
>>>> West Lothian
>>>>
>>>> Scotand
>>>>
>>>> EH54 7DP
>>>>
>>>>
>>>>
>>>> * [hidden email]
>>>>
>>>> ( 01506 407 110
>>>>
>>>> 7  01506 407 108
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----------------------------------------------------------------------
>-
>>>>
>>>> Group Criteria Selection 1 Selected:
>>>>
>>>>
>>>> -----------------------------------------------------------------------
>-
>>>>
>>>>
>>>> --
>>>> 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
>>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>>
>>> --
>>> Orbeon - XForms Everywhere:
>>> http://www.orbeon.com/blog/
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>--
>Orbeon - XForms Everywhere:
>http://www.orbeon.com/blog/


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

view.xhtml (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:repeat-current problems

Erik Bruchez
Administrator
Ryan,

This appears to be due to a tricky scenario: while responding to
xforms-value-changed, you actually change other values in the instance
that cause the current evaluation context for the action to change. To
fix this, we actually need to fix this bug:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305404&group_id=168&atid=350207

In the meanwhile, what about a slight change in strategy: upon receiving
the event, store, the value of
xxforms:repeat-current('group-repeat')/@id into a temporary instance.
Then use the content of that temporary instance to perform all the other
operations, instead of using xxforms:repeat-current('group-repeat')/@id
again.

-Erik

Ryan Puddephatt wrote:

> Erik,
> I've tried using context but it doesn't work, or I'm not using it
> right, attached is the page I'm using, it's a bit bulky, but I don't really
> think I can reduce it
>
> Thanks
>
> Ryan
>
> Ryan Puddephatt
> Software Engineer
> TFX Group - IT UK
> 1 Michaelson Square
> Livingston
> West Lothian
> Scotand
> EH54 7DP
>  
> * [hidden email]
> ( 01506 407 110
> 7  01506 407 108
>  
>> -----Original Message-----
>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>> Sent: 30 June 2006 12:27
>> To: [hidden email]
>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>
>> Ryan,
>>
>> It's hard to tell without more information. setvalue should not try to
>> do a conversion to double so I suspect there is something else, like
>> xforms:insert?
>>
>> -Erik
>>
>> Ryan Puddephatt wrote:
>>> Erik,
>>> Ok that works for the example I gave you, but I'm trying to use it
>>> within a xforms:dispatch/@if and xforms:setvalue/@ref (within a custom
>>> event) and it doesn't return anything I keep getting the following
>>>
>>> XForms error: Cannot convert string "" to a double
>>>
>>> Any ideas why?
>>>
>>> Thanks Ryan
>>>
>>> Ryan Puddephatt
>>> Software Engineer
>>> TFX Group - IT UK
>>> 1 Michaelson Square
>>> Livingston
>>> West Lothian
>>> Scotand
>>> EH54 7DP
>>>
>>> * [hidden email]
>>> ( 01506 407 110
>>> 7  01506 407 108
>>>
>>>
>>>> -----Original Message-----
>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>>>> Sent: 30 June 2006 10:57
>>>> To: [hidden email]
>>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>>
>>>> Ryan,
>>>>
>>>> That's because you wrote "current-repeat" instead of "repeat-current".
>>>> Change that and it works like a charm ;-)
>>>>
>>>> -Erik
>>>>
>>>> Ryan Puddephatt wrote:
>>>>> Hi all,
>>>>>
>>>>>             I'm having a problem using xxforms:repeat-current, it
>>>>> doesn't seem to return anything, and in the attached example it gives
>> me
>>>>> an error, any ideas why?
>>>>>
>>>>>
>>>>>
>>>>> Ryan
>>>>>
>>>>>
>>>>>
>>>>> *Ryan Puddephatt*
>>>>>
>>>>> Software Engineer
>>>>>
>>>>> TFX Group - IT UK
>>>>>
>>>>> 1 Michaelson Square
>>>>>
>>>>> Livingston
>>>>>
>>>>> West Lothian
>>>>>
>>>>> Scotand
>>>>>
>>>>> EH54 7DP
>>>>>
>>>>>
>>>>>
>>>>> * [hidden email]
>>>>>
>>>>> ( 01506 407 110
>>>>>
>>>>> 7  01506 407 108
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -----------------------------------------------------------------------
>> -
>>>>> Group Criteria Selection 1 Selected:
>>>>>
>>>>>
>>>>> -----------------------------------------------------------------------
>> -
>>>>>
>>>>> --
>>>>> 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
>>>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>>> --
>>>> Orbeon - XForms Everywhere:
>>>> http://www.orbeon.com/blog/
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> --
>>> 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
>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>
>> --
>> Orbeon - XForms Everywhere:
>> http://www.orbeon.com/blog/
>
>
> ------------------------------------------------------------------------
>
> Group Criteria Selection Group Criteria Selection Submit Grouping Curr:
> Count: Select a Group
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: xxforms:repeat-current problems

Ryan Puddephatt
Erik,
        This is now fixed, but I'm I need the inserted documents to appear
last in the sequence, currently they always appear first. I know this was a
problem last week, but has it been fixed since?

Thanks

Ryan

Ryan Puddephatt
Software Engineer
TFX Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

>-----Original Message-----
>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>Sent: 30 June 2006 18:57
>To: [hidden email]
>Subject: Re: [ops-users] xxforms:repeat-current problems
>
>Ryan,
>
>This appears to be due to a tricky scenario: while responding to
>xforms-value-changed, you actually change other values in the instance
>that cause the current evaluation context for the action to change. To
>fix this, we actually need to fix this bug:
>
>http://forge.objectweb.org/tracker/index.php?func=detail&aid=305404&group_i
>d=168&atid=350207
>
>In the meanwhile, what about a slight change in strategy: upon receiving
>the event, store, the value of
>xxforms:repeat-current('group-repeat')/@id into a temporary instance.
>Then use the content of that temporary instance to perform all the other
>operations, instead of using xxforms:repeat-current('group-repeat')/@id
>again.
>
>-Erik
>
>Ryan Puddephatt wrote:
>> Erik,
>> I've tried using context but it doesn't work, or I'm not using it
>> right, attached is the page I'm using, it's a bit bulky, but I don't
>really
>> think I can reduce it
>>
>> Thanks
>>
>> Ryan
>>
>> Ryan Puddephatt
>> Software Engineer
>> TFX Group - IT UK
>> 1 Michaelson Square
>> Livingston
>> West Lothian
>> Scotand
>> EH54 7DP
>>
>> * [hidden email]
>> ( 01506 407 110
>> 7  01506 407 108
>>
>>> -----Original Message-----
>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>>> Sent: 30 June 2006 12:27
>>> To: [hidden email]
>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>
>>> Ryan,
>>>
>>> It's hard to tell without more information. setvalue should not try to
>>> do a conversion to double so I suspect there is something else, like
>>> xforms:insert?
>>>
>>> -Erik
>>>
>>> Ryan Puddephatt wrote:
>>>> Erik,
>>>> Ok that works for the example I gave you, but I'm trying to use it
>>>> within a xforms:dispatch/@if and xforms:setvalue/@ref (within a custom
>>>> event) and it doesn't return anything I keep getting the following
>>>>
>>>> XForms error: Cannot convert string "" to a double
>>>>
>>>> Any ideas why?
>>>>
>>>> Thanks Ryan
>>>>
>>>> Ryan Puddephatt
>>>> Software Engineer
>>>> TFX Group - IT UK
>>>> 1 Michaelson Square
>>>> Livingston
>>>> West Lothian
>>>> Scotand
>>>> EH54 7DP
>>>>
>>>> * [hidden email]
>>>> ( 01506 407 110
>>>> 7  01506 407 108
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
>Bruchez
>>>>> Sent: 30 June 2006 10:57
>>>>> To: [hidden email]
>>>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>>>
>>>>> Ryan,
>>>>>
>>>>> That's because you wrote "current-repeat" instead of "repeat-current".
>>>>> Change that and it works like a charm ;-)
>>>>>
>>>>> -Erik
>>>>>
>>>>> Ryan Puddephatt wrote:
>>>>>> Hi all,
>>>>>>
>>>>>>             I'm having a problem using xxforms:repeat-current, it
>>>>>> doesn't seem to return anything, and in the attached example it gives
>>> me
>>>>>> an error, any ideas why?
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ryan
>>>>>>
>>>>>>
>>>>>>
>>>>>> *Ryan Puddephatt*
>>>>>>
>>>>>> Software Engineer
>>>>>>
>>>>>> TFX Group - IT UK
>>>>>>
>>>>>> 1 Michaelson Square
>>>>>>
>>>>>> Livingston
>>>>>>
>>>>>> West Lothian
>>>>>>
>>>>>> Scotand
>>>>>>
>>>>>> EH54 7DP
>>>>>>
>>>>>>
>>>>>>
>>>>>> * [hidden email]
>>>>>>
>>>>>> ( 01506 407 110
>>>>>>
>>>>>> 7  01506 407 108
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>--
>>> -
>>>>>> Group Criteria Selection 1 Selected:
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>--
>>> -
>>>>>>
>>>>>> --
>>>>>> You receive this message as a subscriber of the ops-
>[hidden email]
>>>>> mailing list.
>>>>>> To unsubscribe: mailto:[hidden email]
>>>>>> For general help: mailto:[hidden email]?subject=help
>>>>>> ObjectWeb mailing lists service home page:
>http://www.objectweb.org/wws
>>>>> --
>>>>> Orbeon - XForms Everywhere:
>>>>> http://www.orbeon.com/blog/
>>>>
>>>>
>>>>
>>>> -----------------------------------------------------------------------
>-
>>>>
>>>>
>>>> --
>>>> 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
>>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>>
>>> --
>>> Orbeon - XForms Everywhere:
>>> http://www.orbeon.com/blog/
>>
>>
>> ------------------------------------------------------------------------
>>
>> Group Criteria Selection Group Criteria Selection Submit Grouping Curr:
>> Count: Select a Group
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>--
>Orbeon - XForms Everywhere:
>http://www.orbeon.com/blog/




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:repeat-current problems

Erik Bruchez
Administrator
Yes :-)

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305569&group_id=168&atid=350207

-Erik

Ryan Puddephatt wrote:

> Erik,
> This is now fixed, but I'm I need the inserted documents to appear
> last in the sequence, currently they always appear first. I know this was a
> problem last week, but has it been fixed since?
>
> Thanks
>
> Ryan
>
> Ryan Puddephatt
> Software Engineer
> TFX Group - IT UK
> 1 Michaelson Square
> Livingston
> West Lothian
> Scotand
> EH54 7DP
>  
> * [hidden email]
> ( 01506 407 110
> 7  01506 407 108
>  
>
>> -----Original Message-----
>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>> Sent: 30 June 2006 18:57
>> To: [hidden email]
>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>
>> Ryan,
>>
>> This appears to be due to a tricky scenario: while responding to
>> xforms-value-changed, you actually change other values in the instance
>> that cause the current evaluation context for the action to change. To
>> fix this, we actually need to fix this bug:
>>
>> http://forge.objectweb.org/tracker/index.php?func=detail&aid=305404&group_i
>> d=168&atid=350207
>>
>> In the meanwhile, what about a slight change in strategy: upon receiving
>> the event, store, the value of
>> xxforms:repeat-current('group-repeat')/@id into a temporary instance.
>> Then use the content of that temporary instance to perform all the other
>> operations, instead of using xxforms:repeat-current('group-repeat')/@id
>> again.
>>
>> -Erik
>>
>> Ryan Puddephatt wrote:
>>> Erik,
>>> I've tried using context but it doesn't work, or I'm not using it
>>> right, attached is the page I'm using, it's a bit bulky, but I don't
>> really
>>> think I can reduce it
>>>
>>> Thanks
>>>
>>> Ryan
>>>
>>> Ryan Puddephatt
>>> Software Engineer
>>> TFX Group - IT UK
>>> 1 Michaelson Square
>>> Livingston
>>> West Lothian
>>> Scotand
>>> EH54 7DP
>>>
>>> * [hidden email]
>>> ( 01506 407 110
>>> 7  01506 407 108
>>>
>>>> -----Original Message-----
>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>>>> Sent: 30 June 2006 12:27
>>>> To: [hidden email]
>>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>>
>>>> Ryan,
>>>>
>>>> It's hard to tell without more information. setvalue should not try to
>>>> do a conversion to double so I suspect there is something else, like
>>>> xforms:insert?
>>>>
>>>> -Erik
>>>>
>>>> Ryan Puddephatt wrote:
>>>>> Erik,
>>>>> Ok that works for the example I gave you, but I'm trying to use it
>>>>> within a xforms:dispatch/@if and xforms:setvalue/@ref (within a custom
>>>>> event) and it doesn't return anything I keep getting the following
>>>>>
>>>>> XForms error: Cannot convert string "" to a double
>>>>>
>>>>> Any ideas why?
>>>>>
>>>>> Thanks Ryan
>>>>>
>>>>> Ryan Puddephatt
>>>>> Software Engineer
>>>>> TFX Group - IT UK
>>>>> 1 Michaelson Square
>>>>> Livingston
>>>>> West Lothian
>>>>> Scotand
>>>>> EH54 7DP
>>>>>
>>>>> * [hidden email]
>>>>> ( 01506 407 110
>>>>> 7  01506 407 108
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
>> Bruchez
>>>>>> Sent: 30 June 2006 10:57
>>>>>> To: [hidden email]
>>>>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>>>>
>>>>>> Ryan,
>>>>>>
>>>>>> That's because you wrote "current-repeat" instead of "repeat-current".
>>>>>> Change that and it works like a charm ;-)
>>>>>>
>>>>>> -Erik
>>>>>>
>>>>>> Ryan Puddephatt wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>>             I'm having a problem using xxforms:repeat-current, it
>>>>>>> doesn't seem to return anything, and in the attached example it gives
>>>> me
>>>>>>> an error, any ideas why?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Ryan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *Ryan Puddephatt*
>>>>>>>
>>>>>>> Software Engineer
>>>>>>>
>>>>>>> TFX Group - IT UK
>>>>>>>
>>>>>>> 1 Michaelson Square
>>>>>>>
>>>>>>> Livingston
>>>>>>>
>>>>>>> West Lothian
>>>>>>>
>>>>>>> Scotand
>>>>>>>
>>>>>>> EH54 7DP
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> * [hidden email]
>>>>>>>
>>>>>>> ( 01506 407 110
>>>>>>>
>>>>>>> 7  01506 407 108
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>> --
>>>> -
>>>>>>> Group Criteria Selection 1 Selected:
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>> --
>>>> -
>>>>>>> --
>>>>>>> You receive this message as a subscriber of the ops-
>> [hidden email]
>>>>>> mailing list.
>>>>>>> To unsubscribe: mailto:[hidden email]
>>>>>>> For general help: mailto:[hidden email]?subject=help
>>>>>>> ObjectWeb mailing lists service home page:
>> http://www.objectweb.org/wws
>>>>>> --
>>>>>> Orbeon - XForms Everywhere:
>>>>>> http://www.orbeon.com/blog/
>>>>>
>>>>>
>>>>> -----------------------------------------------------------------------
>> -
>>>>>
>>>>> --
>>>>> 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
>>>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>>> --
>>>> Orbeon - XForms Everywhere:
>>>> http://www.orbeon.com/blog/
>>>
>>> ------------------------------------------------------------------------
>>>
>>> Group Criteria Selection Group Criteria Selection Submit Grouping Curr:
>>> Count: Select a Group
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> --
>>> 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
>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>
>> --
>> Orbeon - XForms Everywhere:
>> http://www.orbeon.com/blog/
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: xxforms:repeat-current problems

Ryan Puddephatt
Thanks Erik,
        Upgrading worked

Ryan

Ryan Puddephatt
Software Engineer
TFX Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

>-----Original Message-----
>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>Sent: 30 June 2006 23:13
>To: [hidden email]
>Subject: Re: [ops-users] xxforms:repeat-current problems
>
>Yes :-)
>
>http://forge.objectweb.org/tracker/index.php?func=detail&aid=305569&group_i
>d=168&atid=350207
>
>-Erik
>
>Ryan Puddephatt wrote:
>> Erik,
>> This is now fixed, but I'm I need the inserted documents to appear
>> last in the sequence, currently they always appear first. I know this was
>a
>> problem last week, but has it been fixed since?
>>
>> Thanks
>>
>> Ryan
>>
>> Ryan Puddephatt
>> Software Engineer
>> TFX Group - IT UK
>> 1 Michaelson Square
>> Livingston
>> West Lothian
>> Scotand
>> EH54 7DP
>>
>> * [hidden email]
>> ( 01506 407 110
>> 7  01506 407 108
>>
>>
>>> -----Original Message-----
>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
>>> Sent: 30 June 2006 18:57
>>> To: [hidden email]
>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>
>>> Ryan,
>>>
>>> This appears to be due to a tricky scenario: while responding to
>>> xforms-value-changed, you actually change other values in the instance
>>> that cause the current evaluation context for the action to change. To
>>> fix this, we actually need to fix this bug:
>>>
>>>
>http://forge.objectweb.org/tracker/index.php?func=detail&aid=305404&group_i
>>> d=168&atid=350207
>>>
>>> In the meanwhile, what about a slight change in strategy: upon receiving
>>> the event, store, the value of
>>> xxforms:repeat-current('group-repeat')/@id into a temporary instance.
>>> Then use the content of that temporary instance to perform all the other
>>> operations, instead of using xxforms:repeat-current('group-repeat')/@id
>>> again.
>>>
>>> -Erik
>>>
>>> Ryan Puddephatt wrote:
>>>> Erik,
>>>> I've tried using context but it doesn't work, or I'm not using it
>>>> right, attached is the page I'm using, it's a bit bulky, but I don't
>>> really
>>>> think I can reduce it
>>>>
>>>> Thanks
>>>>
>>>> Ryan
>>>>
>>>> Ryan Puddephatt
>>>> Software Engineer
>>>> TFX Group - IT UK
>>>> 1 Michaelson Square
>>>> Livingston
>>>> West Lothian
>>>> Scotand
>>>> EH54 7DP
>>>>
>>>> * [hidden email]
>>>> ( 01506 407 110
>>>> 7  01506 407 108
>>>>
>>>>> -----Original Message-----
>>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
>Bruchez
>>>>> Sent: 30 June 2006 12:27
>>>>> To: [hidden email]
>>>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>>>
>>>>> Ryan,
>>>>>
>>>>> It's hard to tell without more information. setvalue should not try to
>>>>> do a conversion to double so I suspect there is something else, like
>>>>> xforms:insert?
>>>>>
>>>>> -Erik
>>>>>
>>>>> Ryan Puddephatt wrote:
>>>>>> Erik,
>>>>>> Ok that works for the example I gave you, but I'm trying to use
>it
>>>>>> within a xforms:dispatch/@if and xforms:setvalue/@ref (within a
>custom
>>>>>> event) and it doesn't return anything I keep getting the following
>>>>>>
>>>>>> XForms error: Cannot convert string "" to a double
>>>>>>
>>>>>> Any ideas why?
>>>>>>
>>>>>> Thanks Ryan
>>>>>>
>>>>>> Ryan Puddephatt
>>>>>> Software Engineer
>>>>>> TFX Group - IT UK
>>>>>> 1 Michaelson Square
>>>>>> Livingston
>>>>>> West Lothian
>>>>>> Scotand
>>>>>> EH54 7DP
>>>>>>
>>>>>> * [hidden email]
>>>>>> ( 01506 407 110
>>>>>> 7  01506 407 108
>>>>>>
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
>>> Bruchez
>>>>>>> Sent: 30 June 2006 10:57
>>>>>>> To: [hidden email]
>>>>>>> Subject: Re: [ops-users] xxforms:repeat-current problems
>>>>>>>
>>>>>>> Ryan,
>>>>>>>
>>>>>>> That's because you wrote "current-repeat" instead of "repeat-
>current".
>>>>>>> Change that and it works like a charm ;-)
>>>>>>>
>>>>>>> -Erik
>>>>>>>
>>>>>>> Ryan Puddephatt wrote:
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>>             I'm having a problem using xxforms:repeat-current, it
>>>>>>>> doesn't seem to return anything, and in the attached example it
>gives
>>>>> me
>>>>>>>> an error, any ideas why?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Ryan
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *Ryan Puddephatt*
>>>>>>>>
>>>>>>>> Software Engineer
>>>>>>>>
>>>>>>>> TFX Group - IT UK
>>>>>>>>
>>>>>>>> 1 Michaelson Square
>>>>>>>>
>>>>>>>> Livingston
>>>>>>>>
>>>>>>>> West Lothian
>>>>>>>>
>>>>>>>> Scotand
>>>>>>>>
>>>>>>>> EH54 7DP
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> * [hidden email]
>>>>>>>>
>>>>>>>> ( 01506 407 110
>>>>>>>>
>>>>>>>> 7  01506 407 108
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> -------------------------------------------------------------------
>--
>>> --
>>>>> -
>>>>>>>> Group Criteria Selection 1 Selected:
>>>>>>>>
>>>>>>>>
>>>>>>>> -------------------------------------------------------------------
>--
>>> --
>>>>> -
>>>>>>>> --
>>>>>>>> You receive this message as a subscriber of the ops-
>>> [hidden email]
>>>>>>> mailing list.
>>>>>>>> To unsubscribe: mailto:[hidden email]
>>>>>>>> For general help: mailto:[hidden email]?subject=help
>>>>>>>> ObjectWeb mailing lists service home page:
>>> http://www.objectweb.org/wws
>>>>>>> --
>>>>>>> Orbeon - XForms Everywhere:
>>>>>>> http://www.orbeon.com/blog/
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>--
>>> -
>>>>>>
>>>>>> --
>>>>>> You receive this message as a subscriber of the ops-
>[hidden email]
>>>>> mailing list.
>>>>>> To unsubscribe: mailto:[hidden email]
>>>>>> For general help: mailto:[hidden email]?subject=help
>>>>>> ObjectWeb mailing lists service home page:
>http://www.objectweb.org/wws
>>>>> --
>>>>> Orbeon - XForms Everywhere:
>>>>> http://www.orbeon.com/blog/
>>>>
>>>> -----------------------------------------------------------------------
>-
>>>>
>>>> Group Criteria Selection Group Criteria Selection Submit Grouping Curr:
>>>> Count: Select a Group
>>>>
>>>>
>>>> -----------------------------------------------------------------------
>-
>>>>
>>>>
>>>> --
>>>> 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
>>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>>
>>> --
>>> Orbeon - XForms Everywhere:
>>> http://www.orbeon.com/blog/
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>--
>Orbeon - XForms Everywhere:
>http://www.orbeon.com/blog/




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Slowness in Javascript XForms Initialization Code

Larry T. Chen
Hi All,

I'm running into a serious problem with slowness in loading a large
XForms page.
I currently working with a fairly complicated order form comprising of
1860 lines of XForms source.  The forms appears to take a long time to
load, but in fact it's the Javascript initialization that's taking a
long time.

By enabling the debug messages in xforms.js, I figured out that it's
taking 5.5 seconds to run the function xformsInitializeControlsUnder()
on a dual-core 3.0 Ghz machine!  This is really not acceptable because
in Firefox you get a warning message saying that the Javascript is
taking too long to run and asks if you want to stop the Javascript.  
(Although this timeout value is changable in Firefox, we don't want to
tell users to have to change that!)  In IE although there's no warning
message, but the page is unresponsive for the time it takes to do the
Javascript initialization, which really makes the system feel really slow.

Good news is ... I've tracked down the majority of the slowness to the
call to the function xformsUpdateStyle() which is the last thing that
xformsInitializeControlsUnder() does in its element initialization
loop.  By simply commenting out xformsUpdateStyle(), I get the
initialization time to
under 1.5 seconds, that's almost 75% reduction. Yet the form still seems
to work properly with that line commented out.  So my question is, what
is xformsUpdateStyle() doing and it is doing anything essential?  could
I live without it?  Or could the function be optimized somehow?  Seems
rather strange that 75% of the initialization time is spent on
initializing style.  Of course I'm not know if any essential
functionality is involved in xformsUpdateStyle().

I am considering breaking up the form into multiple pages, but I'd
rather not if I can get the performance to be acceptable (1.5 seconds
load would be acceptable as opposed to 5.5 seconds) since breaking up
the form introduces a lot of complexity in merging parts of the XML
together, not to mention that I have many controls whose behavior depend
on the state of controls in the form.  Even though the form has a lot in
it, it does not appear overly complex to the user because I make use of
tab controls and collapsible group boxes.

Thanks in advance for your help.

Larry T. Chen
Software Engineer
Intelenet Communications, Inc.



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Slowness in Javascript XForms Initialization Code

Larry T. Chen
Hi All,

I've tracked down the slowness even further.  It appears that the call to function hasClass() in the YAHOO dom.js has a lot to do with it.  It's using a regular expression to test if the class name exists for a given element!  What overkill!  I replaced the body of the hasClass() function with a quick test

return !el || !el.hasAttribute('class') ? false : String(el.getAttribute('class')).indexOf(className,0) >= 0;

and that gets the initialization time for my complex order form down to 3.0 seconds (down from 5.5 seconds)  all because of one function!  This function gets called a lot in xformsUpdateStyle(), hence the dramatic improvement.   3.0 seconds is still a little slow ... any help on further optimization would be greatly appreciated.

Larry T. Chen
Software Engineer
Intelenet Communications, Inc.


Larry T. Chen wrote:
Hi All,

I'm running into a serious problem with slowness in loading a large XForms page. I currently working with a fairly complicated order form comprising of 1860 lines of XForms source.  The forms appears to take a long time to load, but in fact it's the Javascript initialization that's taking a long time.

By enabling the debug messages in xforms.js, I figured out that it's taking 5.5 seconds to run the function xformsInitializeControlsUnder() on a dual-core 3.0 Ghz machine!  This is really not acceptable because in Firefox you get a warning message saying that the Javascript is taking too long to run and asks if you want to stop the Javascript.  (Although this timeout value is changable in Firefox, we don't want to tell users to have to change that!)  In IE although there's no warning message, but the page is unresponsive for the time it takes to do the Javascript initialization, which really makes the system feel really slow.

Good news is ... I've tracked down the majority of the slowness to the call to the function xformsUpdateStyle() which is the last thing that
xformsInitializeControlsUnder() does in its element initialization loop.  By simply commenting out xformsUpdateStyle(), I get the initialization time to
under 1.5 seconds, that's almost 75% reduction. Yet the form still seems to work properly with that line commented out.  So my question is, what is xformsUpdateStyle() doing and it is doing anything essential?  could I live without it?  Or could the function be optimized somehow?  Seems rather strange that 75% of the initialization time is spent on initializing style.  Of course I'm not know if any essential functionality is involved in xformsUpdateStyle().

I am considering breaking up the form into multiple pages, but I'd rather not if I can get the performance to be acceptable (1.5 seconds load would be acceptable as opposed to 5.5 seconds) since breaking up the form introduces a lot of complexity in merging parts of the XML together, not to mention that I have many controls whose behavior depend on the state of controls in the form.  Even though the form has a lot in it, it does not appear overly complex to the user because I make use of tab controls and collapsible group boxes.

Thanks in advance for your help.

Larry T. Chen
Software Engineer
Intelenet Communications, Inc.


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



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Slowness in Javascript XForms Initialization Code

Larry T. Chen
Oops, just realized IE doesn't have the hasAttribute, getAttribute functions, and if we had two class names where one was a substring of the other, then using substring to check for class existence would not work properly.  We'll have to split the classnames and run through a loop to check for the classname (since IE doesn't have the Array.indexOf function):

hasClass: function(el, className) {

    if (!el || !el.className) return false;

        var classes = String(el.className).split(' ');
        for (var i=0; i<classes.length; i++)
           if (classes[i] == className) return true;
        return false;
}
This gets it down to 4.0 seconds from 5.5 seconds in Firefox, (and from 12.3 seconds to 8.9 seconds in IE) ... but still too slow. 

Anybody have a better idea?


Larry T. Chen
Software Engineer
Intelenet Communications, Inc.

Larry T. Chen wrote:
Hi All,

I've tracked down the slowness even further.  It appears that the call to function hasClass() in the YAHOO dom.js has a lot to do with it.  It's using a regular expression to test if the class name exists for a given element!  What overkill!  I replaced the body of the hasClass() function with a quick test

return !el || !el.hasAttribute('class') ? false : String(el.getAttribute('class')).indexOf(className,0) >= 0;

and that gets the initialization time for my complex order form down to 3.0 seconds (down from 5.5 seconds)  all because of one function!  This function gets called a lot in xformsUpdateStyle(), hence the dramatic improvement.   3.0 seconds is still a little slow ... any help on further optimization would be greatly appreciated.

Larry T. Chen
Software Engineer
Intelenet Communications, Inc.


Larry T. Chen wrote:
Hi All,

I'm running into a serious problem with slowness in loading a large XForms page. I currently working with a fairly complicated order form comprising of 1860 lines of XForms source.  The forms appears to take a long time to load, but in fact it's the Javascript initialization that's taking a long time.

By enabling the debug messages in xforms.js, I figured out that it's taking 5.5 seconds to run the function xformsInitializeControlsUnder() on a dual-core 3.0 Ghz machine!  This is really not acceptable because in Firefox you get a warning message saying that the Javascript is taking too long to run and asks if you want to stop the Javascript.  (Although this timeout value is changable in Firefox, we don't want to tell users to have to change that!)  In IE although there's no warning message, but the page is unresponsive for the time it takes to do the Javascript initialization, which really makes the system feel really slow.

Good news is ... I've tracked down the majority of the slowness to the call to the function xformsUpdateStyle() which is the last thing that
xformsInitializeControlsUnder() does in its element initialization loop.  By simply commenting out xformsUpdateStyle(), I get the initialization time to
under 1.5 seconds, that's almost 75% reduction. Yet the form still seems to work properly with that line commented out.  So my question is, what is xformsUpdateStyle() doing and it is doing anything essential?  could I live without it?  Or could the function be optimized somehow?  Seems rather strange that 75% of the initialization time is spent on initializing style.  Of course I'm not know if any essential functionality is involved in xformsUpdateStyle().

I am considering breaking up the form into multiple pages, but I'd rather not if I can get the performance to be acceptable (1.5 seconds load would be acceptable as opposed to 5.5 seconds) since breaking up the form introduces a lot of complexity in merging parts of the XML together, not to mention that I have many controls whose behavior depend on the state of controls in the form.  Even though the form has a lot in it, it does not appear overly complex to the user because I make use of tab controls and collapsible group boxes.

Thanks in advance for your help.

Larry T. Chen
Software Engineer
Intelenet Communications, Inc.


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


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



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Slowness in Javascript XForms Initialization Code

Erik Bruchez
Administrator
Larry,

It looks like you have made quite some progress investigating this! I
will let Alex look at this in more details. In the meanwhile I have
entered a priority 7 bug to track this:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305636&group_id=168&atid=350207

I am not sure why we do so much work in xformsUpdateStyle(), but there
must be ways to improve this a lot!

-Erik

Larry T. Chen wrote:

> Oops, just realized IE doesn't have the hasAttribute, getAttribute
> functions, and if we had two class names where one was a substring of
> the other, then using substring to check for class existence would not
> work properly.  We'll have to split the classnames and run through a
> loop to check for the classname (since IE doesn't have the Array.indexOf
> function):
>
> hasClass: function(el, className) {
>
>     if (!el || !el.className) return false;
>
>         var classes = String(el.className).split(' ');
>         for (var i=0; i<classes.length; i++)
>            if (classes[i] == className) return true;
>         return false;
> }
> This gets it down to 4.0 seconds from 5.5 seconds in Firefox, (and from
> 12.3 seconds to 8.9 seconds in IE) ... but still too slow.
>
> Anybody have a better idea?
>
>
> Larry T. Chen
> Software Engineer
> Intelenet Communications, Inc.
>
> Larry T. Chen wrote:
>> Hi All,
>>
>> I've tracked down the slowness even further.  It appears that the call
>> to function hasClass() in the YAHOO dom.js has a lot to do with it.  
>> It's using a regular expression to test if the class name exists for a
>> given element!  What overkill!  I replaced the body of the hasClass()
>> function with a quick test
>>
>> return !el || !el.hasAttribute('class') ? false :
>> String(el.getAttribute('class')).indexOf(className,0) >= 0;
>>
>> and that gets the initialization time for my complex order form down
>> to 3.0 seconds (down from 5.5 seconds)  all because of one function!  
>> This function gets called a lot in xformsUpdateStyle(), hence the
>> dramatic improvement.   3.0 seconds is still a little slow ... any
>> help on further optimization would be greatly appreciated.
>>
>> Larry T. Chen
>> Software Engineer
>> Intelenet Communications, Inc.
>>
>>
>> Larry T. Chen wrote:
>>> Hi All,
>>>
>>> I'm running into a serious problem with slowness in loading a large
>>> XForms page. I currently working with a fairly complicated order form
>>> comprising of 1860 lines of XForms source.  The forms appears to take
>>> a long time to load, but in fact it's the Javascript initialization
>>> that's taking a long time.
>>>
>>> By enabling the debug messages in xforms.js, I figured out that it's
>>> taking 5.5 seconds to run the function
>>> xformsInitializeControlsUnder() on a dual-core 3.0 Ghz machine!  This
>>> is really not acceptable because in Firefox you get a warning message
>>> saying that the Javascript is taking too long to run and asks if you
>>> want to stop the Javascript.  (Although this timeout value is
>>> changable in Firefox, we don't want to tell users to have to change
>>> that!)  In IE although there's no warning message, but the page is
>>> unresponsive for the time it takes to do the Javascript
>>> initialization, which really makes the system feel really slow.
>>>
>>> Good news is ... I've tracked down the majority of the slowness to
>>> the call to the function xformsUpdateStyle() which is the last thing
>>> that
>>> xformsInitializeControlsUnder() does in its element initialization
>>> loop.  By simply commenting out xformsUpdateStyle(), I get the
>>> initialization time to
>>> under 1.5 seconds, that's almost 75% reduction. Yet the form still
>>> seems to work properly with that line commented out.  So my question
>>> is, what is xformsUpdateStyle() doing and it is doing anything
>>> essential?  could I live without it?  Or could the function be
>>> optimized somehow?  Seems rather strange that 75% of the
>>> initialization time is spent on initializing style.  Of course I'm
>>> not know if any essential functionality is involved in
>>> xformsUpdateStyle().
>>>
>>> I am considering breaking up the form into multiple pages, but I'd
>>> rather not if I can get the performance to be acceptable (1.5 seconds
>>> load would be acceptable as opposed to 5.5 seconds) since breaking up
>>> the form introduces a lot of complexity in merging parts of the XML
>>> together, not to mention that I have many controls whose behavior
>>> depend on the state of controls in the form.  Even though the form
>>> has a lot in it, it does not appear overly complex to the user
>>> because I make use of tab controls and collapsible group boxes.
>>>
>>> Thanks in advance for your help.
>>>
>>> Larry T. Chen
>>> Software Engineer
>>> Intelenet Communications, Inc.
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> --
>>> 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
>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>>  
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>  
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Slowness in Javascript XForms Initialization Code

Alessandro  Vernet
Administrator
In reply to this post by Larry T. Chen
On 7/1/06, Larry T. Chen <[hidden email]> wrote:
>  hasClass: function(el, className) {
>  [...]

Hi Larry,

Interestingly, we used to have our own implementation of those
hasClass, addClass, and removeClass methods which was doing what you
suggest. I.e. using split() and then iterating over the returned
array. Since we started to use more of Yahoo's code, I figured we
could use their implementation of those methods, and switched to their
code just a few weeks ago. But apparently their implementation is not
that efficient.

Since we make a more intensive use of those classes than the typical
Ajax application would, I changed our code to use your split() method,
but also to cache the parsed string in a map, so we would parse
className at most once per HTML element, and looking up if an element
has a class is much faster as we can use that map. We also update the
map in addition to the className attribute in addClass and
removeClass.

With those changes, the initialization of the to-do list example is 3
to 4 times faster under Firefox, but "only" 30% faster on IE. If you
get the latest build, the new methods are in ORBEON.util.Dom which is
at the beginning of xforms.js. Those are the first JavaScript methods
that starts following the convention of the Yahoo! JS code; the plan
being to move more code to use the same convention as we go.

If you get a chance to look at the code, please let me know what you
think and of course we are always interested if you see a way in which
we can improve this.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet