5 Replies Latest reply on Sep 4, 2014 6:16 PM by janesam

    Expanding tables and populating new rows dynamically from other areas of the form

    janesam

      I desperately need some help.

      I have a 6 page form with a lot of data on it and I want the user to be able to:

      1.  There are 36 statements with yes/no check boxes next to them - if they check a certain response the statement needs to drop down into another field in a second table for actions etc

      2.  I have a risk matrix that I made the cells into buttons and had actions on them that if clicked they would populate another cell in the second table above with the risk rating and colour etc but I can only do with with

          and action and it only allows one cell/field to be nominated as the result (how do I get this to work in an expanding table with several rows)

      I can supply the form as it is at the moment to show what I mean.

       

      This is quite urgent and any help would be greatly appreciated

       

       

      Thanks Jane

       

      Hi again,

       

      I have now got the check boxes working so that when checked they automatically add another row to the table but the 'text field' in that row that I want to imput the statement to is just called Risk in all the new added rows therefore

      the new statement is overwriting the previous one and not going into the new row  that it just added.

      Here is the code on the first two check boxes:

      PubRequestForm.Main1.Section2Sub.NatureOfRiskTab.Row1.Statement1.no1::change - (JavaScript, client)

      if (this.rawValue == "1") {

      this.resolveNode("PageSix.Table7.Row1").instanceManager.addInstance();

      this.rosolveNode("PageSix.Table7.Row1.Risk").rawValue = "statement 1 text here";

      }

       

      PubRequestForm.Main1.Section2Sub.NatureOfRiskTab.Row2.Statement1.yes2::change - (JavaScript, client)

      if (this.rawValue == "1") {

      this.resolveNode("PageSix.Table7.Row1").instanceManager.addInstance();

      this.rosolveNode("PageSix.Table7.Row1.Risk").rawValue = "statement 2 text here";

      }

       

      Thanks in advance!!

       

      Message was edited by: Jane Maddison

        • 1. Re: Expanding tables and populating new rows dynamically from other areas of the form
          TundraSteve Employee Moderator

          You're adding an instance of a subform but you're always referring to the first instance while setting the rawvalue.  In your case PageSix.Table7.Row1.Risk would be something like PageSix.Table7.Row1[1].Risk to refer to the instance you of course can use instance manager to get the count of the rows or use a variable instead.

          • 2. Re: Expanding tables and populating new rows dynamically from other areas of the form
            janesam Level 1

            Thank you so much, that works perfectly now.  I was close!! 

             

            Cheers

            Jane

            • 3. Re: Expanding tables and populating new rows dynamically from other areas of the form
              janesam Level 1

              Hi Steve,

               

              Thank you for your help it works now but I have just come across another problem and I believe you mentioned in your reply that I could

              use instanceManager to get the count of the rows (as at the moment I have just been numbering them ,  etc

              If I don’t check a particular check box then it throws everything out at the moment  I need it to be able to only transpose the statement of checked rows…

              I have 36 statements and on average the user will only select 10 or so and not in numeric order?

               

               

               

              Jane Maddison

              Graphic Designer/Publications Officer

              Communications and Community Engagement Unit

              • 4. Re: Expanding tables and populating new rows dynamically from other areas of the form
                TundraSteve Employee Moderator

                I'm not sure I understand but this is what I think you want

                 

                row 1

                row 2

                row 3

                row 4

                row 5

                 

                The user may click row 3, then row 1, then row 5 and you want them to come in the following order for the other elements you're adding with instancemanager

                 

                show 1

                show 3

                show 5

                 

                Is that what you're asking?

                • 5. Re: Expanding tables and populating new rows dynamically from other areas of the form
                  janesam Level 1

                  Hi Steve,

                   

                  Thanks for your reply.

                   

                  The form at the moment has Table One - 36 rows with statements in first column and then yes, no and n/a check boxes….. on each row either the yes or the no checkbox is highlighted.

                  Depending on whether the user checks the highlighted answer or not depends on whether the text statement in column one is to be transferred to the column one in the

                  new expanding table.  So if the user checks say all no’s for their answer , there might only be 10 statements out of the 36 that need to go down to the new expanding table.

                  My problem is that I have now referenced the new row with a static number and I need to know how to count the new rows and put the reference in if all 36 are not used.

                   

                   

                  eg:

                  Table one static with fixed amount of rows (36)

                   

                  Column 1                                  Column 2                      col 3        col 4

                  statement 1                                      N/A                        Yes        No

                  statement 2                                      N/A                        Yes        No

                  statement 3                                      N/A                        Yes        No

                   

                  I want the statements only from the highlighted answers – so if the user selected yes, yes, yes  - the statement in row two is not needed but I have numbered my  rows

                  ,  etc and at the moment it puts a new blank row in for statement 2 .

                   

                  Code on check box for statement number 3

                   

                  if (this.rawValue == "1") {

                   

                  this.resolveNode("PageFive.ActionTableSub.Table7.Row1").instanceManager.addInstance();

                   

                    this.resolveNode("PageFive.ActionTableSub.Table7.Row1[2].Risk").rawValue = "Is the reception area visible to fellow employees?";

                   

                  }

                   

                  The RED reference code is what I need help with – I want it to be a count??  reference so that it is not putting/referencing 36 rows….

                  I hope this makes sense!

                   

                  Thank you so much for your help (you are obviously in the US??)  I am in Australia and am seeing your replies in the mornings when I come in to work.

                   

                  Cheers

                  Jane

                   

                   

                   

                   

                  Jane Maddison

                  Graphic Designer/Publications Officer

                  Communications and Community Engagement Unit