Problem with upload control in Form Runner

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

Problem with upload control in Form Runner

                                                                                            </fr:repeat>
                                                    </fr:grid>
                </fr:section>
            </fr:body>
        </fr:view>
    </body>
</html>
abutnaru
Hello,
I decided to create a new thread since the old one could sound obsolete.
I created a small test xforms to run into Form Runner.
The application intend to add upload-controls in a repeat section.
If I add a new item the xforms shows Errors on Form.
If I delete the item xforms is ok (no matter if a file was uploaded or not in the meantime).

I attach the example of code maybe someone with more experience will see where the problem is.

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
    <head>
        <title>XForms</title>
        <link rel="stylesheet" href="/ops/css/yui/reset-fonts-grids.css" type="text/css"/>
        <link rel="stylesheet" href="/ops/css/yui/base-min.css" type="text/css"/>
        <link rel="stylesheet" href="/apps/fr/style/form-runner.css" type="text/css"/>

        <xforms:model id="fr-form-model" xxforms:help-tooltip="false">
           
            <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified">

               
                <xs:element name="projects">
                    <xs:complexType>
                       
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                            <xs:element ref="project"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>

               
                <xs:element name="project">
                    <xs:complexType>
                        <xs:sequence>
                        <xs:element name="keydeliverables" type="keydeliverables"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>

                <xs:complexType name="keydeliverables">
                    <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="deliverable" type="deliverable"/>
                    </xs:sequence>
                </xs:complexType>
               
               
                <xs:complexType name="deliverable">
                    <xs:sequence>
                        <xs:element name="keypdf" type="xs:anyURI"/>
                    </xs:sequence>
                </xs:complexType>

            </xs:schema>

           
            <xforms:instance id="fr-form-instance" xxforms:validation="strict">
                <project xmlns="">
                     <keydeliverables>
                     </keydeliverables>
                </project>
            </xforms:instance>

           
            <xforms:instance id="fr-form-metadata" xxforms:readonly="true">
                <metadata xmlns="">
                    <application-name>repository</application-name>
                    <form-name>projects</form-name>
                    <title xml:lang="en">Projects Repository</title>
                    <description xml:lang="en">List of Projects.</description>
                    <author></author>
                    <logo mediatype="" filename="" size=""/>
                </metadata>
            </xforms:instance>

           
            <xforms:instance id="fr-form-resources">
                <resources xmlns="">
                    <resource xml:lang="en">
                        <keydeliverables>
                            <label>Key deliverables</label>
                        </keydeliverables>
                        <keypdf>
                            <label>PDF</label>
                            <hint>Deliverable in .pdf format</hint>
                            <help></help>
                            <alert>File is missing</alert>
                        </keypdf>
                    </resource>
                </resources>
                </xforms:instance>

            <xforms:instance id="deliverable-template">
                    <deliverable xmlns="">
                            <keypdf filename="" mediatype="" size=""/>
               </deliverable>
            </xforms:instance>
            </xforms:model>
    </head>
    <body>
        <fr:view>
            <xforms:label>Projects Repository</xforms:label>
            <xhtml:img src="/apps/fr/style/orbeon-logo-trimmed-transparent-42.png"/>
            <fr:body>
                <fr:section id="keydeliverables-section" context="keydeliverables">
                 <xforms:label ref="$form-resources/keydeliverables/label"/>
                  <fr:grid columns="5">
                 
                                <fr:repeat nodeset="deliverable" id="keydeliverables-repeat" origin="instance('deliverable-template')" columns="5" appearance="xxforms:table">
                                    <xforms:label>Deliverables</xforms:label>
                               
                                <xforms:upload id="keypdf-control" ref="keypdf" class="fr-attachment" incremental="true">
                                <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>
                           
Reply | Threaded
Open this post in threaded view
|

Probable a simple question

Alex Sharaz-2
Hi,
I'm sure this is a really simple question.
I've built a select1 statement  as shown below

.....
     <xforms:itemset nodeset="instance('netdev-instance')/buildings/
building">
                                 <xforms:label ref="building_name""/>
                                 <xforms:value ref="building_ptr"/>
                             </xforms:itemset>
......

using
<netdev>
<buildings>
<building>
   <building_ptr>7</building_ptr>
   <building_name>Centre for Lifelong Learning</building_name>
   <building_type>University</building_type>
   <building_sub_type>East Campus</building_sub_type>
</building>
......
</buildings>
</netdev>

I'd like to have the label value to be a combination of  
<building_type><building_sub_ e.g. type> and <building_name>
e.g. University/East Campus/Centre for Lifelong Learning

is this doable?

would i be able to build a string variable using the building...  
objects and specify that in the xforms:label statement
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: Probable a simple question

fl.schmitt(ops-users)
Alex,

not tested:

<xforms:itemset
         nodeset="instance('netdev-instance')/buildings/building">
     <xforms:label
             value="string-join(
             (building_type, building_sub_type, building_name),
             '/')"
     />
     <xforms:value ref="building_ptr"/>
</xforms:itemset>

does this work?

HTH
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: Probable a simple question

Alex Sharaz-2
In reply to this post by Alex Sharaz-2
Or, something more fancy such as a drop down list similar to that seen  
when you use an optgroup html command e.g.

<select name="PageList" lang="en"  
onchange=visit(this.options[selectedIndex].value)>
                 <optgroup label="Slideshow">
                        <option value="/index.jsp" selected>Welcome</
option>
                       <option value="/general/
generalchallengeinfo.jsp">General information about the challenge</
option>
                       <option value="/general/thechallenge.jsp">The  
challenge</option>
                       <option value="/general/theitinerary.jsp">The  
itinerary</option>
                       <option value="/general/thesupportteam.jsp">The  
support  team </option>
                       <option value="/general/castlist.jsp">Challenge  
participants</option>
                       <option value="/general/userjournals.jsp">User  
Journals</option>
                       <option value="/gallery/index.php">User  
Photographs</option>
                 </optgroup>
                 <optgroup label="Miscellaneous">
                        <option value="/general/contactinfo.jsp"  
 >Contact Info</option>
                        <option value="/general/email.jsp">Send a  
message</option>
                        <option value="/general/
trainingguide.jsp">Training Guide</option>
                        <option value="/general/
newsletters.jsp">Ecuador newsletters</option>
                        <option value="/login/login.jsp">Logging onto  
the site</option>
                 </optgroup>
                 <optgroup label="About">
                         <option value="/general/macmillan.jsp">About  
Macmillan Cancer Relief</option>
                        <option value="/general/
discoveradventure.jsp">About Discover Adventure</option>
                       <option value="/general/about.jsp">About this  
site </option>
               </optgroup>
</select>

except in this case <optgroup label=Slideshow" would be the value of  
<building_type>, with a nested menu of <building_sub_type> and then a  
list of <building_name> objects to select from. This would then look  
like

University
   East Campus
      building1
      .......
  West Campus
     building a
  Another<building_sub_type>  entry
etc...





On Jul 31, 2008, at 4:25 PM, Alex Sharaz wrote:

> Hi,
> I'm sure this is a really simple question.
> I've built a select1 statement  as shown below
>
> .....
>    <xforms:itemset nodeset="instance('netdev-instance')/buildings/
> building">
>                                <xforms:label ref="building_name""/>
>                                <xforms:value ref="building_ptr"/>
>                            </xforms:itemset>
> ......
>
> using
> <netdev>
> <buildings>
> <building>
>  <building_ptr>7</building_ptr>
>  <building_name>Centre for Lifelong Learning</building_name>
>  <building_type>University</building_type>
>  <building_sub_type>East Campus</building_sub_type>
> </building>
> ......
> </buildings>
> </netdev>
>
> I'd like to have the label value to be a combination of  
> <building_type><building_sub_ e.g. type> and <building_name>
> e.g. University/East Campus/Centre for Lifelong Learning
>
> is this doable?
>
> would i be able to build a string variable using the building...  
> objects and specify that in the xforms:label statement
> 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


--
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: Probable a simple question

Alex Sharaz-2
In reply to this post by fl.schmitt(ops-users)
Florian,
Yup works fine. Need to do some sorting but yes it does

thanks
Alex
On Jul 31, 2008, at 4:44 PM, Florian Schmitt wrote:

> Alex,
>
> not tested:
>
> <xforms:itemset
>        nodeset="instance('netdev-instance')/buildings/building">
>    <xforms:label
>            value="string-join(
>            (building_type, building_sub_type, building_name),
>            '/')"
>    />
>    <xforms:value ref="building_ptr"/>
> </xforms:itemset>
>
> does this work?
>
> HTH
> 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


--
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: Probable a simple question

fl.schmitt(ops-users)
In reply to this post by Alex Sharaz-2
Alex,

> Or, something more fancy such as a drop down list similar to that seen
> when you use an optgroup html command e.g. (...)
>
> except in this case <optgroup label=Slideshow" would be the value of
> <building_type>, with a nested menu of <building_sub_type> and then a
> list of <building_name> objects to select from. This would then look like
>
> University
>   East Campus
>      building1
>      .......
>  West Campus
>     building a
>  Another<building_sub_type>  entry
> etc...
This can be done using xxforms:tree. There's an example online:

http://www.orbeon.com/ops/xforms-sandbox/sample/tree

HTH
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