problems faced using xforms:repeat with xforms:insert

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

problems faced using xforms:repeat with xforms:insert

ilango_g
Hi
This is a code snippet from an XForm that I wrote recently:

I have some data in the instance.

Now ,I need to model a repeat homogenous structure, ( a table that "Name" "SSN" and "DOB" Fields in it)

I have 3 input fields above this "yet-to-grow" table named "My Name" " SSN" and "DOB" respectively.
I make some entries into each of these fields and then press a button called "Save My Different Name" and then I need to see  these very entries written as new entries into the table below that is intially empty. For example, if I entered " John Doe", "222222222" and "12/14/1896" then these entries need to be written into the table. After this, I would be able to repeat this process and add more entries.

My XForm does work only partially , because it looks like only one entry is written into the table, but ****the first entry gets written into the table as I type entries into the text input entry fields.******

Well, after the entries need to be successfully entered, I need to have a button "View Different Names I have used in the past"  that when pressed should refresh the current entries in the table and bring up for me a wholly different view of the table that will give me the value already stored in the instance in addition to the ones I entered recently.

I am going through the Orbeon sample as well as the other samples on this forum to help myself out in the meanwhile.
Instance:

---

<fe:input>
   <fe:aliasLookUpTable>
               <fe:my_name_column_entry>McQuaker McOats</fe:my_name_column_entry>
               <fe:my_dob_column_entry>12/14/1976</fe:my_dob_column_entry>
                <fe:my_ssn_column_entry>111111111</fe:my_ssn_column_entry>
     </fe:aliasLookUpTable>
</fe:input>
----
<fe:output>
   <fe:aliasLookUpTable>
               <fe:my_name_column_entry>ilango</fe:my_name_column_entry>
               <fe:my_dob_column_entry>12/14/1976</fe:my_dob_column_entry>
                <fe:my_ssn_column_entry>111111111</fe:my_ssn_column_entry>
     </fe:aliasLookUpTable>
</fe:output>
--------------------

Body of XForm:




<xhtml:table id="mylookuptablethatgrows">
    <xhtml:tr class="toprow">
        <xhtml:thead>
            <xhtml:th>Name</xhtml:th>
            <xhtml:th>SSN</xhtml:th>
            <xhtml:th>DOB</xhtml:th>
        </xhtml:thead>
     </xhtml:tr>
    <xhtml:tr>
     <xforms:repeat nodeset="instance('taskinput')/fe:personNameLookUpTable" id="my-different-names-repeat">
    <xhtml:td>
                        <xforms:input ref="fe:my_name_column_entry">
            <xforms:label/>
               </xforms:input>
                  </xhtml:td>
        <xhtml:td>               
           <xforms:input ref="fe:my_ssn_column_entry">
        <xforms:label/>
              </xforms:input>
            </xhtml:td>
            <xhtml:td>               
                <xforms:input ref="fe:my_dob_column_entry">
        <xforms:label/>
              </xforms:input>
                       </xhtml:td>
            </xforms:repeat>       
            </xhtml:tr>       
    <xhtml:tr>
        <xhtml:td>
    <xforms:trigger>
                       <xforms:label class="test-label">Save My Different Name</xforms:label>
                       <xforms:action ev:event="DOMActivate">
                  <xforms:insert nodeset="instance('taskinput')/fe:personNameLookUpTable" at="index('my-different-names-repeat')" position="after" />
                 
                      </xforms:action>
</xforms:trigger>
</xhtml:td>
 </xhtml:tr>
</xhtml:table>
                                                               
                                                               
</xhtml:p>
Reply | Threaded
Open this post in threaded view
|

Re: problems faced using xforms:repeat with xforms:insert

Alessandro Vernet
Administrator
On Feb 8, 2008, at 6:54 AM, someperson wrote:

> My XForm does work only partially , because it looks like only one  
> entry is
> written into the table, but ****the first entry gets written into  
> the table
> as I type entries into the text input entry fields.******

If you want to increase the chances of someone in the mailing list  
being able to help you, I recommend you post about a very specific  
problem (I click here; I expect A; I get B), and post an example that  
we can run in the XForms sandbox. You might also find this useful:

<a href="http://www.orbeon.com/ops/doc/home-faq##reporting-issues">http://www.orbeon.com/ops/doc/home-faq##reporting-issues

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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