Using radio button to select value from repeating table - InfoPath Dev
in

InfoPath Dev

Using radio button to select value from repeating table

Last post 10-06-2011 11:40 AM by gdgonzal. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 10-03-2011 08:59 AM

    Using radio button to select value from repeating table

    Hi,

     I have a repeating tbl from a data source which I've added a radio button to (myradiobutton).  I am using a drop down from a secondary data source to run a query which yields several results within my repeating tbl,  I have the radio button selected by default and this results in only one record result being selected.  I would now like to have a text box display the selected record (a specific column within the record), how can I do this?

    Filed under:
  • 10-04-2011 02:40 PM In reply to

    Re: Using radio button to select value from repeating table

    Well I've looked around and can't seem to find exactly what I am looking for...can someone please chime in or point me in the right direction?  Thanks

  • 10-04-2011 02:45 PM In reply to

    Re: Using radio button to select value from repeating table

    Could you maybe attach a sample with a bit more information on what you are trying to do? You can post a sample under the Options tab of your reply - it is just really hard for me to picture what you need to do. Thanks!

    Hilary Stoupa

  • 10-04-2011 07:07 PM In reply to

    Re: Using radio button to select value from repeating table

    Sure, please excuse the black boxes I had to sanatize this a bit.   So what I am trying to describe is I run this query and I receive several rows of data within a repeating tbl that meet the query's criterion.  Then I have added a radio button to this repeating tbl (my:SelectedRecord) so that no more than one record can have it selected at any given time by using "This button is selected by default".  Whichever record is selected by the radio button I want that value (in this case the "Key Field" to display in a text box). 

     In case you are wondering what I can trying to accomplish I would then using some jscript I have to pass the text box value from this form to another; then this other form would pull up this fullly detailed individual record.  The end result wouldn't display the text box at all...but I want to see this work first and then hide it later for the effect I am looking for.  From the user perspective, they would select their record using this control (or another); click on a button and that full record would display.  All the while this form would then close, pass the parameter and the full record would open in another form.  I have this all sorted out, except for this last bit which I cannot seem to wrap my mind around.

    Now I am not married to the radio button, I really don't have any preference when it comes to controls...whichever control works, makes no difference to me.

    BTW, thank you for responding.  :) 

     


  • 10-05-2011 08:06 AM In reply to

    Re: Using radio button to select value from repeating table

    Can you attach a screenshot of your main data source? That shows the SelectedRecord field?

    And what are the possible values for the radio buttons?

    My guess would be you could just set a rule on the radio button control with the condition that whenever the field that is bound to it is equal to the value the control has when it is selected (dear me, that was some awkward phrasing!) that sets the value of the text box to the current instance of the repeating node's Key Field.....

    Hilary Stoupa

  • 10-05-2011 08:18 AM In reply to

    Re: Using radio button to select value from repeating table

    Hello gdgonzal,

    in my personal opinion you can“t accomplish this without using code. If you are trying to obtain the value from the Changed event of a control in a repeating table, it requires a little more code. Maybe the following link can help you to accomplish this task.

    http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/35a851b3-8a55-4647-bcc7-78f127d5fc0a/

    Regards,

    Karsten
  • 10-05-2011 11:36 AM In reply to

    Re: Using radio button to select value from repeating table

    Sure Hilary...here you go.  I was thinking I could also do this with rules and I've played around but cannot get this to work

     

     


  • 10-05-2011 11:49 AM In reply to

    Re: Using radio button to select value from repeating table

    Yeah, you won't be able to, I think - the SelectRecord field is outside of the repeating group - there is no way to know which "Key Field" was selected. Do you own the database tables? Can another field be added to the table?

    Hilary Stoupa

  • 10-05-2011 01:52 PM In reply to

    Re: Using radio button to select value from repeating table

    Yes, I can add something if needed. 

  • 10-06-2011 07:48 AM In reply to

    Re: Using radio button to select value from repeating table

    I think that's what I'd do in this scenario - add another field to your table, a placeholder, called Selected or something. Then walk through the data connection wizard again to update the form data source. Then you should be able to bind a control to it - with the control in the same repeating node as the Key Field, it is easy to get the value of the Key Field in a rule.

    However, you may still have some challenges - you only want the user to be able to select one, right? So that might be tricky - I'm not sure w/out actually trying this out myself.

    Hilary Stoupa

  • 10-06-2011 08:37 AM In reply to

    Re: Using radio button to select value from repeating table

    OK, let's assume I do this; could you please provide an example of this rule?

  • 10-06-2011 08:56 AM In reply to

    Re: Using radio button to select value from repeating table

    You know what? I'm being silly.

    Why not just use a regular button? It would work fine, and you wouldn't have to change your data source. I'm attaching a simple sample - right click the link in the post heading, save the template locally, right click the saved file, open in design mode and preview.

    Hilary Stoupa

  • 10-06-2011 10:07 AM In reply to

    Re: Using radio button to select value from repeating table

  • 10-06-2011 11:40 AM In reply to

    Re: Using radio button to select value from repeating table

    Perfect!  It works great, Thank you so much!  :)

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