Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2006

Tip: Looking for answers? Try searching our database.

Cascading listbox entries on a repeating section

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
InfoHound - 07 Apr 2006 19:44 GMT
I had a breakthrough with populating a secondary listbox based on a user
selection in a primary listbox.  Both boxes are on a repeating section and
the functionality works great, but only for the first instance of the
repeating controls.  

When I click the repeating section to add a second set of entries, another
instance of the two listboxes appears (good). if I choose a different
selection in the new primary listbox, the new secondary listbox is populated
with items from both the first instance of the secondary listbox (where it
worked great) as well as the items that are filtered in second instance of
the secondary listbox (this is bad).  

So, SeconaryListbox(2) = SecondaryListbox(1) + SecondaryListbox(2).

This is hard to describe, I hope the question is understandable: "How do I
prevent this listbox-content-addition from occuring?"

My form is bound to a database.  Thank you for any advice.
Greg Collins [InfoPath MVP] - 11 Apr 2006 00:22 GMT
Check out my tutorials on repeating cascading lists:

Create a Repeating Cascading List from a Flat Data Source
http://www.infopathdev.com/howto/tutorials/default.aspx?i=075c4e8e56db4fa5bd6361
5b712c0d91


Create a Repeating Cascading List from a Hierarchical Data Source
http://www.infopathdev.com/howto/tutorials/default.aspx?i=9f6fda3a14c14ac4924cf0
a382928432


Signature

Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com

I had a breakthrough with populating a secondary listbox based on a user
selection in a primary listbox.  Both boxes are on a repeating section and
the functionality works great, but only for the first instance of the
repeating controls.  

When I click the repeating section to add a second set of entries, another
instance of the two listboxes appears (good). if I choose a different
selection in the new primary listbox, the new secondary listbox is populated
with items from both the first instance of the secondary listbox (where it
worked great) as well as the items that are filtered in second instance of
the secondary listbox (this is bad).  

So, SeconaryListbox(2) = SecondaryListbox(1) + SecondaryListbox(2).

This is hard to describe, I hope the question is understandable: "How do I
prevent this listbox-content-addition from occuring?"

My form is bound to a database.  Thank you for any advice.
InfoHound - 11 Apr 2006 22:03 GMT
Greg,

Thanks so much for your help.  Your tutorials are very well constructed.  I
created the form with the three hierarchical listboxes and it works great.

Now I'm trying to apply the concept to my own form.  I think I'm getting
mired in how to refer to a particular node of the data source.  

The way I got my list boxes to work one-time-only was to make a reference
from my dependent listbox (which uses a secondary datasource) to the parent
field in my main datasource (a datafield from main, since my form is used for
submitting to a database).  

I'm trying to apply the current() function, but I'm not sure how to refer to
the main datasource, group and target node.  Can you provide any further
direction?

> Check out my tutorials on repeating cascading lists:
>
[quoted text clipped - 22 lines]
>
> My form is bound to a database.  Thank you for any advice.
Greg Collins [InfoPath MVP] - 18 Apr 2006 19:18 GMT
The current() function isn't always easy to understand -- not the function itself, but what it represents. The current() function represents the node that you are currently prossessing in the XSL. But it is sometimes confusing what node that is.

Typically if you are using current() within a repeating node, it will represent the specific instance of that repeating node being displayed/workd with. And if you are using it within a particular node, it represents that specific node. Sometimes its not as straight forward as that, and I often get confused myself. I typically use trial and error, though I guess I could open the XSL file and see exactly where I'm at when I'm using it.

One you have your current node, then you following it with a regular XPath just like you would if you were using the dot node (i.e. "." -- which is another representation of current() used in different circumstances).

Have I confused you yet? Hopefully not.

So if you have a schema like:

myFields
 group1
   group2
     field1
     field2
     group3
       field4

and current() represents group2, and you want to reach field2 you would use:

current()/field2

if current() represents field4 and you want to reach field2, you would use:

current()/../../field2

Make sense? Hopefully. Good luck!

Signature

Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com

Greg,

Thanks so much for your help.  Your tutorials are very well constructed.  I
created the form with the three hierarchical listboxes and it works great.

Now I'm trying to apply the concept to my own form.  I think I'm getting
mired in how to refer to a particular node of the data source.  

The way I got my list boxes to work one-time-only was to make a reference
from my dependent listbox (which uses a secondary datasource) to the parent
field in my main datasource (a datafield from main, since my form is used for
submitting to a database).  

I'm trying to apply the current() function, but I'm not sure how to refer to
the main datasource, group and target node.  Can you provide any further
direction?

"Greg Collins [InfoPath MVP]" wrote:

> Check out my tutorials on repeating cascading lists:
>
[quoted text clipped - 3 lines]
> Create a Repeating Cascading List from a Hierarchical Data Source
> http://www.infopathdev.com/howto/tutorials/default.aspx?i=9f6fda3a14c14ac4924cf0
a382928432
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.