Error when using Insert

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

Error when using Insert

ChrisSpeare
xForm using Insert to insert new row into a repeat, looking at the instance it fails although a row does appear, however the links to the Select1s are all wrong.  Get the following as a alert at the top of the screen:

Error while processing response: 'length' is null or not an object 2955

Only does it on this form for some reason.  Nothing in the log to indicate it failed
Reply | Threaded
Open this post in threaded view
|

Re: Error when using Insert

Ryan Puddephatt
Chris,
    A snip of your insert code would be helpful as its not obvious what the problem is

Ryan

Ryan Puddephatt
Software Engineer
 
Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com

"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." - Bill Gates
"If you lie to the compiler, it will get its revenge." - Henry Spencer
"It's hard enough to find an error in your code when you're looking for it; it's even harder when you've assumed your code is error-free." - Steve McConnell
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." - Gerald Weinberg



ChrisSpeare wrote:
xForm using Insert to insert new row into a repeat, looking at the instance
it fails although a row does appear, however the links to the Select1s are
all wrong.  Get the following as a alert at the top of the screen:

Error while processing response: 'length' is null or not an object 2955

Only does it on this form for some reason.  Nothing in the log to indicate
it failed
  

-- 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: Error when using Insert

ChrisSpeare
The following is the trigger I use:

<xforms:trigger ref="instance('submit')/hideadd">
  <xforms:label>Add Item</xforms:label>
  <xforms:insert ev:event="DOMActivate" at="index('repeat_IncludeTradeItem_model_PurchaseOrder')" position="after" nodeset="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem" origin="instance('IncludedTradeItem')" />

  <xforms:setvalue ev:event="DOMActivate" ref="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[count(//userram:IncludedTradeItem)]/userram:SequenceNumeric" value="index('repeat_IncludeTradeItem_model_PurchaseOrder')" />
   
  <xforms:setvalue ev:event="DOMActivate" ref="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[count(//userram:IncludedTradeItem)]/userram:ChargeAmount/@currencyID" value="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:PayableAmount/@currencyID" />
  <xforms:setvalue ev:event="DOMActivate" ref="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[count(//userram:IncludedTradeItem)]/userram:UnitPrice/userram:ChargeAmount/@currencyID" value="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:PayableAmount/@currencyID" />
   
 
</xforms:trigger>



Ryan Puddephatt wrote
Chris,
    A snip of your insert code would be helpful as its not obvious what
the problem is

Ryan

Ryan Puddephatt
Software Engineer
 
Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> rpuddephatt@teleflex.com <mailto:rpuddephatt@teleflex.com>
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com <http://www.teleflex.com>

"Measuring programming progress by lines of code is like measuring
aircraft building progress by weight." - /Bill Gates/
"If you lie to the compiler, it will get its revenge." - /Henry Spencer/
"It's hard enough to find an error in your code when you're looking for
it; it's even harder when you've assumed your code is error-free." -
/Steve McConnell/
"If builders built buildings the way programmers wrote programs, then
the first woodpecker that came along would destroy civilization." -
/Gerald Weinberg/



ChrisSpeare wrote:
> xForm using Insert to insert new row into a repeat, looking at the instance
> it fails although a row does appear, however the links to the Select1s are
> all wrong.  Get the following as a alert at the top of the screen:
>
> Error while processing response: 'length' is null or not an object 2955
>
> Only does it on this form for some reason.  Nothing in the log to indicate
> it failed
>  
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the ops-users@objectweb.org mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  


--
You receive this message as a subscriber of the ops-users@objectweb.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Error when using Insert

ChrisSpeare
In reply to this post by ChrisSpeare
Ok ignore the 2955 - that was a hack of the code I made earlier to report the line number of the error reporter.  The message is:

Error while processing response: 'length' is null or not an object

or

Error while processing response: Unterminated string constant

It seems to be when I have a select1 in the repeat referencing an instance of data that is fetched from eXist, the instance contains:


<exist:result exist:hits="2" exist:start="1" exist:count="2" xmlns:exist="http://exist.sourceforge.net/NS/exist">
        <detail>
                <name>kilogram</name>
                <comcode>KGM</comcode>
        </detail>
        <detail>
                <name>pound</name>
                <comcode>LBR</comcode>
        </detail>
</exist:result>

and the select1 code is:

<xforms:select1 ref="userram:UnitPrice/userram:BasisQuantity/@unitCode" model="model_PurchaseOrder">
                                                                                <xforms:action ev:event="xforms-value-changed">
                                                                                        <xforms:setvalue ref="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:ChargeableQuantity/@unitCode"
                                                                                                value = "instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:UnitPrice/userram:BasisQuantity/@unitCode" />
                                                                                </xforms:action>
                                                                                <xforms:itemset model="model_PurchaseOrder" nodeset="instance('UnitsOfMeasureList')/detail">
                                                                                        <xforms:label>
                                                                                                <xforms:output value="if (string-length(name) &gt; 20) then concat(substring(name,0,20),'..') else name"/>
                                                                                        </xforms:label>
                                                                                        <xforms:value ref="comcode"/>
                                                                                </xforms:itemset>
                                                                        </xforms:select1>       

Any reason why this fails, as it only failed on the insert of the repeat.  If the xml is passed straight in it works fine.


ChrisSpeare wrote
xForm using Insert to insert new row into a repeat, looking at the instance it fails although a row does appear, however the links to the Select1s are all wrong.  Get the following as a alert at the top of the screen:

Error while processing response: 'length' is null or not an object 2955

Only does it on this form for some reason.  Nothing in the log to indicate it failed
Reply | Threaded
Open this post in threaded view
|

Re: Error when using Insert

Ryan Puddephatt
Chris,
    If you change the itemset label to @ref="name" rather than the xforms:output does that remove the problem? Just trying to isolate it, and that looks like it could be causing the problem

Ryan

Ryan Puddephatt
Software Engineer
 
Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com

"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." - Bill Gates
"If you lie to the compiler, it will get its revenge." - Henry Spencer
"It's hard enough to find an error in your code when you're looking for it; it's even harder when you've assumed your code is error-free." - Steve McConnell
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." - Gerald Weinberg



ChrisSpeare wrote:
Ok ignore the 2955 - that was a hack of the code I made earlier to report the
line number of the error reporter.  The message is:

Error while processing response: 'length' is null or not an object

or

Error while processing response: Unterminated string constant

It seems to be when I have a select1 in the repeat referencing an instance
of data that is fetched from eXist, the instance contains:


<exist:result exist:hits="2" exist:start="1" exist:count="2"
xmlns:exist="http://exist.sourceforge.net/NS/exist">
	<detail>
		<name>kilogram</name>
		<comcode>KGM</comcode>
	</detail>
	<detail>
		<name>pound</name>
		<comcode>LBR</comcode>
	</detail>
</exist:result>

and the select1 code is:

<xforms:select1 ref="userram:UnitPrice/userram:BasisQuantity/@unitCode"
model="model_PurchaseOrder">
										<xforms:action ev:event="xforms-value-changed">
											<xforms:setvalue
ref="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:ChargeableQuantity/@unitCode"
												value =
"instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:UnitPrice/userram:BasisQuantity/@unitCode"
/>
										</xforms:action>
										<xforms:itemset model="model_PurchaseOrder"
nodeset="instance('UnitsOfMeasureList')/detail">
											<xforms:label>
												<xforms:output value="if (string-length(name) &gt; 20) then
concat(substring(name,0,20),'..') else name"/>
											</xforms:label>
											<xforms:value ref="comcode"/>
										</xforms:itemset>
									</xforms:select1>	

Any reason why this fails, as it only failed on the insert of the repeat. 
If the xml is passed straight in it works fine.



ChrisSpeare wrote:
  
xForm using Insert to insert new row into a repeat, looking at the
instance it fails although a row does appear, however the links to the
Select1s are all wrong.  Get the following as a alert at the top of the
screen:

Error while processing response: 'length' is null or not an object 2955

Only does it on this form for some reason.  Nothing in the log to indicate
it failed

    

  

-- 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: Error when using Insert

ChrisSpeare
Numerous swear remarks were just made!  That sorted it for the moment, I have several lines that use the same code that I will now tweak. Any ideas why that would be giving me issues as it appeared to render ok to the screen?

Ryan Puddephatt wrote
Chris,
    If you change the itemset label to @ref="name" rather than the
xforms:output does that remove the problem? Just trying to isolate it,
and that looks like it could be causing the problem

Ryan

Ryan Puddephatt
Software Engineer
 
Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> rpuddephatt@teleflex.com <mailto:rpuddephatt@teleflex.com>
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com <http://www.teleflex.com>

"Measuring programming progress by lines of code is like measuring
aircraft building progress by weight." - /Bill Gates/
"If you lie to the compiler, it will get its revenge." - /Henry Spencer/
"It's hard enough to find an error in your code when you're looking for
it; it's even harder when you've assumed your code is error-free." -
/Steve McConnell/
"If builders built buildings the way programmers wrote programs, then
the first woodpecker that came along would destroy civilization." -
/Gerald Weinberg/



ChrisSpeare wrote:
> Ok ignore the 2955 - that was a hack of the code I made earlier to report the
> line number of the error reporter.  The message is:
>
> Error while processing response: 'length' is null or not an object
>
> or
>
> Error while processing response: Unterminated string constant
>
> It seems to be when I have a select1 in the repeat referencing an instance
> of data that is fetched from eXist, the instance contains:
>
>
> <exist:result exist:hits="2" exist:start="1" exist:count="2"
> xmlns:exist="http://exist.sourceforge.net/NS/exist">
> <detail>
> <name>kilogram</name>
> <comcode>KGM</comcode>
> </detail>
> <detail>
> <name>pound</name>
> <comcode>LBR</comcode>
> </detail>
> </exist:result>
>
> and the select1 code is:
>
> <xforms:select1 ref="userram:UnitPrice/userram:BasisQuantity/@unitCode"
> model="model_PurchaseOrder">
> <xforms:action ev:event="xforms-value-changed">
> <xforms:setvalue
> ref="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:ChargeableQuantity/@unitCode"
> value =
> "instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:UnitPrice/userram:BasisQuantity/@unitCode"
> />
> </xforms:action>
> <xforms:itemset model="model_PurchaseOrder"
> nodeset="instance('UnitsOfMeasureList')/detail">
> <xforms:label>
> <xforms:output value="if (string-length(name) &gt; 20) then
> concat(substring(name,0,20),'..') else name"/>
> </xforms:label>
> <xforms:value ref="comcode"/>
> </xforms:itemset>
> </xforms:select1>       
>
> Any reason why this fails, as it only failed on the insert of the repeat.
> If the xml is passed straight in it works fine.
>
>
>
> ChrisSpeare wrote:
>  
>> xForm using Insert to insert new row into a repeat, looking at the
>> instance it fails although a row does appear, however the links to the
>> Select1s are all wrong.  Get the following as a alert at the top of the
>> screen:
>>
>> Error while processing response: 'length' is null or not an object 2955
>>
>> Only does it on this form for some reason.  Nothing in the log to indicate
>> it failed
>>
>>    
>
>  
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the ops-users@objectweb.org mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  


--
You receive this message as a subscriber of the ops-users@objectweb.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Error when using Insert

Ryan Puddephatt
Chris,
    My first guess would be that at some point the string-length() function is returning null. I think the best thing you can do is create a version that works in the xforms sandbox (http://www.orbeon.com/ops/xforms-sandbox/) then Alex and Erik can see if its a bug :-)

Ryan

Ryan Puddephatt
Software Engineer
 
Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com

"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." - Bill Gates
"If you lie to the compiler, it will get its revenge." - Henry Spencer
"It's hard enough to find an error in your code when you're looking for it; it's even harder when you've assumed your code is error-free." - Steve McConnell
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." - Gerald Weinberg



ChrisSpeare wrote:
Numerous swear remarks were just made!  That sorted it for the moment, I have
several lines that use the same code that I will now tweak. Any ideas why
that would be giving me issues as it appeared to render ok to the screen?


Ryan Puddephatt wrote:
  
Chris,
    If you change the itemset label to @ref="name" rather than the 
xforms:output does that remove the problem? Just trying to isolate it, 
and that looks like it could be causing the problem

Ryan

Ryan Puddephatt
Software Engineer
 
Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> [hidden email] [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com <http://www.teleflex.com>

"Measuring programming progress by lines of code is like measuring 
aircraft building progress by weight." - /Bill Gates/
"If you lie to the compiler, it will get its revenge." - /Henry Spencer/
"It's hard enough to find an error in your code when you're looking for 
it; it's even harder when you've assumed your code is error-free." - 
/Steve McConnell/
"If builders built buildings the way programmers wrote programs, then 
the first woodpecker that came along would destroy civilization." - 
/Gerald Weinberg/



ChrisSpeare wrote:
    
Ok ignore the 2955 - that was a hack of the code I made earlier to report
the
line number of the error reporter.  The message is:

Error while processing response: 'length' is null or not an object

or

Error while processing response: Unterminated string constant

It seems to be when I have a select1 in the repeat referencing an
instance
of data that is fetched from eXist, the instance contains:


<exist:result exist:hits="2" exist:start="1" exist:count="2"
xmlns:exist="http://exist.sourceforge.net/NS/exist">
	<detail>
		<name>kilogram</name>
		<comcode>KGM</comcode>
	</detail>
	<detail>
		<name>pound</name>
		<comcode>LBR</comcode>
	</detail>
</exist:result>

and the select1 code is:

<xforms:select1 ref="userram:UnitPrice/userram:BasisQuantity/@unitCode"
model="model_PurchaseOrder">
										<xforms:action ev:event="xforms-value-changed">
											<xforms:setvalue
ref="instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:ChargeableQuantity/@unitCode"
												value =
"instance('instance_model_PurchaseOrder')/userrsm:SalesContractTrade/userram:IncludedTradeItem[position()]/userram:UnitPrice/userram:BasisQuantity/@unitCode"
/>
										</xforms:action>
										<xforms:itemset model="model_PurchaseOrder"
nodeset="instance('UnitsOfMeasureList')/detail">
											<xforms:label>
												<xforms:output value="if (string-length(name) &gt; 20) then
concat(substring(name,0,20),'..') else name"/>
											</xforms:label>
											<xforms:value ref="comcode"/>
										</xforms:itemset>
									</xforms:select1>	

Any reason why this fails, as it only failed on the insert of the repeat. 
If the xml is passed straight in it works fine.



ChrisSpeare wrote:
  
      
xForm using Insert to insert new row into a repeat, looking at the
instance it fails although a row does appear, however the links to the
Select1s are all wrong.  Get the following as a alert at the top of the
screen:

Error while processing response: 'length' is null or not an object 2955

Only does it on this form for some reason.  Nothing in the log to
indicate
it failed

    
        
  
------------------------------------------------------------------------


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