Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: SelectComponent Interaction and result-set data retrieval

  1. #1
    Join Date
    Dec 2009
    Posts
    27

    Default SelectComponent Interaction and result-set data retrieval

    Hello!

    I have two CDF objects in customers-template.html file:

    Code:
    productSelector = 
    {
      name: "productSelector",
      type: "select",
      solution: solution, path: path,
      action: "products.xaction",
      parameters:[],
      parameter:"products",
      htmlObject: "product_select",
      executeAtStart: true
    }
    
    barChart = {
    name: "barChart", 
    type: "XactionComponent",
    solution: solution, path: path,
    action: "barChart.xaction",
    listeners: [products],
    parameters: [ ["product_type", products] ],
    htmlObject: "barChart",
    executeAtStart: true
    }
    The first one takes the data from a predefined result-set(in products.xaction) that is supposed to be passed to a bar chart, so that every time I select another product, the BarChart updates its values. But the dashboard isn't working(note that if I use another xaction component instead of selectComponent, the bar chart updates its values just fine).


    IMHO i'm missing two things: fireChange function to update the product and the selection of exactly one row of the result-set variable. So I've tried these two things:

    1) Adding the following lines to a productSelector:

    Code:
    postExecution:function(){
      var curr_param_product = Dashboards.getParameterValue(selected_product); 
        if (curr_param_product != products){ 
        Dashboards.fireChange(selected_product, products); 
            };
        }
    (defining previously var selected_product = "Jeep" somewhere along the code)

    2) Trying to retrieve the selected product with:
    Code:
    selected_product = product.getValueAt(0,0);
    In the latter case the issue is that I can't use any of the suggested functions ( http://wiki.pentaho.com/display/ServerDoc2x/JavaScript) and I'm not aware why.

    Any ideas?

  2. #2
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    parameters: [ ["product_type", products] ], <- I think you're just missing some '

    Try:
    parameters: [ ["product_type", 'products'] ]
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Dec 2009
    Posts
    27

    Default

    Thank you Pedro, you were right! In order to make everything work I had to adjust some other details but the main problem was after all the quoting.

    Thanks,
    Vlad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.