Forum Discussion

Azeddin_Margani's avatar
Azeddin_Margani
Contributor
8 years ago
Solved

To select specific item within a table/container

Hi, Could someone help, please.  I'm trying to code to identify specific product name then adding it to shopping basket.   The mapping name of the container/table that contains the list of produ...
  • tristaanogre's avatar
    8 years ago

    First suggestion:

    Utilize the "power" of Aliases... currently, you have all your container panels reflected in your Aliases when, in fact, you PROBABLY don't need to actually see them all in your path.  Your NameMapping probably can have them all just fine, but do a little judicial "telescoping" to flatten out your list of objects to make those paths more manageable.

    Second suggestion:

    For getting a list of all the products, you might want to use a FindAllChildren call on that container/table that contains the list of product names.  What you want to do is, in your FindAllChildren call, map out properties that will SPECIFICALLY grab that panel that contains the products... if there are specific text strings in "innerHTML" or something like that, that is what I have used in the past. FindAllChildren will then give you an array of objects that you can then iterate through to find the specific products, links, buttons, etc.

    How do I know this?  Because, in a former life, I had to automate a similar set up of dynamically generated content for tickets on another similar website and that's how I did it.  Now, I did ONE other little trick...

    I had my developer throw in a hidden property on each product's main container that contained that products unique identifier number that I had access to.  Then, if I wanted to find and select a SPECIFIC product, all I needed to do was call "FindChild" and look for that property... and bingo, I had my product.  If you have an amenable developer staff, give that a try.