Comma Delimited Attribute Value - InfoPath Dev
in

InfoPath Dev

Comma Delimited Attribute Value

Last post 03-08-2005 11:48 PM by Patrick Halstead. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-01-2005 07:43 AM

    • artika
    • Not Ranked
    • Joined on 02-28-2005
    • Posts 3

    Comma Delimited Attribute Value

    why is it that everytime i start a new technology i try to do something ,i think , basic, and i end up finding the limitations right away :-(

    Can someone tell me if there is a way to Create list of hard-coded item i.e

    red
    black
    yellow

    and have the user elected one or more of the items(colors) and have it written back to my xml doc in the form of

    <attributename>="red,black"

    if red and black were selected


    i basically have an xml page that i generate a HMTL menuing system off of and wo9uld like to make an interface for regular administrators to use so they can edit the tree without XML knowledge. Is this crazy?

    my node:
    <leaf colors="red,black">First Leaf</leaf>


    thanks in advance

    my email: [email protected]
  • 03-01-2005 09:26 AM In reply to

    Re: Comma Delimited Attribute Value

    Let's assume you have a repeating section/table displaying a list of colors, each with a check box next to them.

    You can write some code in the OnAfterChange event for the check box that goes through the list of colors, see which ones are selected and create a concatenated string of them, separated by commas. Then you take that concatenated string and place it in the attribute value.

    Greg Collins [InfoPath MVP]
  • 03-02-2005 03:40 AM In reply to

    • artika
    • Not Ranked
    • Joined on 02-28-2005
    • Posts 3

    Re: Comma Delimited Attribute Value

    --> repeating section/table displaying a list of colors each with a check box next to them.
    i am assuming the checkboxes are not bound and the list is statically generated (hard coded items).

    Seond part of the question. How do you access checkboxes and attributes and lists in the action script. I understand it is javascript, but is the object of these items simply its name?

    how would you determine a list of checked items in a listbox or table like you mentioned.

    thanks,

  • 03-02-2005 11:46 PM In reply to

    • artika
    • Not Ranked
    • Joined on 02-28-2005
    • Posts 3

    Re: Comma Delimited Attribute Value

    ok i figured out how to access attributes within the script, but i haven't figured out how to modify attributes based on section. right now my code to access the attribute is:

    CommaDelimColors = XDocument.DOM.selectSingleNode("//menu/headingitem/@colors").text;

    if (...)

    XDocument.DOM.selectSingleNode("//menu/headingitem/my:red").text = "True"; // checkbox to checked

    this code is in the "function XDocument::OnSwitchView(eventObj)" so it fills my checkboxes when the form loads. it works, but...


    my problem is this code's scope is not focused on the section, rather it is globally asssigning these attributes and onlt fills the first section's chekboxes and disregards other sections. this does make sense, but how do i fill the rest of the checkboxes in subsequent sections?
  • 03-08-2005 11:48 PM In reply to

    Re: Comma Delimited Attribute Value

    Hi Artika,
    Perhaps you have an XPath issue. Have you tried replacing your hardcoded xpath with a relative one? I'm not exactly sure, since I can't see your schema.
    Hope this helps!
    Patrick
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.