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 / February 2007

Tip: Looking for answers? Try searching our database.

Drop-down list resetting when filtering secondary datasource

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sirwally - 16 Feb 2007 23:29 GMT
This is odd.  I have a drop-down list that is populated from a secondary
datasource.  In this case, a participant's ID is the value and their name is
what is displayed.  I want to store their name in another main datasource
element, so I created a rule that finds the matching element in the same
secondary datasource to which the drop-down is bound by filtering on the ID.  
However, when an item is selected the drop-down just resets to the first
(blank) item, and the other element is never set to anything.

Here is the XPath being used:

xdXDocument:GetDOM("Participants - Requesting
Managers")/dfs:myFields/dfs:dataFields/dfs:Participants_-_Requesting_Managers/@Name[../@BadgeID
=
xdXDocument:get-DOM()/my:AFE/my:GeneralInformation/my:RequestingManagerBadgeID]

I'm confused.  I've searched everywhere but all I have found was an example
of how to do exactly what I did
(http://blogs.msdn.com/infopath/archive/2004/09/10/227972.aspx), and
apparently it should work...Hopefully this is one of those times when I end
up slapping my forehead when I find the problem ;-)

Anyone have any ideas?

On a side note, I hope that InfoPath 2007 creates more efficient filters.  
i.e.

xdXDocument:GetDOM("Participants - Requesting
Managers")/dfs:myFields/dfs:dataFields/dfs:Participants_-_Requesting_Managers[@BadgeID
=
xdXDocument:get-DOM()/my:AFE/my:GeneralInformation/my:RequestingManagerBadgeID]/@Name

While this works the same way, it breaks the GUI, which will no longer see
the filter.  No biggie, but I have actually run into situations where this
can make a huge performance difference.
Greg Collins [InfoPath MVP] - 20 Feb 2007 17:24 GMT
A drop-down list has a display value and a stored value... sounds like your stored value is not pulling an actual value, which is why blank is being selected.

For your side note, I don't believe that has been fixed, nor will any time soon. Sorry - a complaint of mine too!!

Signature

Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )

sirwally - 20 Feb 2007 21:15 GMT
I _think_ the problem is because of when the item in the drop-down is
actually selected.  I could not for the life of me make this work (either via
a rule on the drop-down or via an expression in the target element).  What I
ended up doing was using the onAfterChange() event of the drop-down instead
and wrote code to do it, which works perfectly.  It appears that when the
rule fired the value of the drop-down was still blank, indicating to me that
the item selection had not yet been finalized.

Shame about the side note :-(

Thanks Greg :-)

Simon.

> A drop-down list has a display value and a stored value... sounds like your stored value is not pulling an actual value, which is why blank is being selected.
>
> For your side note, I don't believe that has been fixed, nor will any time soon. Sorry - a complaint of mine too!!
Greg Collins [InfoPath MVP] - 23 Feb 2007 17:31 GMT
I'm glad you got it working with code. Just as a follow up, rules fire AFTER the change is complete. So the new value should be available to the rule. Not sure what the issue was with that for you.

Signature

Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )

 
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.