3 Replies Latest reply: Nov 13, 2014 5:17 AM by AncientGrams RSS

    XML values from tables

    tanmay.singh Community Member

      Hi All,

      I need help in extracting XML values from a table.

       

      Condition:

      I have a table, That values are polulating to the table from an XML file. Now, based on one dropdown selection I have to show and hide those values in table.

       

      Can anyone please help here.

       

      Thanks,
      Tanmay

        • 1. Re: XML values from tables
          AncientGrams Community Member

          Do you want to hide the table or just the fields in the table?  If you want to just hide the table, you can do Tablename.presence = 'invisible' / 'visible' based on the change event of the drop down list object. 

           

          something like this (in the change event of the drop down object):

          if (xfa.event.newText == 'show') { Tablename.presence = 'visible';}

          else if (xfa.event.newText == 'hide') { Tablename.presence = 'invisible';}

           

          This is assuming that  your dropdown only has 'hide' and 'show' values.

           

          If you want to just hide the fields in the table, you need to loop through all the fields and set their presence individually.  something like this:

           

          var vRows = Tablename._Row.count;

          for (var i = 0; i < vRows; i++) {

          if (xfa.event.newText == 'show') {

               Tablename.resolveNode("Rowname[" + i + "]").field1name.presence = 'visible';         Tablename.resolveNode("Rowname[" + i + "]").field2name.presence = 'visible';

               // repeat above for all fields

          }

          else if (xfa.event.newText == 'hide) {

               Tablename.resolveNode("Rowname[" + i + "]").field1name.presence = 'invisible';         Tablename.resolveNode("Rowname[" + i + "]").field2name.presence = 'invisible';

               // repeat above for all fields

          }

          • 2. Re: XML values from tables
            tanmay.singh Community Member

            Hi Ancientgames,


            Thanks for your reply. However, I am requirement is different. Refer to the screenshot below:

            If I select Restaurant in the Drop-down, the table should only show the details of restaurant. If I select Travel, it should show all the travel catagories.

             

            Please share your e-mail ID, I can share the file with you.

            XMLvalues.png

            • 3. Re: XML values from tables
              AncientGrams Community Member

              You can tweak my original reply to get the desired result.  The concept is the same.