Portlet Factory, Version 6.1.2


 

Sorting a collection or iterator containing Java beans

Follow these steps to sort a collection or iterator containing Java Beans.

  1. Place a Transform-Sort builder call in the model containing the variable you want to sort and in the builder call editor select the variable to operate on in the Variable input.

  2. Select or input the bean class name which represents the type of the Java Beans contained by the collection or iterator in the specified variable in the Bean Class Name input.

  3. Specify the target variable, if different from the source variable, in the Target Variable input. Leave the Target Variable input blank to save filtered results back to the source variable.

  4. Specify the sort criteria. For each criteria, enter the public field or accessor method of the bean used to perform the sort, and the method to use to compare the values. If multiple criterion are specified, the data will be sorted according to the first criteria, then a secondary sort will be applied with the second criteria, and so on. Once the builder call is applied and saved, a new method called builderNameCallFilter will be available in the WebApp.

  5. Use a Method Call builder or some other means to call this method at the desired time and perform sorting.

Parent topic: Transform-Sort builder


Library | Support |