Topic
  • 3 replies
  • Latest Post - ‏2013-01-09T18:27:51Z by mburati
malik23
malik23
13 Posts

Pinned topic How to sort an added column?

‏2013-01-09T14:35:50Z |
Hello,

using the SAP Function Call builder I get a list with several columns.
With the Data Column Modifier builder I add new columns to this list.

One of these columns should display data from one of the original columns
but without leading zeroes. This works fine using a JLO.
Is there any way to sort this new column?

Putting the new column on "sortable" in the Data Column Modifier has no effect.

Can any added columns be sorted at all?

Any idea would be much appreciated.
Thank you!
Updated on 2013-01-09T18:27:51Z at 2013-01-09T18:27:51Z by mburati
  • DGawron
    DGawron
    580 Posts

    Re: How to sort an added column?

    ‏2013-01-09T15:46:33Z  
    You cannot sort on columns added by Page Automation because the column doesn't actually exist in the XML data used to populate the page. Sorting is applied to the XML data, not the visual representation of the data you see on a page. If you need to sort on a column that is not present in the data retrieved from a back-end, then you need to modify your service provider operation to add the column(s) as part of the operation's execution. You can use the IXml interface to do this for each row of data obtained from the back-end. Then you'd tweak the service operation's output schema to add a definition(s) for the new column(s). Sorting on those columns will then be possible.
  • malik23
    malik23
    13 Posts

    Re: How to sort an added column?

    ‏2013-01-09T16:09:57Z  
    • DGawron
    • ‏2013-01-09T15:46:33Z
    You cannot sort on columns added by Page Automation because the column doesn't actually exist in the XML data used to populate the page. Sorting is applied to the XML data, not the visual representation of the data you see on a page. If you need to sort on a column that is not present in the data retrieved from a back-end, then you need to modify your service provider operation to add the column(s) as part of the operation's execution. You can use the IXml interface to do this for each row of data obtained from the back-end. Then you'd tweak the service operation's output schema to add a definition(s) for the new column(s). Sorting on those columns will then be possible.
    Thank you for your reply!
    I haven't worked with the IXml interface before but if it is the only
    way do do this kind of sorting I will have a look at it.
  • mburati
    mburati
    2568 Posts

    Re: How to sort an added column?

    ‏2013-01-09T18:27:51Z  
    • malik23
    • ‏2013-01-09T16:09:57Z
    Thank you for your reply!
    I haven't worked with the IXml interface before but if it is the only
    way do do this kind of sorting I will have a look at it.
    As Dave notes, page automation is going to ask that the data be sorted before being rendered, so a new column that just adds additional data at render time isn't that useful for sorting the backend data that doesn't know about that additional render artifact. In fact when I add a column with DCM and ask it to make that Sortable, I get a warning that such an additional generated column cannot be made sortable with that mechanism.

    If the column you want to display is just an original data column minus leading zeros then there may be an easier way - formatting the data during render rather than creating a new column to get alternative data.

    The out of the box WEF Orders Service Consumer sample (in the building models feature set) has order ids with leading 0s.

    - I just added a "Data Field Modifier" to the OrdersServiceConsumer with the following inputs:
    - selected the Order Id element on the DSUI uiList page ( uiListuiList/RowSet/Row/ORDER_ID )
    - in the "Formatting" section of DFM, I
    - selected com.bowstreet.builders.webapp.pageautomation.StandardFormatter from the format class dropdown
    - selected "Number Format(FormatString)" from the dropdown
    - set Format Exp Arg to #### (4 numeric/pound chars)
    - Note the WEF std formatter number formatting uses Java's number formatter class so the same format expressions apply as are doc'd for the java number formatter.

    - clicked OK and ran the Orders Service Consumer again and the leading zeros had been removed and the column could still be made sortable (eg, with the DFS that's already in the model). Note, the WEF

    Try that with Orders Service Consumer first and then once you get that to work, try the same with your consumer UI model.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.