InfoPath DropDown List doesn't match on items in list

When populating InfoPath DropDown lists with values and then binding the dropdown to a field in your main datasource you'll sometimes see the bound value instead of its corresponding text value in the dropdown on load. It seems slightly confusing given that the entry containing your bound value is actually in the list, but it doesn't match.

Most likely this is a string casing problem. I've got a dropdown bound to a Sharepoint (WSS) UserGroup service and bind the value to @LoginName. These values are typically DOMAIN\login.name. My main datasource however, lowercases all reference variables to avoid any confusion. Since I don't control the formatting done by the Sharepoint service my best bet is to lowercase the values of the @LoginName attributes in my secondary datasource.

First off I got excited by this post on the InfoPath Blog which feels a bit like calling C# or javascript code from regular XSLT transformations. The blog describes calling code to evaluate conditions, not setting DOM values, and furthermore there are no events you can respond to in order to call the code that will manipulate your secondary datasource values and setting them toLower.

Since I query my UserGroup service on form load, and this occurs before the Load event in script I was able to perform toLower (or more precicely toLowerCase()) in the load event like this:

var objXMLNodes = XDocument.GetDOM("UserService").selectNodes(//@LoginName);
for(i = 0; i < objXMLNodes.length; i++)
{
      objXMLNodes(i).text = objXMLNodes(i).text.toLowerCase();
}

Filed under:

Comments

# 6436 said:

45364356

Monday, May 28, 2007 9:07 AM
# Sheldon said:

Badly need your help. The aim of life is self-development. To realize one's nature perfectly - that is what each of us is here for. Help me! It has to find sites on the: Power trading corporation share value. I found only this - <a href="leadership.nlada.org/.../ShareTrading">india online share trading</a>. Shares of ideology can almost be classified ultimately from video deals on the construction, share trading. Share trading, the common line of money in the broker market is to commit the share of program stocks, futures, and strong frames. Best regards :mad:, Sheldon from Egypt.

Tuesday, March 23, 2010 8:46 PM