US and Worldwide: +1 (866) 660-7555
Results 1 to 4 of 4

Thread: MultiSelectComponent - Selecting by default

  1. #1
    Join Date
    Jul 2011
    Posts
    23

    Default MultiSelectComponent - Selecting by default

    I have been trying to test more components on dashboards, and now i've stumbled onto a small problem. I populate the element using a CDA query, and i want to have all the values selected when the element is rendered. I have already tried adding the "selected" clause one normally includes on a regular HTML select object on the query, but the element automatically escapes the query result as the object's value.
    Also, snooping around the definition on the coreComponents file, i couldn't find anything that could help me do this.

    Does anyone have any ideas on this?

  2. #2

    Default

    Hi,

    it can be done by set the parameter value at begining. for example :

    Code:
    var region='Central';
    
      var SelectRegion = 
        {
        name: "SelectRegion",
        type: "selectComponent",
        queryDefinition: qdef.regions,
        parameter: "region",
        valueAsId: false,
        size:1,
        htmlObject: "SelectRegion_object",
        executeAtStart: true
       }

  3. #3
    Join Date
    Jul 2007
    Posts
    2,172

    Default

    Correct. And if you want to set more than one, use an array
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  4. #4
    Join Date
    Jul 2011
    Posts
    23

    Default

    Yes, thanks, that worked. What i did was declare an array variable as you suggested, and filled it with the component's values at preExecution, and each option was selected when the dashboard was rendered.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •