Select1 control not shoing all values

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

Select1 control not shoing all values

brian_steuhl-2
I have a Select1 control that gets populated from a REST submission submitted
to eXist database.  The xquery returns the data to the instance, but I can only
see some of the values in the dropdown.  Do I have to add something else to
display a scroll bar in the drop down list?

Also, the instance inspector gets cut off and only dipslays a couple rows of
the instance?

Thank you.


--
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 control not shoing all values

Erik Bruchez
Administrator
> I have a Select1 control that gets populated from a REST submission  
> submitted
> to eXist database.  The xquery returns the data to the instance, but  
> I can only
> see some of the values in the dropdown.  Do I have to add something  
> else to
> display a scroll bar in the drop down list?

You should see all the items. How many do you have?

> Also, the instance inspector gets cut off and only dipslays a couple  
> rows of
> the instance?


Without a scrollbar?

-Erik

--
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 control not shoing all values

Brian_Steuhl
I know see all the values.  I just found out a short time ago that eXist onl sends back 10 hits by default and I found the option query to add to increase &_howmany=..
 
My new problem is that when I select from the first dropdown, the second selec1 gets loaded properly, but values for the third and final dropdown dets populated as well.  I do not have that control ties to the submission, but loading happens on everything?
 
The scenario should be:
 
Select1 value choosen - send submission to eXist to filter .xml based on select1 value and populate 2nd select1 control
 
2nd select1 value chosen and second REST submission sent with this new value to populate another instance which the 3rd select1 control nodeset would be bound to.
 
More drops down as need be.
 
Is there a better way to filter?
 
I need to choose a criminal Title number and only return Section numbers in the xml database that correspond to that Title.  Once Section is choosen, requery the database and only send subsections back that belone to that Section value.
-----Erik Bruchez <[hidden email]> wrote: -----

To: [hidden email]
From: Erik Bruchez <[hidden email]>
Date: 03/28/2008 01:21PM
Subject: [ops-users] Re: Select1 control not shoing all values

> I have a Select1 control that gets populated from a REST submission  
> submitted
> to eXist database.  The xquery returns the data to the instance, but  
> I can only
> see some of the values in the dropdown.  Do I have to add something  
> else to
> display a scroll bar in the drop down list?

You should see all the items. How many do you have?

> Also, the instance inspector gets cut off and only dipslays a couple  
> rows of
> the instance?


Without a scrollbar?

-Erik

--
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: [hidden email]
For general help: [hidden email]
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: Re: Select1 control not shoing all values

Alessandro Vernet
Administrator
Brian,

On Mar 28, 2008, at 10:35 AM, [hidden email] wrote:
> I know see all the values.  I just found out a short time ago that  
> eXist onl sends back 10 hits by default and I found the option query  
> to add to increase &amp;_howmany=..

Yes, I got caught by this one many times! If you set _howmany=0, eXist  
will return all the items (no limit).

> My new problem is that when I select from the first dropdown, the  
> second selec1 gets loaded properly, but values for the third and  
> final dropdown dets populated as well.  I do not have that control  
> ties to the submission, but loading happens on everything?

It seems that:

1) When you select something from the first drop-down, a submission  
runs, the second drop-downs gets populated.
2) At this point you have an xforms-value-changed on the second drop-
down, which triggers a submission and changes the third drop-down.

When you run the submission to update the second drop-down, in  
addition to updating the instance referenced in the itemset, you could  
set the value for the drop-down to empty string. And I guess you have  
an item for empty string with a label "[Select...]" or similar. On  
value change, you can check that this item is selected, and if it is,  
not run the submission that populates the third drop-down. Would this  
make sense?

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

Re: Re: Re: Re: Select1 control not shoing all values

Brian_Steuhl

I followed your advice and what you wrote made perfect sense.  After a little work, I got it working.  Thank you again very much.

 

Unfortunately I am following up with another question which is now the problem - specifying a cast in xquery REST submission.

 

The third drop down box is filtered based upon the value of the second.  I have to pass the value as a string since the undeclared type in the xml file is xdt:untypedAtomic.  In the eXist database I can cast as xs:string.  But when I try in the REST submission, it still fails.  Here is my submission code:

 

<xforms:submission id="section_submission" method="get" serialization="none" resource="<A href="http://localhost:8600/exist/rest/db/?_query=for $b in doc('mcc.xml')/Import/Row where $b/Section=({instance('sections')/Charge_Info/Section} cast as xs:string) return &amp;lt;Charge_Info&amp;gt;{{$b/Subsection}}&amp;lt;/Charge_Info&amp;gt;&amp;amp;_howmany=0" target=blank>http://localhost:8600/exist/rest/db/?_query=for $b in doc('mcc.xml')/Import/Row where $b/Section=({instance('sections')/Charge_Info/Section} cast as xs:string) return &lt;Charge_Info&gt;{{$b/Subsection}}&lt;/Charge_Info&gt;&amp;_howmany=0" xforms:show-progress="false" replace="instance" instance="subsections" xxforms:username="admin" xxforms:password="">

<xforms:message ev:event="xforms-submit-error" level="modal">Operation failed.</xforms:message>

</xforms:submission>

Is this able to be done within Orbeon?

The first submission (listed below) succeeds as there is no data type conflict.  The results of this submission populates the second drop down box:

 

<xforms:submission id="title_submission" method="get" resource="<A href="http://localhost:8600/exist/rest/db/?_query=for $a in doc('mcc.xml')/Import/Row where $a/Title={instance('ui')/Title} order by $a/Section return &amp;lt;Charge_Info&amp;gt;{{$a/Section}}&amp;lt;/Charge_Info&amp;gt;&amp;amp;_howmany=0" target=blank>http://localhost:8600/exist/rest/db/?_query=for $a in doc('mcc.xml')/Import/Row where $a/Title={instance('ui')/Title} order by $a/Section return &lt;Charge_Info&gt;{{$a/Section}}&lt;/Charge_Info&gt;&amp;_howmany=0" xforms:show-progress="false" replace="instance" instance="sections" xxforms:username="admin" xxforms:password="">

<xforms:message ev:event="xforms-submit-error" level="modal">Operation failed.</xforms:message>

</xforms:submission>

 

Thanks.



--
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: Select1 control not shoing all values

Alessandro Vernet
Administrator
Brian,

On Mon, Mar 31, 2008 at 10:41 AM,  <[hidden email]> wrote:
> <xforms:submission id="title_submission" method="get"
> resource="http://localhost:8600/exist/rest/db/?_query=for $a in
> doc('mcc.xml')/Import/Row where $a/Title={instance('ui')/Title} order by
> $a/Section return
> &lt;Charge_Info&gt;{{$a/Section}}&lt;/Charge_Info&gt;&amp;_howmany=0"
> xforms:show-progress="false" replace="instance" instance="sections"
> xxforms:username="admin" xxforms:password="">

I think you are missing some quotes there.

BTW, as a side-note, even if the query goes into an attribute, you can
write it over multiple lines, to make your code easier to read.

So, instead of a/Title={instance('ui')/Title}, you want to have
a/Title='{instance('ui')/Title}' (with the quotes added). Keep in mind
that {instance('ui')/Title} is replaced by the string value if the
Tile element in the query. So if the string value of Title is "foo",
you will be asking eXist to evaluate a/Title=foo, which will be
looking for a "foo" element, which most likely won't exist, hence the
comparison failing. And Title has a chance of containing a quote, you
will need to escape it.

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

Re: Re: Re: Re: Re: Re: Select1 control not shoing all values

Brian_Steuhl

Placing in the quotes does not work.  The only thing that works is if I create another instance and then do:

 

<xforms:bind nodeset="instance('conc')" type="xs:string" xmlns="" calculate="concat(&quot;'&quot;, instance('charges-instance')/charge/Agency_Charge_Code, &quot;'&quot;)"/>

 

Then use {instance('conc')} in my xquery which in the above nodeset encapsulates the value in ' '.  This is fine but when I try to do other things like add a repeat nodeset, I get an error stating that 2nd value of conc can not contain more than 1 item. 

Why does the xquery not work if I just put in where $a/something='{instance('instance_id)/....}' ?

Sorry if I did not completely understand the previous response.



--
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: Re: Select1 control not shoing all values

Brian_Steuhl
In reply to this post by Alessandro Vernet

Figured out why I was getting the concat error when trying to perform a repeat nodeset - binding was looking at 2 nodesets so I just had to instruct xpath to loook at first position [1].  So i figured that part out.

 

Thanks.



--
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: Re: Re: Select1 control not shoing all values

Alessandro Vernet
Administrator
Brian,

On Mon, Apr 7, 2008 at 12:13 PM,  <[hidden email]> wrote:
> Figured out why I was getting the concat error when trying to perform a
> repeat nodeset - binding was looking at 2 nodesets so I just had to instruct
> xpath to loook at first position [1].  So i figured that part out.

Glad you figured this one out. Is there anything else related to this
issue that is still open?

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

Re: Re: Re: Re: Re: Re: Re: Re: Select1 control not shoing all values

Brian_Steuhl

Just why enclosing the '{instance('instance_id)' does not work in the where clause of the xquery through REST to Exist, but passing an instance that has a value enclosed in single quotes does.  Thanks.



--
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: Re: Re: Re: Re: Select1 control not shoing all values

Alessandro Vernet
Administrator
Brian,

On Tue, Apr 8, 2008 at 2:43 AM,  <[hidden email]> wrote:
> Just why enclosing the '{instance('instance_id)' does not work in the where
> clause of the xquery through REST to Exist, but passing an instance that has
> a value enclosed in single quotes does.  Thanks.

This should work. If it doesn't, it is maybe because
instance('instance_id') does not return what you expect, or that the
returned result contains a quote. I would try putting a tcpmon between
Orbeon Forms and eXist to check exactly what query is going over the
wire. This way you will be able to compare the query with the inline
value (which works) with the query using an AVT (which apparently
doesn't work). I hope this helps,

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