select1 depending on xpath expression

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

select1 depending on xpath expression

masjab-2
Hello, 
I need some help with this one, it´s drivin me crazy...

I want to make a search-page where the user can choose from a select1 what to search for. 
Then, depending on what he chose, an <input> or maybe another <select1> appears in the same row.
This can be repeated...

It´s almost working but here is my problem:
When my xpath expression gets "true" after some rows are repeated, everything get´s visible then...
I mean, I only want an <xforms:input> to be visible in a specific row, where an xpath expression looks for the value chosen in the select1(but in the same row)

Here is my code:

 <xforms:repeat nodeset="instance('search-Data')/search" id="search-repeat">
                            <tr>
                                <td>
                                    <xforms:select1 ref="./@Name">
                                        <xforms:item>
                                            <xforms:label>
                                                Choose One Please
                                            </xforms:label>
                                            <xforms:value></xforms:value>/>
                                        </xforms:item>

                                        

                                        <xforms:item>
                                            <xforms:label>
                                                Category
                                            </xforms:label>
                                            <xforms:value>category</xforms:value>/>
                                        </xforms:item>
                                        <xforms:item>
                                            <xforms:label>
                                                Something1
                                            </xforms:label>
                                            <xforms:value>something1</xforms:value>
                                        </xforms:item>
                                        <xforms:item>
                                            <xforms:label>
                                                Something2
                                            </xforms:label>
                                            <xforms:value>Something2</xforms:value>
                                        </xforms:item>
                                    </xforms:select1>
                                </td>   

                                

                                <td class="form-td">
                                    <xforms:input ref=".[instance('search-Data')/search/@Name='something1' or instance('search-Data')/search/@Name='Something2']/@textValue">
                                    </xforms:input>

                        

                                        <xforms:select1 ref=".[instance('search-Data')/search/@Name='category']/@textValue">
                                            <xforms:item>
                                                <xforms:label>
                                                    Choose One Please
                                                </xforms:label>
                                                <xforms:value></xforms:value>/>
                                            </xforms:item>
                                            <xforms:item>
                                                <xforms:label>
                                                    Cat1
                                                </xforms:label>
                                                <xforms:value>none</xforms:value>/>
                                            </xforms:item>
                                            <xforms:item>
                                                <xforms:label>
                                                    Cat2
                                                </xforms:label>
                                                <xforms:value>cat2</xforms:value>
                                            </xforms:item>

                                            

                                        </xforms:select1>
                                </td>
...
...
..

The thing is, that when the user wants to search for an category, I don´t want him to type in the category into an textfield...He should be able to chose one category from another select1...


Please, I can´t find a way out of this...










--
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: select1 depending on xpath expression

Erik Bruchez
Administrator
Just glancing at it it should work. Can you provide an entire XHTML
+XForms file running in the sandbox so we can look at it?

-Erik

On Jun 2, 2008, at 2:05 AM, Masen J wrote:

> Hello,
> I need some help with this one, it´s drivin me crazy...
>
> I want to make a search-page where the user can choose from a  
> select1 what to search for.
> Then, depending on what he chose, an <input> or maybe another  
> <select1> appears in the same row.
> This can be repeated...
>
> It´s almost working but here is my problem:
> When my xpath expression gets "true" after some rows are repeated,  
> everything get´s visible then...
> I mean, I only want an <xforms:input> to be visible in a specific  
> row, where an xpath expression looks for the value chosen in the  
> select1(but in the same row)
>
> Here is my code:
>
>  <xforms:repeat nodeset="instance('search-Data')/search" id="search-
> repeat">
>                             <tr>
>                                 <td>
>                                     <xforms:select1 ref="./@Name">
>                                         <xforms:item>
>                                             <xforms:label>
>                                                 Choose One Please
>                                             </xforms:label>
>                                             <xforms:value></
> xforms:value>/>
>                                         </xforms:item>
>
>                                         <xforms:item>
>                                             <xforms:label>
>                                                 Category
>                                             </xforms:label>
>                                             <xforms:value>category</
> xforms:value>/>
>                                         </xforms:item>
>                                         <xforms:item>
>                                             <xforms:label>
>                                                 Something1
>                                             </xforms:label>
>                                              
> <xforms:value>something1</xforms:value>
>                                         </xforms:item>
>                                         <xforms:item>
>                                             <xforms:label>
>                                                 Something2
>                                             </xforms:label>
>                                              
> <xforms:value>Something2</xforms:value>
>                                         </xforms:item>
>                                     </xforms:select1>
>                                 </td>
>
>                                 <td class="form-td">
>                                     <xforms:input ref=".
> [instance('search-Data')/search/@Name='something1' or  
> instance('search-Data')/search/@Name='Something2']/@textValue">
>                                     </xforms:input>
>
>                                         <xforms:select1 ref=".
> [instance('search-Data')/search/@Name='category']/@textValue">
>                                             <xforms:item>
>                                                 <xforms:label>
>                                                     Choose One Please
>                                                 </xforms:label>
>                                                 <xforms:value></
> xforms:value>/>
>                                             </xforms:item>
>                                             <xforms:item>
>                                                 <xforms:label>
>                                                     Cat1
>                                                 </xforms:label>
>                                                 <xforms:value>none</
> xforms:value>/>
>                                             </xforms:item>
>                                             <xforms:item>
>                                                 <xforms:label>
>                                                     Cat2
>                                                 </xforms:label>
>                                                 <xforms:value>cat2</
> xforms:value>
>                                             </xforms:item>
>
>                                         </xforms:select1>
>                                 </td>
> ...
> ...
> ..
>
> The thing is, that when the user wants to search for an category, I  
> don´t want him to type in the category into an textfield...He should  
> be able to chose one category from another select1...
>
>
> Please, I can´t find a way out of this...
>
>
>
>
>
>
>
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Re: select1 depending on xpath expression

masjab-2
HEY ERIK,

thx for your help!
Here is a modified "search.xhtml" file to work in the sandbox.
The thing is that it does not work for 100% because when a row is  
repeated no labels are inside the select1...

But my problem is still the same because when you choose first  
"something1" and then click on "+" and then choose "category" in the  
first row where "something1" was selceted before, a select1 appears in  
the second row,too..

Sounds horrible, I know...








Am 03.06.2008 um 06:47 schrieb Erik Bruchez:

> Just glancing at it it should work. Can you provide an entire XHTML
> +XForms file running in the sandbox so we can look at it?
>
> -Erik
>
> On Jun 2, 2008, at 2:05 AM, Masen J wrote:
>
>> Hello,
>> I need some help with this one, it´s drivin me crazy...
>>
>> I want to make a search-page where the user can choose from a  
>> select1 what to search for.
>> Then, depending on what he chose, an <input> or maybe another  
>> <select1> appears in the same row.
>> This can be repeated...
>>
>> It´s almost working but here is my problem:
>> When my xpath expression gets "true" after some rows are repeated,  
>> everything get´s visible then...
>> I mean, I only want an <xforms:input> to be visible in a specific  
>> row, where an xpath expression looks for the value chosen in the  
>> select1(but in the same row)
>>
>> Here is my code:
>>
>> <xforms:repeat nodeset="instance('search-Data')/search" id="search-
>> repeat">
>>                            <tr>
>>                                <td>
>>                                    <xforms:select1 ref="./@Name">
>>                                        <xforms:item>
>>                                            <xforms:label>
>>                                                Choose One Please
>>                                            </xforms:label>
>>                                            <xforms:value></
>> xforms:value>/>
>>                                        </xforms:item>
>>
>>                                        <xforms:item>
>>                                            <xforms:label>
>>                                                Category
>>                                            </xforms:label>
>>                                            <xforms:value>category</
>> xforms:value>/>
>>                                        </xforms:item>
>>                                        <xforms:item>
>>                                            <xforms:label>
>>                                                Something1
>>                                            </xforms:label>
>>                                            
>> <xforms:value>something1</xforms:value>
>>                                        </xforms:item>
>>                                        <xforms:item>
>>                                            <xforms:label>
>>                                                Something2
>>                                            </xforms:label>
>>                                            
>> <xforms:value>Something2</xforms:value>
>>                                        </xforms:item>
>>                                    </xforms:select1>
>>                                </td>
>>
>>                                <td class="form-td">
>>                                    <xforms:input ref=".
>> [instance('search-Data')/search/@Name='something1' or  
>> instance('search-Data')/search/@Name='Something2']/@textValue">
>>                                    </xforms:input>
>>
>>                                        <xforms:select1 ref=".
>> [instance('search-Data')/search/@Name='category']/@textValue">
>>                                            <xforms:item>
>>                                                <xforms:label>
>>                                                    Choose One Please
>>                                                </xforms:label>
>>                                                <xforms:value></
>> xforms:value>/>
>>                                            </xforms:item>
>>                                            <xforms:item>
>>                                                <xforms:label>
>>                                                    Cat1
>>                                                </xforms:label>
>>                                                <xforms:value>none</
>> xforms:value>/>
>>                                            </xforms:item>
>>                                            <xforms:item>
>>                                                <xforms:label>
>>                                                    Cat2
>>                                                </xforms:label>
>>                                                <xforms:value>cat2</
>> xforms:value>
>>                                            </xforms:item>
>>
>>                                        </xforms:select1>
>>                                </td>
>> ...
>> ...
>> ..
>>
>> The thing is, that when the user wants to search for an category, I  
>> don´t want him to type in the category into an textfield...He  
>> should be able to chose one category from another select1...
>>
>>
>> Please, I can´t find a way out of this...
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> 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


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

search.xhtml (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: select1 depending on xpath expression

Erik Bruchez
Administrator
Try simply:

<xforms:input ref=".[@name = 'something1' or @name = 'Something2']/
@textValue">

or even:

<xforms:input ref=".[@name = ('something1', 'Something2')]/@textValue">

and:

<xforms:select1 ref=".[@name='category']/@category">

Note that I found a bug with the recent nightlies that prevented this  
to work properly. That's now fixed. But 3.6 probably worked.

-Erik

On Jun 3, 2008, at 2:07 PM, Masen J wrote:

> HEY ERIK,
>
> thx for your help!
> Here is a modified "search.xhtml" file to work in the sandbox.
> The thing is that it does not work for 100% because when a row is  
> repeated no labels are inside the select1...
>
> But my problem is still the same because when you choose first  
> "something1" and then click on "+" and then choose "category" in the  
> first row where "something1" was selceted before, a select1 appears  
> in the second row,too..
>
> Sounds horrible, I know...
>
>
> <search.xhtml>
>
>
>
>
> Am 03.06.2008 um 06:47 schrieb Erik Bruchez:
>
>> Just glancing at it it should work. Can you provide an entire XHTML
>> +XForms file running in the sandbox so we can look at it?
>>
>> -Erik
>>
>> On Jun 2, 2008, at 2:05 AM, Masen J wrote:
>>
>>> Hello,
>>> I need some help with this one, it´s drivin me crazy...
>>>
>>> I want to make a search-page where the user can choose from a  
>>> select1 what to search for.
>>> Then, depending on what he chose, an <input> or maybe another  
>>> <select1> appears in the same row.
>>> This can be repeated...
>>>
>>> It´s almost working but here is my problem:
>>> When my xpath expression gets "true" after some rows are repeated,  
>>> everything get´s visible then...
>>> I mean, I only want an <xforms:input> to be visible in a specific  
>>> row, where an xpath expression looks for the value chosen in the  
>>> select1(but in the same row)
>>>
>>> Here is my code:
>>>
>>> <xforms:repeat nodeset="instance('search-Data')/search" id="search-
>>> repeat">
>>>                           <tr>
>>>                               <td>
>>>                                   <xforms:select1 ref="./@Name">
>>>                                       <xforms:item>
>>>                                           <xforms:label>
>>>                                               Choose One Please
>>>                                           </xforms:label>
>>>                                           <xforms:value></
>>> xforms:value>/>
>>>                                       </xforms:item>
>>>
>>>                                       <xforms:item>
>>>                                           <xforms:label>
>>>                                               Category
>>>                                           </xforms:label>
>>>                                           <xforms:value>category</
>>> xforms:value>/>
>>>                                       </xforms:item>
>>>                                       <xforms:item>
>>>                                           <xforms:label>
>>>                                               Something1
>>>                                           </xforms:label>
>>>                                            
>>> <xforms:value>something1</xforms:value>
>>>                                       </xforms:item>
>>>                                       <xforms:item>
>>>                                           <xforms:label>
>>>                                               Something2
>>>                                           </xforms:label>
>>>                                            
>>> <xforms:value>Something2</xforms:value>
>>>                                       </xforms:item>
>>>                                   </xforms:select1>
>>>                               </td>
>>>
>>>                               <td class="form-td">
>>>                                   <xforms:input ref=".
>>> [instance('search-Data')/search/@Name='something1' or  
>>> instance('search-Data')/search/@Name='Something2']/@textValue">
>>>                                   </xforms:input>
>>>
>>>                                       <xforms:select1 ref=".
>>> [instance('search-Data')/search/@Name='category']/@textValue">
>>>                                           <xforms:item>
>>>                                               <xforms:label>
>>>                                                   Choose One Please
>>>                                               </xforms:label>
>>>                                               <xforms:value></
>>> xforms:value>/>
>>>                                           </xforms:item>
>>>                                           <xforms:item>
>>>                                               <xforms:label>
>>>                                                   Cat1
>>>                                               </xforms:label>
>>>                                               <xforms:value>none</
>>> xforms:value>/>
>>>                                           </xforms:item>
>>>                                           <xforms:item>
>>>                                               <xforms:label>
>>>                                                   Cat2
>>>                                               </xforms:label>
>>>                                               <xforms:value>cat2</
>>> xforms:value>
>>>                                           </xforms:item>
>>>
>>>                                       </xforms:select1>
>>>                               </td>
>>> ...
>>> ...
>>> ..
>>>
>>> The thing is, that when the user wants to search for an category,  
>>> I don´t want him to type in the category into an textfield...He  
>>> should be able to chose one category from another select1...
>>>
>>>
>>> Please, I can´t find a way out of this...
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> 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
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: select1 depending on xpath expression

masjab-2
Erik,

thank you soooo much!!!
It´s working now and step by step it´s getting better/easier to  
understand (Orbeon)XFORMS =)!

While I was making this search.xhtml I was wandering several times if  
it´s possible to do the following;

- if the user chose for instance "something1" (which should only occur  
max one time, defined in a "search.xsd" )
- then he clicks on "+" and in the new row "something1" is not  
available anymore in the "select1" because the search.xsd file give  
the restriction...

I absolutely  do not know if this is possible but maybe you can give  
me a hint...


THX again!
Mase



Am 03.06.2008 um 18:27 schrieb Erik Bruchez:

> Try simply:
>
> <xforms:input ref=".[@name = 'something1' or @name = 'Something2']/
> @textValue">
>
> or even:
>
> <xforms:input ref=".[@name = ('something1', 'Something2')]/
> @textValue">
>
> and:
>
> <xforms:select1 ref=".[@name='category']/@category">
>
> Note that I found a bug with the recent nightlies that prevented  
> this to work properly. That's now fixed. But 3.6 probably worked.
>
> -Erik
>
> On Jun 3, 2008, at 2:07 PM, Masen J wrote:
>
>> HEY ERIK,
>>
>> thx for your help!
>> Here is a modified "search.xhtml" file to work in the sandbox.
>> The thing is that it does not work for 100% because when a row is  
>> repeated no labels are inside the select1...
>>
>> But my problem is still the same because when you choose first  
>> "something1" and then click on "+" and then choose "category" in  
>> the first row where "something1" was selceted before, a select1  
>> appears in the second row,too..
>>
>> Sounds horrible, I know...
>>
>>
>> <search.xhtml>
>>
>>
>>
>>
>> Am 03.06.2008 um 06:47 schrieb Erik Bruchez:
>>
>>> Just glancing at it it should work. Can you provide an entire XHTML
>>> +XForms file running in the sandbox so we can look at it?
>>>
>>> -Erik
>>>
>>> On Jun 2, 2008, at 2:05 AM, Masen J wrote:
>>>
>>>> Hello,
>>>> I need some help with this one, it´s drivin me crazy...
>>>>
>>>> I want to make a search-page where the user can choose from a  
>>>> select1 what to search for.
>>>> Then, depending on what he chose, an <input> or maybe another  
>>>> <select1> appears in the same row.
>>>> This can be repeated...
>>>>
>>>> It´s almost working but here is my problem:
>>>> When my xpath expression gets "true" after some rows are  
>>>> repeated, everything get´s visible then...
>>>> I mean, I only want an <xforms:input> to be visible in a specific  
>>>> row, where an xpath expression looks for the value chosen in the  
>>>> select1(but in the same row)
>>>>
>>>> Here is my code:
>>>>
>>>> <xforms:repeat nodeset="instance('search-Data')/search"  
>>>> id="search-repeat">
>>>>                          <tr>
>>>>                              <td>
>>>>                                  <xforms:select1 ref="./@Name">
>>>>                                      <xforms:item>
>>>>                                          <xforms:label>
>>>>                                              Choose One Please
>>>>                                          </xforms:label>
>>>>                                          <xforms:value></
>>>> xforms:value>/>
>>>>                                      </xforms:item>
>>>>
>>>>                                      <xforms:item>
>>>>                                          <xforms:label>
>>>>                                              Category
>>>>                                          </xforms:label>
>>>>                                          <xforms:value>category</
>>>> xforms:value>/>
>>>>                                      </xforms:item>
>>>>                                      <xforms:item>
>>>>                                          <xforms:label>
>>>>                                              Something1
>>>>                                          </xforms:label>
>>>>                                          
>>>> <xforms:value>something1</xforms:value>
>>>>                                      </xforms:item>
>>>>                                      <xforms:item>
>>>>                                          <xforms:label>
>>>>                                              Something2
>>>>                                          </xforms:label>
>>>>                                          
>>>> <xforms:value>Something2</xforms:value>
>>>>                                      </xforms:item>
>>>>                                  </xforms:select1>
>>>>                              </td>
>>>>
>>>>                              <td class="form-td">
>>>>                                  <xforms:input ref=".
>>>> [instance('search-Data')/search/@Name='something1' or  
>>>> instance('search-Data')/search/@Name='Something2']/@textValue">
>>>>                                  </xforms:input>
>>>>
>>>>                                      <xforms:select1 ref=".
>>>> [instance('search-Data')/search/@Name='category']/@textValue">
>>>>                                          <xforms:item>
>>>>                                              <xforms:label>
>>>>                                                  Choose One Please
>>>>                                              </xforms:label>
>>>>                                              <xforms:value></
>>>> xforms:value>/>
>>>>                                          </xforms:item>
>>>>                                          <xforms:item>
>>>>                                              <xforms:label>
>>>>                                                  Cat1
>>>>                                              </xforms:label>
>>>>                                              <xforms:value>none</
>>>> xforms:value>/>
>>>>                                          </xforms:item>
>>>>                                          <xforms:item>
>>>>                                              <xforms:label>
>>>>                                                  Cat2
>>>>                                              </xforms:label>
>>>>                                              <xforms:value>cat2</
>>>> xforms:value>
>>>>                                          </xforms:item>
>>>>
>>>>                                      </xforms:select1>
>>>>                              </td>
>>>> ...
>>>> ...
>>>> ..
>>>>
>>>> The thing is, that when the user wants to search for an category,  
>>>> I don´t want him to type in the category into an textfield...He  
>>>> should be able to chose one category from another select1...
>>>>
>>>>
>>>> Please, I can´t find a way out of this...
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>
>>
>> --
>> 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


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