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 / March 2005

Tip: Looking for answers? Try searching our database.

change checkbox value when is an attribute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nick brandwood - 01 Mar 2005 13:45 GMT
is there a Best Practice method for changing a checkbox attached to an
attribute?

if my section contains the attribute "completed", a true/false attribute,

should I be using:
C#

IXMLDOMNode nodeSection=
thisXDocument.Dom.SelectNode("/my:myFields/my:section")

thisXDocument.GetNamedNodeProperty(nodeSection,'completed','no value');

or

nodeSelection.attributes.setNamedItem('completed')="1" ?

(I ask because I've not managed to get either of thse methods to work.)

thanks,

nick
nick brandwood - 01 Mar 2005 14:03 GMT
that line should read:

thisXDocument.GetNamedNodeProperty(nodeSection,'completed','no value')="1";
Greg Collins [InfoPath MVP] - 01 Mar 2005 20:13 GMT
It appears you are getting a few completely different things mixed up. GetNamedNodeProperty is entirely different, and has nothing to do with DOM Attributes.

If you want to set an attribute, you can do something like:

thisXDocument.DOM.selectSingleNode("/my:myFields/my:section/@completed").text = "{new value}"

Where {new value} is one of the two boolean values you are using (i.e. 1/0 or true/false).

Signature

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

is there a Best Practice method for changing a checkbox attached to an
attribute?

if my section contains the attribute "completed", a true/false attribute,

should I be using:
C#

IXMLDOMNode nodeSection=
thisXDocument.Dom.SelectNode("/my:myFields/my:section")

thisXDocument.GetNamedNodeProperty(nodeSection,'completed','no value');

or

nodeSelection.attributes.setNamedItem('completed')="1" ?

(I ask because I've not managed to get either of thse methods to work.)

thanks,

nick
nick brandwood - 02 Mar 2005 08:51 GMT
now I see how it works!

I had made a mistake in my xpath and given up on this route.

thanks!

nick

> It appears you are getting a few completely different things mixed up. GetNamedNodeProperty is entirely different, and has nothing to do with DOM Attributes.
>
[quoted text clipped - 26 lines]
>
> nick
nick brandwood - 02 Mar 2005 09:49 GMT
in case anyone else is reading this conversation, the correct command was:

thisXDocument.DOM.selectSingleNode("/my:myFields/my:richiesta/@my:completed").text = "1";

my:richiesta is a group with the attribute completed.
note the namespace 'my:' before the attribute name.

thanks Greg!
 
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.