How to access the Display Name property of a dropdown box?

D

Dave

It seems that the main DOM stores the 'Value' property of my dropdown
listbox in the XML (ex: employeeID). How do I also store the 'Display
Name' into the DOM as it's own node? (ex: employeeName)

Follow up question: Can you make the 'Display Name' property a concat
of multiple fields? ex: My data connection for the listbox doesn't
actually have a fullname field, it only has separate firstname and
lastname columns. I'd like to concat them together to show the user the
employee's fullname. AFAIK, my only alternative is to go back and edit
the SQL that returns the data so that a new column exists, then specify
this new column in the Display Name property.
TIA for your time and help.
 
M

Matthew Blain \(Serriform\)

To concat the values, you'll probably have to do custom XSL. Or custom XML
(have a new node which InfoPath sets which has the calculated value). I
don't have an example of either handy, but they're probably both out there
somewhere. The XSL is pretty straightforward once you understand a bit of
XSL and how to use xd:preserve blocks with InfoPath.

Another way to copy values from your list instead of rules is to use a
default value:
http://tips.serriform.com/CopyDropdownSP1.htm

--Matthew Blain
http://www.developingsolutionswithinfopath.com

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
You will need another node to store the display name. Then add a rule to the
drop-down list box that populates that node with the display name when the
value changes.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



It seems that the main DOM stores the 'Value' property of my dropdown
listbox in the XML (ex: employeeID). How do I also store the 'Display
Name' into the DOM as it's own node? (ex: employeeName)

Follow up question: Can you make the 'Display Name' property a concat
of multiple fields? ex: My data connection for the listbox doesn't
actually have a fullname field, it only has separate firstname and
lastname columns. I'd like to concat them together to show the user the
employee's fullname. AFAIK, my only alternative is to go back and edit
the SQL that returns the data so that a new column exists, then specify
this new column in the Display Name property.
TIA for your time and help.
 
D

Dave

THANK YOU! The example you included
(http://tips.serriform.com/CopyDropdownSP1.htm) was a great help and it
filled in the missing piece of the puzzle, perfectly. The part that I
hadn't understood was that I could apply a filter when specifying the
value for the extra node. In my particular situation it ended up being:

@emp_name[@emp_id = EmpID]

Where @emp_name and @emp_id come from the secondary data source and
EmpID comes from the main DOM.

Thank you both.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top