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 / October 2006

Tip: Looking for answers? Try searching our database.

How to store value and display name of a selected item in dropdown

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Siva - 05 Oct 2006 08:02 GMT
How to store value and display name of a selected item in dropdown into
separate variables  ????

I have dropdown populated with country name as display name and country id
as value. I want to store the selected items name as well as value in
separate variables upon selection in other variables.

As far as my knowledge, we can go to rules use set a field’s value feature.
But with this I can store only value not the display name.

Pls advice.
S.Y.M. Wong-A-Ton - 05 Oct 2006 08:19 GMT
Correct, so you can easily retrieve the value of the drop-down. If your
drop-down list box is bound to a data source (XML file, database, Sharepoint
list, node in the main data source) you can use the value from the drop-down
list box to search in the secondary data source of your drop-down list box
and retrieve the value of the element or attribute bound to the display name
of the drop-down list box.

So, set up another rule, select the field (for the display name) in your
secondary data source to return AND use the "Filter Data" button on the
"Select a Field or Group" dialog box to tie the field of the drop-down list
box located in the main data source to a corresponding field in your
secondary data source.

It sounds complex, but is fairly straightforward once you get the hang of
it. Let me know if you need more assistance with this.
---
S.Y.M. Wong-A-Ton

> How to store value and display name of a selected item in dropdown into
> separate variables  ????
[quoted text clipped - 7 lines]
>
> Pls advice.
Siva - 05 Oct 2006 08:28 GMT
Hi Wong,

Sounds ok. Any other smart way to do with scripting ????

> Correct, so you can easily retrieve the value of the drop-down. If your
> drop-down list box is bound to a data source (XML file, database, Sharepoint
[quoted text clipped - 25 lines]
> >
> > Pls advice.
S.Y.M. Wong-A-Ton - 05 Oct 2006 08:38 GMT
Same concept, actually.

Retrieve the value for the drop-down list box from the main data source with
selectSingleNode, then search for the display name in the DOM of your
secondary data source by using the value of the drop-down in a filter in an
XPath expression.

Access the DOM for the secondary data source using

XDocument.DataObjects["<your_sec_data_source>"].DOM

Then use selectSingleNode with your XPath expression and filter to find the
value for the display name.
---
S.Y.M. Wong-A-Ton

> Hi Wong,
>
[quoted text clipped - 29 lines]
> > >
> > > Pls advice.
Siva - 05 Oct 2006 08:42 GMT
thanks buddy.
clean approach.
wish this will work out.

I am not strong in Xpath and XSL.
Appreciate if you could send me links for mastering the both.

> Same concept, actually.
>
[quoted text clipped - 45 lines]
> > > >
> > > > Pls advice.
S.Y.M. Wong-A-Ton - 05 Oct 2006 08:53 GMT
No need to use XSL for this. You can find info on XPath here:
http://www.w3.org/TR/xpath

Unfortunately, I do not have any samples of this on my website. If you get
stuck, just pitch out another question and someone should be able to help you
out.
---
S.Y.M. Wong-A-Ton

> thanks buddy.
> clean approach.
[quoted text clipped - 52 lines]
> > > > >
> > > > > Pls advice.
 
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.