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 / December 2004

Tip: Looking for answers? Try searching our database.

Bulleted Lists

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TrussworksLeo - 10 Dec 2004 02:45 GMT
Ok...  This maybe a really dumb question but how do I set the default
value(s) to a bulleted list?  
This is a list right?  Why is there only one value? Shouldnt it be more like
a drop down where you add multiple values?  I have a bunch of items I would
like to add to a bulleted list and hve the use be able to delete them if
needed.

Signature

Thank You, Leo

Andrew Watt [MVP - InfoPath] - 10 Dec 2004 09:49 GMT
>Ok...  This maybe a really dumb question but how do I set the default
>value(s) to a bulleted list?  
>This is a list right?  Why is there only one value? Shouldnt it be more like
>a drop down where you add multiple values?  I have a bunch of items I would
>like to add to a bulleted list and hve the use be able to delete them if
>needed.

Leo,

A list is primarily intended for an end user to enter values, rather
you prepopulating the list.

You can, however, populate the list by code in the OnLoad event to
manipulate the DOM, add nodes and assign values to those nodes.

Andrew Watt
MVP - InfoPath
TrussworksLeo - 10 Dec 2004 14:53 GMT
Thanks Andrew,

You wouldn't  by chance have an example piece of VB.Net code I could look at
would you?

I am using Managed Code in VB.Net.

Thanks,  Leo

> >Ok...  This maybe a really dumb question but how do I set the default
> >value(s) to a bulleted list?  
[quoted text clipped - 13 lines]
> Andrew Watt
> MVP - InfoPath
Andrew Watt [MVP - InfoPath] - 10 Dec 2004 15:39 GMT
When I played with it this morning this is the JScript code, I
created.

function XDocument::OnLoad(eventObj)
{
var myNode =
XDocument.DOM.selectSingleNode("/my:myFields/my:group1/my:field1[1]");
myNode.text = "Hello";
var myNS =
"http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-12-10T09:26:54"
var newNode = XDocument.DOM.createNode(1, "my:field1", myNS);
newNode.text = "World";
var myGroup =
XDocument.DOM.selectSingleNode("/my:myFields/my:group1");
myGroup.appendChild(newNode);
var newNode2 = XDocument.DOM.createNode(1, "my:field1", myNS);
newNode2.text = "Beating";
myGroup.appendChild(newNode2);
var newNode3 = XDocument.DOM.createNode(1, "my:field1", myNS);
newNode3.text = "InfoPath";
myGroup.appendChild(newNode3);
}

I am sure it can be written more elegantly.

Andrew Watt
MVP - InfoPath

>Thanks Andrew,
>
[quoted text clipped - 22 lines]
>> Andrew Watt
>> MVP - InfoPath
 
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.