IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Table column sort - Numeric values

    Posted Thu April 02, 2015 05:48 PM

    Hello,
    I have a table that shows a lot of columns and the option sort it’s true for all of them and it’s working when the value is a string, like name
    (i.e:
    John
    Charles
    Apu
    when i click in asc sort:
    Apu
    Charles
    John
    )

    But when i’m trying to do this with numeric values, it’s not working correctly.
    (i.e:
    1234
    254
    15
    3454.45
    25178

    when i click in asc sort
    1234
    15
    25178
    254
    3454.45

    when the correctly order should be
    15
    254
    1234
    25178
    3454.45
    )

    I’ve tried to change for numeric in converter properties, double, but it’s not working.
    Can someone help me?

    Thanks!


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 2.  RE: Table column sort - Numeric values

    Posted Thu April 02, 2015 07:17 PM

    Try changing the expression used for the “Sort” property in the columns that contain numeric data to convert the value to a number before it is used for sorting.

    For example, if your “Sort” value of a column is something like this:

    #{row.field1}

    Then you can use the provided caf:xn function to wrap the original expression and convert that value to a number like this:

    #{caf:xn(row.field1)}

    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 3.  RE: Table column sort - Numeric values

    Posted Thu April 02, 2015 07:30 PM

    Thank you Eric!! It’s working now!


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 4.  RE: Table column sort - Numeric values

    Posted Mon April 06, 2015 10:53 AM

    Eric,

    Do you know in which document I can find more information about this functionality?

    Thanks!


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 5.  RE: Table column sort - Numeric values

    Posted Mon April 06, 2015 01:45 PM

    What specific functionality are you referring to?

    If you are talking about the caf:xn function, then the CAF Tag Library Reference documentation is where the CAF functions that can be used in an EL expression are described.


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 6.  RE: Table column sort - Numeric values

    Posted Tue April 07, 2015 03:58 PM

    Thank you Eric,

    Last question, is this documentation available only on 9.6? (CAF Tag Library Reference)
    I’d like to do the same for date values.

    Thanks!


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 7.  RE: Table column sort - Numeric values

    Posted Tue April 07, 2015 04:27 PM

    Yes, 9.6 was the first release that contained the CAF Tag Library Reference documentation.

    The provided CAF functions don’t currently have a method for date values.

    I haven’t tried this, but you should be able to create your own custom function in your page bean that does your conversion logic. This ability to invoke methods with parameters is provided by the EL 2.2 standard.

    For example, add a new method to the your page bean:

    public long dateToLong(String value) {
    long ms = 0;
    //TODO: convert the date string to a number here..
    return ms;
    }

    And then you can change the sort expression to call your custom function:

    #{activePageBean.dateToLong(row.field1)}  

    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 8.  RE: Table column sort - Numeric values

    Posted Tue April 07, 2015 04:38 PM