radio buttons in a repeating section - InfoPath Dev
in

InfoPath Dev

radio buttons in a repeating section

Last post 09-21-2009 08:26 AM by Alec Pojidaev. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 02-06-2008 08:28 AM

    radio buttons in a repeating section

    Hi,

     

    I am new to InfoPath 2007 and have never used InfoPath 2003.

     

    I am trying to create a form in which a list is populated from an xml file. The idea being the user can only select one option. I originally tried to bind a drop down list but this failed.

    So, I am now trying to use a repeating section with a radio button in each one. However, the radiobuttons never have the correct text applied. But when I use a textbox instead, the text is fine.

    Also, is there a way to ensure that users can select one and one only as at the moment all the radio buttons can be selected but not unselected.

     

    I'd appreciate any help at all.

     

    Thanks in advance

     

  • 02-06-2008 12:40 PM In reply to

    Re: radio buttons in a repeating section

    Welcome to the forum.

    Give us a breif explanation of what you are trying to do and then we can give you some architecture / layout suggestions.

    It sounds like you want to allow users to pick from a list and then display details for their choice.

  • 02-07-2008 03:32 AM In reply to

    Re: radio buttons in a repeating section

    Hi,

     

    I have an xml file which may change in future.

    So, I am trying to find a way to create a radio group bound to the file. This is so, users can select one and one only radio button. Like I said above, when I try to create a radio group normally it keeps asking for me to specify how many buttons I need - well this is surely dependent on the xml file. I tried using repeating section with a radio button inside but

    a - the users can select more than one button

    b - the text of the button is not bound to the string in the xml file. Though if I change the radio button inside the repeating section to a textbox, the text is picked up from the xml file.

     

    I need this to work on a browser based form. I'm really struggling with this and appreciate any help you could give.

     

    thanks

  • 02-07-2008 07:09 AM In reply to

    Re: radio buttons in a repeating section

    You would need to do your own validation in order to ensure that only one repeating node was selected.

    The easiest way is to have them pick with a dropdown since it only allows one selection.

    You can bind a radio control to a flag field in your data however you would have to monitor the selections and prompt users if they tried to select more than one, which would get tricky.

    You could clear selections each time.  Put a button in the repeating table or section and as sson as they select it sets a flag and takes them to another view which only shows there selection.  If they need to change their selection then they would return and all would be available again.  Does the selection need to persist over time?

    I do not think the radio button control, since you can not have it go across repeating nodes, is really relevant. You could use a check or probably a button is the best thing.  Button Rule actions would save the node ID and Switch them to a seperate view.

  • 02-13-2008 02:21 AM In reply to

    Re: radio buttons in a repeating section

    Hi,

     

    I've decided to dispense with the radio button idea and use a drop down. The problem is its not binding properly. By that I mean, I get no error message when setting up the binding or when I preview the page. (I create the binding by dragging the field from the data source pane onto my form and then changing it to a drop down list) But when I go to the drop down to make a selection none of my values in my xml file appear.

     

    This is my xml file:

    <?xml version="1.0" encoding="utf-8"?>
        <servers>
            <server>
                <name>Test01</name>
                <DB_instances>
                    <DBInstance>2000</DBInstance>
                    <DBInstance>2005</DBInstance>
                </DB_instances>
            </server>
            <server>
                <name>Test02</name>
                <DB_instances>
                    <DBInstance>2000</DBInstance>
                    <DBInstance>2005</DBInstance>
                </DB_instances>
            </server>
        </servers>   
        

    Its just a test file and I am trying to bind it to "name" and then eventually have another drop down with the DB_instances for that server name

     

    I cannot believe how difficult it is to this in InfoPath. I could do this in ASP.NET in a flash but my boss insists on InfoPath. 

     

    Does anyone know how I can do this?

     

    Many thanks 

  • 02-13-2008 06:31 AM In reply to

    Re: radio buttons in a repeating section

    This should be simple in InfoPath once you get used to it.

    Verify that your sample XML here is available in your form's data source.

    The drop down should be bound to a field in your main repeating section, typically where name will be stored in your record.

    Then double click the drop down and in the lower half is list box entries.

    select look up values from an external data source and pick the data connection to your sample xml above

    Then browse it to select the name field.

    Preview and you will find that your dropdown has the values from the names in your xml and when selected they are stored in the bound field in your repeating section.

    For the next "cascading" dropdown you would have the same procedure but when picking the dbinstance in the drop down properties add a filter where name = the field your first dropdown is bound to.

  • 02-13-2008 06:41 AM In reply to

    Re: radio buttons in a repeating section

    cheers for the info. Managed to get it sort of working, it took me a while.

     As my form will be browser based I can't use filters (no idea why because filters exists in web form normally)

    Thanks for all your help
     

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