Repeating radio button - InfoPath Dev
in

InfoPath Dev

Repeating radio button

Last post 04-19-2007 01:02 PM by caudet. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-13-2007 12:47 PM

    • caudet
    • Not Ranked
    • Joined on 04-13-2007
    • Canada
    • Posts 6

    Repeating radio button

    Hi,

    I'm building a form based on data coming from a XML file as a secondary data source. In the xml, one of the elements, a text string, populate a repeating section in the form. I'm trying to associate a radio button group from the primary data source in the repeating section. So if there are 5 elements from the secondary data source xml, 5 independent radio button groups will be generated and the primary data source will save 5 elements (the radio button choices) in the final xml file.

    I can I do that? So far I only succeed in having a single radio button that gets copied in the repeating section, so if I change the first, they all change. Not really useful. Any idea where I should go from there?

    Thanks.

    Charles
  • 04-15-2007 08:44 PM In reply to

    Hello and welcome to our forums! I think I understand where you're going but there could be a few causes for the issue. Could you paste in the key fragment of the secondary datasource XML? I'm wondering if that's not actually a repeating structure which is why InfoPath is treating it as a single option that is getting copied in your repeater. Also, I think in your second paragraph you mean that you end up with multiple sets of radio buttons (one set in each section) but changing the radio selection in one section changes it in all sections. Is that correct?
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-17-2007 06:17 AM In reply to

    • caudet
    • Not Ranked
    • Joined on 04-13-2007
    • Canada
    • Posts 6

    Hi!

    Here is the fragment from the secondary datasource XML:
       <Article img="img article" titre="titre article">
        <Regle>1 example de titre de regle</Regle>
        <Regle>2 example de titre de regle</Regle>
        <Regle>3 example de titre de regle</Regle>
       </Article>

    The "Regle" elements constitute the repeating structure. It’s also has 3 other repeating sections, each containing the following section(s), so section 1 contain sections 2,3 and 4 section 2 contains section 3 and 4; section 3 contains section 4, section 4 is the XML text I’m showing you. But I don't think it has an effect on the solution.

    In the "Regle" repeating structure, I’m trying to associate a radio buttons group to each of the regle elements. So the user will chose an associated button for each of the lines. You understood right, I end up with multiple sets of radio buttons (one set in each section) but changing the radio selection in one section changes it in all sections.

  • 04-17-2007 08:43 PM In reply to

    You mentioned that this fragment you've pasted in is in the secondary DOM. That could be the issue. How did you create the UI? Is the repeating section in your view bound to the "Regle" node and the radio button set bound to the regle node? What's likely happening is that the radio button set is bound to the regle node but because the context for your outer repeating section is not also in the same regle repeating context, it just binds to the first regle instance.

    Does this help explain it?

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-18-2007 07:50 AM In reply to

    • caudet
    • Not Ranked
    • Joined on 04-13-2007
    • Canada
    • Posts 6

    Here is the part of the secondary XML generating the repeating sections. I simplified it by removing some elements but they all generate a repeating section:

    <TitreBande texte="Bande numero 1">
     <TitreSection texte="Section numero 1">
      <Article img="img article" titre="titre article">
       <Regle>1 example de titre de regle</Regle>
      </Article>
     </TitreSection>
    </TitreBande>

    I created the UI from the elements in the secondary XML data source. The repeating section is bound to the "Regle" node, but how could I bind a radio button set from the primary data source to the "regle" node? I don't understand the last part about the context. It seems to me that the "Regle" context is part of the outer repeating sections context, not the other way around.

    My problem is probably with the radio button binding to the "Regle" element, but I’ve tried a lot of way of doing it and nothing seems to work. Any tip is much appreciated. Thanks!

  • 04-19-2007 09:24 AM In reply to

    I tried to recreate this in the Designer and get it to work. Below are screen shots of how I did it (designer/editor). As you can see in my preview picture, the radios operate independently regardless of the section they're in.

    Post 19179 Designer Example

    Designer: http://www.infopathdev.com/photos/blog_pictures/images/19218/original.aspx
    Preview: http://www.infopathdev.com/photos/blog_pictures/images/19219/original.aspx

    Does this make sense?

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-19-2007 12:50 PM In reply to

    • caudet
    • Not Ranked
    • Joined on 04-13-2007
    • Canada
    • Posts 6

    Hi!

    It seems I have a problem. When I add the radio-button group and bind it to the element in the primary data source it keep telling me the element is not repeatable. I'm beginning to think the problem is with my primary data source since my secondary is pretty much similar to you.

    I'm including screenshot of the designer, preview and primary data source inthe following links:

    Link to the album if the previous links are broken
    http://public.fotki.com/ex-Infoman/lgs/designer.html


    Thanks you for your continuing support.

     Charles

     

  • 04-19-2007 01:02 PM In reply to

    • caudet
    • Not Ranked
    • Joined on 04-13-2007
    • Canada
    • Posts 6

    Hi!

     It seem my problem is with the primary data source, since the secondary is similar to yours. When I insert the radio-button group and try to bind it with the repeating element in the primary data source, Infopath say it's not a repeating element and will bind it to the first iteration of the repeating section. But my element, "choix", is not max bound, so I'm quite lost here.

    I include the designer, preview and primary datasource screenshot in the following album to show you what I mean:

    Thank you for your continuing support.

     Charles

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.