Problem with <xforms:group>....

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

Problem with <xforms:group>....

Sathish K Mittapelli
Hai All
 
I am trying to develop a Smartkit for my Project.I am able to delete the data from Instance by using <xforms:delete> on Client side.I am added <xforms:insert> for adding the data to my page .When i clicks add button it will add a templete to my original instance as in Book-cast example.But the problem is entering the field values to that.I have written some code like this by using the index property.But when i am using this ,at index one only it making all fields editable,at other indexes it making it non editable.
i have tried with <xxforms:when> and <xxforms:choose> but i am getting error like invalid data element xxforms:if and xxforms:when.
 
Please give me a solution for this.
Thanks in advance.
 
My code is

<xforms:repeat ....................................... id="emp-repeat">

 

<xforms:group ref=".[index('emp-repeat') != position()]">

<xforms:output ref="code"/>

</xforms:group>

<xforms:group ref=".[index('emp-repeat') = position()]">

<xforms:input ref="code"/>

</xforms:group>

..................

.

.

.

.

.

.

Like this i am trying to edit the selected index elements.


 
THANKS & REGARDS
SATHISH K MITTAPELLI  


Unlimited freedom, unlimited storage. Get it now

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Problem with <xforms:group>....

fl.schmitt(ops-users)
Hi sathish,

> <xforms:repeat ....................................... id="emp-repeat">

could you please post a complete example that runs in the sandbox? It's
easier to debug if there's a complete xforms document with the instance
data...

Thanks!
florian




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem with <xforms:group>....

Sathish K Mittapelli
In reply to this post by Sathish K Mittapelli

Hai Florian Schmitt ...this is my complete code.......

 

 

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns:xforms="http://www.w3.org/2002/xforms"

xmlns:ev="http://www.w3.org/2001/xml-events"

xmlns:xi="http://www.w3.org/2001/XInclude"

xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<head>

<title><h1>Employee Details Display</h1></title>

<xforms:model>

<xforms:instance id="main">

<xi:include href="input:data"/>

</xforms:instance>

 

<xforms:instance id="emp-template">

<employee xmlns="">

<code/>

<firstName/>

<lastName/>

<dob/>

<gender/>

<address/>

<phone/>

<select/>

</employee>

</xforms:instance>

</head>

 

<body>

<form name="employee">

<table border="1">

<tr>

<th>Select</th>

<th>EmpCode</th>

<th>First Name</th>

<th>Last Name</th>

<th>DOB</th>

<th>Gender</th>

<th>Address</th>

<th>Phone</th>

</tr>

<xforms:repeat nodeset="instance('main')/employee[ceiling(position() div number(instance('pagination')/rows-size)) ge number(instance('pagination')/page-num) and ceiling(position() div number(instance('pagination')/rows-size)) lt (number(instance('pagination')/page-num)+1)]" id="emp-repeat">

<tr>

<td>

<xforms:select ref="select" appearance="full">

<xforms:item>

<xforms:label></xforms:label>

<xforms:value></xforms:value>

</xforms:item>

</xforms:select>

</td>

<td>

<xforms:group ref=".[index('emp-repeat') != position()]">

<xforms:output ref="code"/>

</xforms:group>

<xforms:group ref=".[index('emp-repeat') = position()]">

<xforms:input ref="code"/>

</xforms:group>

</td>

<td>

<xforms:output value="index('emp-repeat') = position()"/>

</td>

<td>

<xforms:output value="index('emp-repeat')"/>

</td>

<td>

<xforms:output ref="dob"/>

</td>

<td>

<xforms:output ref="gender"/>

</td>

<td>

<xforms:output ref="address"/>

</td>

<td>

<xforms:output ref="phone"/>

</td>

</tr>

</xforms:repeat>

</table>

<br /><br />

<div align="cenetr">

<table>

<tr>

<td>

<xforms:trigger>

<xforms:label>Add Employee</xforms:label>

<xforms:insert ev:event="DOMActivate" context="instance('main')" nodeset="employee" at="index('emp-repeat')" position="after" origin="instance('emp-template')"/>

</xforms:trigger>

</td>

<td>

<xforms:trigger>

<xforms:label>Remove Employee</xforms:label>

<xforms:delete ev:event="DOMActivate" context="instance('main')" nodeset="employee" at="index('emp-repeat')"/>

</xforms:trigger>

</td>

<td>

<xforms:submit submission="CreateQuestion">

<xforms:label>Submit</xforms:label>

</xforms:submit>

</td>

</tr>

</table>

</div>

<widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/>

</form>

</body>

</html>

 

Here data coming from xpl.

 


 
THANKS & REGARDS
SATHISH K MITTAPELLI  


----- Original Message ----
From: Florian Schmitt <[hidden email]>
To: [hidden email]
Sent: Wednesday, 30 April, 2008 2:26:52 PM
Subject: [ops-users] Re: Problem with <xforms:group>....

Hi sathish,

> <xforms:repeat ....................................... id="emp-repeat">

could you please post a complete example that runs in the sandbox? It's
easier to debug if there's a complete xforms document with the instance
data...

Thanks!
florian





Meet people who discuss and share your passions. Join them now.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Problem with <xforms:group>....

fl.schmitt(ops-users)
hi sathish,

> Here data coming from xpl.

thank you, but it won't run in the sandbox without the instance data. How would
the instance data look like?

florian



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Problem with <xforms:group>....

Sathish K Mittapelli

Hai Florian My Instance will look like this

<xforms:instance id="main">
<employees xmlns="">
<employee>
                    <code/>
                    <firstName/>
                    <lastName/>
                    <dob/>
                    <gender/>
                    <address/>
                    <phone/>
                    <select/>
                    </employee>
            </employees>  
           
        </xforms:instance>
THANKS & REGARDS
SATHISH K MITTAPELLI  


--- On Wed, 30/4/08, Florian Schmitt <[hidden email]> wrote:
From: Florian Schmitt <[hidden email]>
Subject: [ops-users] Re: Re: Re: Problem with <xforms:group>....
To: [hidden email]
Date: Wednesday, 30 April, 2008, 5:59 PM

hi sathish,

> Here data coming from xpl.

thank you, but it won't run in the sandbox without the instance data. How
would
the instance data look like?

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


Unlimited freedom, unlimited storage. Get it now

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Problem with <xforms:group>....

Erik Bruchez
Administrator
In reply to this post by Sathish K Mittapelli
The position() function will always return 1 in your case.

This is an XPath thing: position() returns the position within the  
current context. As soon as you write:

   .[ ... whatever ... ]

the context within the brackets changes to being the current node.  
That context has a size of 1, and a position of 1.

This probably explains part of your problem. You may want to replace  
"position()" with "count(preceding-sibling::*) + 1".

-Erik

On Apr 30, 2008, at 1:06 AM, sathish kumar wrote:

> Hai All
>
> I am trying to develop a Smartkit for my Project.I am able to delete  
> the data from Instance by using <xforms:delete> on Client side.I am  
> added <xforms:insert> for adding the data to my page .When i clicks  
> add button it will add a templete to my original instance as in Book-
> cast example.But the problem is entering the field values to that.I  
> have written some code like this by using the index property.But  
> when i am using this ,at index one only it making all fields  
> editable,at other indexes it making it non editable.
> i have tried with <xxforms:when> and <xxforms:choose> but i am  
> getting error like invalid data element xxforms:if and xxforms:when.
>
> Please give me a solution for this.
> Thanks in advance.
>
> My code is
> <xforms:repeat ....................................... id="emp-
> repeat">
>
>
> <xforms:group ref=".[index('emp-repeat') != position()]">
>
> <xforms:output ref="code"/>
>
> </xforms:group>
>
>
> <xforms:group ref=".[index('emp-repeat') = position()]">
>
> <xforms:input ref="code"/>
>
> </xforms:group>
>
> ..................
>
> .
>
> .
>
> .
>
> .
>
> .
>
> .
>
> Like this i am trying to edit the selected index elements.
>
>
>
> THANKS & REGARDS
> SATHISH K MITTAPELLI
>
> Unlimited freedom, unlimited storage. Get it now
> --
> 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
--
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