Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

CSA - Sort order on dynamic list selection from database

CSA - Sort order on dynamic list selection from database

0 Votes

Hello

By default, dynamic list is sorted by name.

We have a MySQL table that contains the list items with a sort order column. The idea is to populate the CSA list field sorted by this column and not by the display name.

The SQL query called by the JS script is for example : SELECT name_col,value_col from LIST_ITEM order by order_col ASC;

Thanks

 

5 Comments
Account_Closed
Not applicable

Starting csa 4.60 there's a orderindex property for the dynamic list entries. - this sets the sort order. sample as below.

by default the name is used to do a sort, which is alphabetical and this is approach is the alternative.

<Property>

               <availableValues>

                              <value>[TOKEN:PRN_COMPONENT_ID]</value>

                              <displayName>Result 1</displayName>  

                              <description>The first artificial result</description>

                              <orderIndex>0</orderIndex>    

                              <initialPrice>12</initialPrice>

                              <recurringPrice>2</recurringPrice>                         

               </availableValues>

 

Regular Contributor.. rbienvault Regular Contributor..
Regular Contributor..

I agree, it can be sometimes hard to display options in the way that we want them to be displayed.

It should be an option when adding the list on the user operation :

  • To have the default ordering (by name)
  • To let the result from the request without ordering

I think other way can be added with for example weight when we push an value.

Respected Contributor.. Haja Respected Contributor..
Respected Contributor..

Ram D,

The parameter OrderIndex doesn't work using the function availableValues.push(availableRow);

Account_Closed
Not applicable

@Haja did this issue get resolved? we have other places where this was tried out and worked successfully. need to look into why this fails in your case. The idea you have logged is already met, seems there could be a need to look into your particular issue with support help.

Can you please log a support case for this?

 

Respected Contributor.. Haja Respected Contributor..
Respected Contributor..

Hello

I already submitted a case and the support asked me to submit an enhancement request.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.