Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Grouping Configuration Revisited

Avatar

Level 2

See third and fourth tables down at: http://isd.datc.edu/sites/isd.datc.edu/files/Modification%20Form%20XMLx.pdf

Srini helped add rows that include the grouping (thanks!). More questions:

1. I would like to know exactly how this was configured so I can do it in the future (and do it to the fourth table).

2. Do I have to have the Add/Remove (+/-) buttons in the top AND bottom section of the grouping, or can one be removed? When I try to remove the bottom, I am losing the capability to add.

3. The Remove (-) button is not working. I had used Javascript, as described in the Help feature, but it appears to have been removed. Maybe there is another way to do this that I missed?

I would appreciate if you provide a detailed explanation of configuration that I can improve my knowledge of this product.

Thank you!

1 Accepted Solution

Avatar

Correct answer by
Level 10

More questions:

1. I would like to know exactly how this was configured so I can do it in the future (and do it to the fourth table).

Srini: When you designed your form, in Table3, (Modify/Move Existing Course), you have added one Header Row, One Body Row (Row1), and one Section below Row1 ( which is like a table itself inside another table).

    When you Click on Add Row button in the Row1, you need to repeat one Body Row (Row1) and also the section (Course and Description). That's why I included the code to repeat the entire Table3 when you click on Add Row button.

     //Table3.Row1.instanceManager.addInstance(1); -- Code you put earlier which will repeat only Row1.
     Table3.instanceManager.addInstance(1);  -- Code I placed to repeat the Entire Table3 including the section (Course and Description).

   

     You also have Add button in the Course and Description section. When you click on this button you need to add one more row for the Course and Description.

     Table3.Row2.instanceManager.addInstance(1); -- I am adding an Instance to the Row2 in the section of Table3.

        

2. Do I have to have the Add/Remove (+/-) buttons in the top AND bottom section of the grouping, or can one be removed? When I try to remove the bottom, I am losing the capability to add.

Srini: You need this in the bottom Section, if you want to add more than one Course Description and Measurable Objectives under each of the Course.

          According to your requirements, if each course can have only one Course Description and Measurable Objectives then you do not need a Add button in the bottom section.

         It all depends on what your requirement is.

         The Top Add Button will repeat the entire Table3 including the section (Course and Description).         

         The Bottom Add Button will repeat only the Row2 in Section (Course and Description).

3. The Remove (-) button is not working. I had used Javascript, as described in the Help feature, but it appears to have been removed. Maybe there is another way to do this that I missed?

Srini: Your Remove is not working because you are not passing the correct Index of the Row to Instance Manager.

          For example if you want to remove one row in Course and Decription section in Table3:       

                  If you use removeInstance(1), it will always try to delete the last row and not the selected row.

                  If you want to remove the selected row, you need to pass the correct row index..

                    form1.#subform[0].Table3.#subformSet[0].Row2.Subform13.Button1::mouseUp - (JavaScript, client)

                        Table3.Row2.instanceManager.removeInstance(this.parent.parent.index);

                   In the above code, the parent for Remove Button (Button1) is Subform13. The parent of Subform13 is Row2. This way you need to go backwards until you reach the Instance Manager you are Adding/ Removing the rows in the table.

Note: You need to check the code that you can remove only if there are more than one row. Because in the properties of Row2 you have set the minimum count to 1.

          With this, your code should look like this:

              form1.#subform[0].Table3.#subformSet[0].Row2.Subform13.Button1::mouseUp - (JavaScript, client)

                   

                        //Check if the index is more than 0 means it will make sure one should be there always.

                        if(this.parent.parent.index >0)

                             Table3.Row2.instanceManager.removeInstance(this.parent.parent.index);

       

Find the corrected file for the Remove Instance..

https://acrobat.com/#d=f2yfh9TvQVHKEkqT1QW2jw

Hope this helps..

Thanks

Srini

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

More questions:

1. I would like to know exactly how this was configured so I can do it in the future (and do it to the fourth table).

Srini: When you designed your form, in Table3, (Modify/Move Existing Course), you have added one Header Row, One Body Row (Row1), and one Section below Row1 ( which is like a table itself inside another table).

    When you Click on Add Row button in the Row1, you need to repeat one Body Row (Row1) and also the section (Course and Description). That's why I included the code to repeat the entire Table3 when you click on Add Row button.

     //Table3.Row1.instanceManager.addInstance(1); -- Code you put earlier which will repeat only Row1.
     Table3.instanceManager.addInstance(1);  -- Code I placed to repeat the Entire Table3 including the section (Course and Description).

   

     You also have Add button in the Course and Description section. When you click on this button you need to add one more row for the Course and Description.

     Table3.Row2.instanceManager.addInstance(1); -- I am adding an Instance to the Row2 in the section of Table3.

        

2. Do I have to have the Add/Remove (+/-) buttons in the top AND bottom section of the grouping, or can one be removed? When I try to remove the bottom, I am losing the capability to add.

Srini: You need this in the bottom Section, if you want to add more than one Course Description and Measurable Objectives under each of the Course.

          According to your requirements, if each course can have only one Course Description and Measurable Objectives then you do not need a Add button in the bottom section.

         It all depends on what your requirement is.

         The Top Add Button will repeat the entire Table3 including the section (Course and Description).         

         The Bottom Add Button will repeat only the Row2 in Section (Course and Description).

3. The Remove (-) button is not working. I had used Javascript, as described in the Help feature, but it appears to have been removed. Maybe there is another way to do this that I missed?

Srini: Your Remove is not working because you are not passing the correct Index of the Row to Instance Manager.

          For example if you want to remove one row in Course and Decription section in Table3:       

                  If you use removeInstance(1), it will always try to delete the last row and not the selected row.

                  If you want to remove the selected row, you need to pass the correct row index..

                    form1.#subform[0].Table3.#subformSet[0].Row2.Subform13.Button1::mouseUp - (JavaScript, client)

                        Table3.Row2.instanceManager.removeInstance(this.parent.parent.index);

                   In the above code, the parent for Remove Button (Button1) is Subform13. The parent of Subform13 is Row2. This way you need to go backwards until you reach the Instance Manager you are Adding/ Removing the rows in the table.

Note: You need to check the code that you can remove only if there are more than one row. Because in the properties of Row2 you have set the minimum count to 1.

          With this, your code should look like this:

              form1.#subform[0].Table3.#subformSet[0].Row2.Subform13.Button1::mouseUp - (JavaScript, client)

                   

                        //Check if the index is more than 0 means it will make sure one should be there always.

                        if(this.parent.parent.index >0)

                             Table3.Row2.instanceManager.removeInstance(this.parent.parent.index);

       

Find the corrected file for the Remove Instance..

https://acrobat.com/#d=f2yfh9TvQVHKEkqT1QW2jw

Hope this helps..

Thanks

Srini

Avatar

Level 2

Thank you! You have been so helpful.