how connect 2 control to each other - InfoPath Dev
in

InfoPath Dev

how connect 2 control to each other

Last post 05-11-2006 06:25 AM by shailaja. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-08-2006 11:12 PM

    • saba
    • Not Ranked
    • Joined on 04-30-2006
    • Posts 5

    how connect 2 control to each other

    Hi
    I want to have a dropdown and a checkbox list in my form that with item changing in dropdown the item of checklists also change...in the other words these 2 control are related to each other when the selected item in dropdown changed the items of checkbox list are also changed...my first question is : is it possible to do this ? and second how ?

    any clue would be highly appreciated .
  • 05-09-2006 12:31 AM In reply to

    Re: how connect 2 control to each other

    Hello Saba,
    One question that I have for you – Do you want to hide and show check boxes based on the drop down value? If yes then you can do this by having conditional formatting which is on Display tab on the section which contains check boxes. If you want to set value for check boxes based on value in dropdown then you do that by using rules which is on the Data tab in check box properties.

    Hope this helps!
  • 05-09-2006 12:35 AM In reply to

    Re: how connect 2 control to each other

    Hi,
    You can place the checkboxes in sections and show/hide those sections according to the value selected in the dropdown(Value selected is stored in the XML).
  • 05-09-2006 01:47 AM In reply to

    • saba
    • Not Ranked
    • Joined on 04-30-2006
    • Posts 5

    Re: how connect 2 control to each other

    thanks Agni and shailaja for your fast reply.
    i am very new to infopath.
    shailaja,can you please explain more about what kind of rule should i write?any example,any article would be highly appreciated.
    and let me explain more about my problem.
    i have 2 tables in a database.the value of dropdown item is a foreign key for the value of checkboxes that should appear in the page.
    the the dropdown is binded to a culomn of the first table.
    and the checkboxes should retrive their values from another table of database according to what is selected from dropdown.
    infact theres a 1 to many relationship betwwen dropdown and check boxes.can i do all of these dynamitically or should i get all the checkboxs values from database at once and then hide or display them according to the dropdown selected value.
  • 05-09-2006 08:10 AM In reply to

    Re: how connect 2 control to each other

    Hello Saba,
    How are you connected to the DB in the InfoPath form? Are they secondary Data connections or a main data connection.

    If lets say that you have two Data connections one each to each of the tables. You will need to have the following fields in your Main data source
    1. A node where the value selected in the dropdown will be stored
    2. A set of repeating nodes where we need to copy over the checkbox values which you want to show

    Now when the value is changed in the dropdown, you will get the values in the checkbox secondary DOM which are mapped to the dropdown value and insert those into the main dom. This will then show the checkboxes in the view.

    If instead of the checkbox data being in a secondary DOM, they were in the main data source then you could just show hide them using conditional formatting and not have to insert any nodes. Because the data is coming from the database and change change regularly, you would have to insert the nodes.

    Hope this helps! Please let me know if I totally misunderstood what you want to do :)
    Shanthi Reddy
  • 05-09-2006 09:52 PM In reply to

    • saba
    • Not Ranked
    • Joined on 04-30-2006
    • Posts 5

    Re: how connect 2 control to each other

    hello,
    thanks shailaja for your rapid reply.
    yes,you got me correctly.im using secondary data connections to get the value of dropdown and checkboxes from Database.
    but infact im really new to infopath.can you please explain more about "nodes" ,what are they refering to?and how to create them?its the first time im hearing about nodes.
    is it possible for you to explain me with more details(step by step) or perhaps giving me an example?
    i would highly appreciat your kind help.
    thank you very much
  • 05-10-2006 10:08 PM In reply to

    Re: how connect 2 control to each other

    Hi saba,

    when you save infopath form , it will be saved as xml file,
    All fields in infopath are called nodes in xml file,
    In infopath , we use DOM(Document object Model) to do operations on particular nodes(field) using Xpaths,
    we can add fields manually in datasource and through secondary dataconnection.

    I hope this will help you,
    Thganks.
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 05-11-2006 06:25 AM In reply to

    Re: how connect 2 control to each other

    Hello Saba,
    As Ramana mentioned above node is a field and node in Main DOM is a field in main Data source. To create a node/field open InfoPath form in Design mode, in Task pane click on data source, right click on myFields and click on Add. Name the field as drop down. To create a repeating node/field, add a group as Check boxes and under that add a field as Check box.

    One important thing to note is that you will have to write an OnAfterEventChange behind the drop down.
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.