(Form Builder) PDF attachment file in repeat is always the same for all added rows

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

(Form Builder) PDF attachment file in repeat is always the same for all added rows

abutnaru
Hi,
when I am repeating this structure everything works fine except the pdf
attachment. When I attach in the first row one file it is automatically
attached to all the other rows I am adding in the table.
Can anybody help?

Thanks
A.

The code is below:
-- the type definition
    <!-- Type for keydeliverables -->
        <xs:complexType name="keydeliverables">
                    <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="deliverable" type="deliverable"/>
            </xs:sequence>
                </xs:complexType>
       
        <!-- Type for deliverable -->
        <xs:complexType name="deliverable">
                    <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="keytitle" type="xs:string"/>
                        <xs:element name="keydate" type="xs:date"/>
                        <xs:element name="keyorganisation"
type="xs:string"/>
                        <xs:element name="keyabstract" type="xs:string"/>
                        <xs:element name="keypdf" type="xs:anyURI"/>
                    </xs:sequence>
                </xs:complexType>



-- instance
<keydeliverables>
            <keytitle/>
            <keydate/>
            <keyorganisation/>
            <keyabstract/>
            <keypdf filename="" mediatype="" size=""/>
        </keydeliverables>

-- the template
<xforms:instance id="deliverable-template">
            <deliverable xmlns="">
                <keytitle />
                <keydate />
                <keyorganisation />
                <keyabstract />
                <keypdf />
                </deliverable>
        </xforms:instance>
-- the repeat section
<fr:section id="keydeliverables-section" context="keydeliverables">
                 <xforms:label ref="$form-resources/keydeliverables/label"/>
                  <fr:grid columns="5">
          <tr>
              <td>
                                <fr:repeat nodeset="deliverable"
id="keydeliverables-repeat" origin="instance('deliverable-template')"
columns="5" appearance="xxforms:table">
                                   
<xforms:label>Deliverables</xforms:label>
        <tr>
                    <td width="100px">
                    <xforms:textarea ref="keytitle"
appearance="xxforms:autosize" incremental="true">
                                    <xforms:label
ref="$form-resources/keytitle/label"/>
                                    <xforms:hint
ref="$form-resources/keytitle/hint"/>
                                    <xforms:help
ref="$form-resources/keytitle/help"/>
                                    <xforms:alert
ref="$form-resources/keytitle/alert"/>
                                </xforms:textarea>
                </td>
                <td width="100px">
                    <xforms:textarea ref="keydate"
appearance="xxforms:autosize" incremental="true">
                                    <xforms:label
ref="$form-resources/keydate/label"/>
                                    <xforms:hint
ref="$form-resources/keydate/hint"/>
                                    <xforms:help
ref="$form-resources/keydate/help"/>
                                    <xforms:alert
ref="$form-resources/keydate/alert"/>
                    </xforms:textarea>
                    </td>
                            <td width="100px">
                    <xforms:textarea ref="keyorganisation"
appearance="xxforms:autosize" incremental="true">
                                    <xforms:label
ref="$form-resources/keyorganisation/label"/>
                                    <xforms:hint
ref="$form-resources/keyorganisation/hint"/>
                                    <xforms:help
ref="$form-resources/keyorganisation/help"/>
                                    <xforms:alert
ref="$form-resources/keyorganisation/alert"/>
                    </xforms:textarea>
                    </td>
                            <td width="200px">
                    <xforms:textarea ref="keyabstract"
appearance="xxforms:autosize" incremental="true">
                                    <xforms:label
ref="$form-resources/keyabstract/label"/>
                                    <xforms:hint
ref="$form-resources/keyabstract/hint"/>
                                    <xforms:help
ref="$form-resources/keyabstract/help"/>
                                    <xforms:alert
ref="$form-resources/keyabstract/alert"/>
                    </xforms:textarea>
                    </td>
                <td width="200px">
                <xforms:upload id="keypdf-control" bind="keypdf-bind"
class="fr-attachment">
                <xforms:label ref="$form-resources/keypdf/label"/>
                <xforms:hint ref="$form-resources/keypdf/hint"/>
                <xforms:help ref="$form-resources/keypdf/help"/>
                <xforms:alert ref="$fr-resources/detail/labels/alert"/>
                <xforms:filename ref="@filename"/>
                <xforms:mediatype ref="@mediatype"/>
                <xxforms:size ref="@size"/>
                </xforms:upload>
                </td>
            </tr>
            </fr:repeat>
            </td>
        </tr>
        </fr:grid>
                   </fr:section


--
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: (Form Builder) PDF attachment file in repeat is always the same for all added rows

Alessandro Vernet
Administrator
Adrian,

On Thu, Jul 17, 2008 at 1:18 PM, Adrian Butnaru <[hidden email]> wrote:
> when I am repeating this structure everything works fine except the pdf
> attachment. When I attach in the first row one file it is automatically
> attached to all the other rows I am adding in the table.

Your bind is special because it uses a bind="keypdf-bind". How is this
bind defined? A bind should work, but just to make sure that this is
caused by the bind (and not the upload), you can try to change the
code to use a ref instead.

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/
Twitter - http://twitter.com/avernet


--
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: (Form Builder) PDF attachment file in repeat is always the same for all added rows

abutnaru
Alessandro,
The bind are defined like that:

            <xforms:bind id="fr-form-binds" nodeset=".">
                <xforms:bind nodeset="details">
                    <xforms:bind id="acronym-bind" nodeset="acronym"
required="true()"/>
                    <xforms:bind id="projectname-bind"
nodeset="projectname" required="true()"/>
                    <xforms:bind id="subjectarea-bind"
nodeset="subjectarea" required="true()"/>
                    <xforms:bind id="coordinator-bind"
nodeset="coordinator" required="true()"/>
                    <xforms:bind id="startdate-bind" nodeset="startdate"
required="true()"/>
                    <xforms:bind id="duration-bind" nodeset="duration"
required="true()"/>
                    <xforms:bind id="budget-bind" nodeset="budget"
required="true()"/>
                    <xforms:bind id="funding-bind" nodeset="funding"
required="true()"/>
                    <xforms:bind id="url-bind" nodeset="url"
required="true()"/>
                    <xforms:bind id="category-bind" nodeset="category"
required="true()"/>
                    <xforms:bind id="eucategory-bind"
nodeset="eucategory" required="true()"/>
                    <xforms:bind id="eutype-bind" nodeset="eutype"
required="true()"/>
                    <xforms:bind id="abstract-bind" nodeset="abstract"
required="true()"/>
                    <xforms:bind id="achievement-bind"
nodeset="achievement" required="true()"/>
                    <xforms:bind id="summary-bind" nodeset="summary"
required="true()"/>
                    <xforms:bind id="relatedprojectname-bind"
nodeset="relatedprojectname" required="true()"/>
                    <xforms:bind id="relatedprojecturl-bind"
nodeset="relatedprojecturl" required="true()"/>
                    <xforms:bind id="topics-bind" nodeset="topics"
required="true()"/>
                    <xforms:bind id="stakeholders-bind"
nodeset="stakeholders" required="true()"/>
                    <xforms:bind id="policies-bind" nodeset="policies"
required="true()"/>
        </xforms:bind>
        <xforms:bind nodeset="keydeliverables">
                    <xforms:bind id="keypdf-bind" nodeset="keypdf"
type="xs:anyURI"/>
        </xforms:bind>  
            </xforms:bind>

Adrian

Alessandro Vernet schreef:

> Adrian,
>
> On Thu, Jul 17, 2008 at 1:18 PM, Adrian Butnaru <[hidden email]> wrote:
>  
>> when I am repeating this structure everything works fine except the pdf
>> attachment. When I attach in the first row one file it is automatically
>> attached to all the other rows I am adding in the table.
>>    
>
> Your bind is special because it uses a bind="keypdf-bind". How is this
> bind defined? A bind should work, but just to make sure that this is
> caused by the bind (and not the upload), you can try to change the
> code to use a ref instead.
>
> Alex
>  


--
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: (Form Builder) PDF attachment file in repeat is always the same for all added rows

Alessandro Vernet
Administrator
Adrian,

In the binds you have:

On Thu, Jul 17, 2008 at 11:37 PM, Adrian Butnaru <[hidden email]> wrote:
>       <xforms:bind nodeset="keydeliverables">
>                   <xforms:bind id="keypdf-bind" nodeset="keypdf"
> type="xs:anyURI"/>
>       </xforms:bind>             </xforms:bind>

In the UI you have:

<fr:repeat nodeset="deliverable" id="keydeliverables-repeat"
origin="instance('deliverable-template')"
           columns="5" appearance="xxforms:table">
    <xforms:upload id="keypdf-control" bind="keypdf-bind" class="fr-attachment">

The upload field is reference to bind ID keypdf-control, which is
keydeliverables/keypdf. But the repeat is over deliverable, not
keydeliverables. From this code excerpt, it looks to me like the
upload has a reference to a node outside of the repeat, which means
that all the iterations in the repeat are in fact bound to the same
node. Could this be what is happening?

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/
Twitter - http://twitter.com/avernet


--
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: (Form Builder) PDF attachment file in repeat is always the same for all added rows

abutnaru
I corrected and it looks that is working. I will do some more tests.

Thanks,
Adrian

Alessandro Vernet schreef:

> Adrian,
>
> In the binds you have:
>
> On Thu, Jul 17, 2008 at 11:37 PM, Adrian Butnaru <[hidden email]> wrote:
>  
>>       <xforms:bind nodeset="keydeliverables">
>>                   <xforms:bind id="keypdf-bind" nodeset="keypdf"
>> type="xs:anyURI"/>
>>       </xforms:bind>             </xforms:bind>
>>    
>
> In the UI you have:
>
> <fr:repeat nodeset="deliverable" id="keydeliverables-repeat"
> origin="instance('deliverable-template')"
>            columns="5" appearance="xxforms:table">
>     <xforms:upload id="keypdf-control" bind="keypdf-bind" class="fr-attachment">
>
> The upload field is reference to bind ID keypdf-control, which is
> keydeliverables/keypdf. But the repeat is over deliverable, not
> keydeliverables. From this code excerpt, it looks to me like the
> upload has a reference to a node outside of the repeat, which means
> that all the iterations in the repeat are in fact bound to the same
> node. Could this be what is happening?
>
> Alex
>  


--
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: Re: (Form Builder) PDF attachment file in repeat is always the same for all added rows

Alessandro Vernet
Administrator
On Mon, Jul 21, 2008 at 10:05 AM, Adrian Butnaru <[hidden email]> wrote:
> I corrected and it looks that is working. I will do some more tests.

OK, excellent. Thanks for the update.

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/
Twitter - http://twitter.com/avernet


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