Forum Discussion

SeanV's avatar
SeanV
New Contributor III
2 years ago

SQL Table Editor - Set selected record from a rule?

I have a SQL Table Editor on a dashboard, I would like a row to be "pre-selected" from code instead of through a user action (manually clicking on the record).

Is this possible?

 

  • IBK's avatar
    IBK
    New Contributor III

    Actually I left it as input but I cleared the parameter bound to the button . It worked and of course we have to use the square brackets to get into an array. Thank You very much for all your help.

    • RobbSalzmann's avatar
      RobbSalzmann
      Valued Contributor II

      Ah!  Nice work.  You're right, Input.  I updated the post above to fix that.  I was thinking Input and somehow typed "Literal".  Glad you got it working.

    • SeanV's avatar
      SeanV
      New Contributor III

      FYI.  This should really be in its own thread.

  • NicolasArgente's avatar
    NicolasArgente
    Valued Contributor

    Hi SeanV 
    I do not exactly understand your request. Please could you be more specific and even show so print screen.
    Hope it will help the community to help you.
    Thanks

    • SeanV's avatar
      SeanV
      New Contributor III

      I have a SQL Table Editor on a Dashboard and a button.    Users select (click on a row/record) on the SQL Table Editor then click the button.  The button runs a Dashboard Extender rule that does "stuff" based on the selection from the SQL Table Editor.  Once the rule has run the SQL Table Editor is refreshed so that the action of the rule is shown.  However when the SQL Table Editor on the dashboard is refreshed, the record that had been previously selected/highlighted isn't selected/highlighted anymore (it has lost its focus).  I would like to "automatically" return focus to the previously selected record so that the User doesn't have to click on it again.  It would be "pre-clicked" or "pre-selected".

  • I'm not sure you can do that. However, you can set the parameter value the SQL editor is bound to and achieve similar results. That could lead to other issues if you are not actively clearing the parameter since it'll always remember your selection.

    • IBK's avatar
      IBK
      New Contributor III

      Hello,

      I have a similar requirement where the Bound Parameter has to return a comma delimited list of the selected row column. The bound column has been defined in the sql table editor. I also have a Supplied Parameter to collect the selected rows and pass it to the bound parameter and then to a BR for further processing. I am not sure how to format the Delimited list. Any help would be appreciated.

      • RobbSalzmann's avatar
        RobbSalzmann
        Valued Contributor II

        Use  square brackets ] around the parameter name that you want a delimited list from:

        {DBExtenderName}{FuncName}{CommaDelimitedListOfValues=[|!pm_multipleValuesParam!|]}

        Then inside your BR, parse the comma seperated list into an array or list, whatever suits:

        Dim arrValues As String() = args.NameValuePairs.XFGetValue("CommaDelimitedListOfValues", String.Empty).Trim().Split(","c)