Sorting with messageChoice

I'm using JHS 10.1.2.2 build 32 with JDeveloper 10.1.2.1 to generate UIX pages.
I have a messageChoice in a table which is a sortable column. Instead of sorting the value of the column, I would instead like to sort by the text shown in the column. In the JHS demo example, an example would be on the EmployeeTable page, sorting by department. Instead of sorting by the department id, sorting by the Department name. I have thought about overwriting the onSort method, but I don't know how to get the value of what is being sorted to change it from the department id to the department name.
Thanks in advance.
Suasn

Susan,
Yes, you should be able to implement this by overriding onSort. You also need to add the DepartmentName to the underlying ViewObject.
By calling request.getParameter("value") in onSort method you will get the attribute name that will be used to sort on. So, if that value is DepartmentId, you set DepartmentName as the argument when creating a new instance of SortCriteriaImpl. Take a look at the source of JhsDataAction.onSort and it should be clear, I hope.
Steven Davelaar,
JHeadstart Team.

Similar Messages

  • A simple question about wrong sorting with multiple sort columns in Excel 2010

    Hi, everyone! I have encountered a problem that I don't know how to explain.
    So I post it here because I don't know if there is another more relevant forum...
    I have a data sheet with the students' scores for the course. 
    All the data were generated with the randbetween function,
    and pasted with the values.
    To rank the students by their performance,
    I did the sort with the column "total score" as the first sort-column
    and "final term" as the second.
    The weird thing to me is that the order of the data seems problematic.
    That is, all the rows are sorted correctly with the first sort-column.
    But for the rows with the same values of the first sort-column,
    there are some rows whose values of the second sort-column are out of order.
    (please look at the data file at
    www_dot_kuaipan_dot_cn/file/id_67204268108546068_dot_htm
    Please change the "_dot_" to the real literal dot.
    Especially the rows with 56.7 as the first sort-column value
    and some other values near the tail of the list.)
    I tried to manually input and sort the same values of both columns
    in a near-by region. The result was correct.
    When some friend copied all the data to paste in Notepad,
    and reload them in excel. The problem disappears.
    Some friend also tried to wrap a round function at the values of the 1st sort-column,
    the sorting order became correct!
    But they could not explain why either.
    How confusing! I even tried to swap the first and secod sort-column;
    the output was right.
    All the data were generated by randbetween function and pasted with values.
    Where could all the special characters, if any, come?
    Can anyone give me an explanation? I would be very grateful.
    Thanks in advance!

    Re:  Sort is not in proper order
    Sounds as if the data includes spaces or hidden characters that are affecting the sort.
    That is indicated by the fact that manually entering the data resolves the problem.
    Note:  You can use a public file storage website to hold your file and add the link to it in your post.
    Jim Cone
    Portland, Oregon USA
    Special Sort excel add-in (30+ ways to sort) - 3 week no obligation trial
    https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

  • Sorting with nulls last on the fact column

    anybody tell me how to do the sorting with nulls last in the template? i can't change anything in data model or anywhere other than template.
    i did try to put the descending order,but null values are coming in between positive and negative values.
    <?sort:FACT_Column_Name;'decending';data-type='number'?>
    could anyone please tell me how can i do that in template?
    Thanks in advance.
    Edited by: user12255470 on Apr 12, 2012 5:29 PM

    Hi to all,
    i've solved, is very simple using decode inside the select:
    SELECT
    ID,
    FK_HTMLDB_ITEM, DECODE(FK_HTMLDB_ITEM,1,HTMLDB_ITEM.DATE_POPUP(3,rownum,VAL,'dd-mon-yyyy'),2,HTMLDB_ITEM.TEXT(3,VAL)) VALORE
    FROM TESTID
    my table is:
    CREATE TABLE "DEV"."TESTID"
    (     "ID" NUMBER NOT NULL ENABLE,
         "FK_HTMLDB_ITEM" NUMBER,
         "VAL" VARCHAR2(4000 BYTE))
    Bye Bye

  • Dynamic SORT with multiple components

    Hi all,
    I want to sort an internal table in this way:
    SORT itab BY (component).
    This is not difficult if "component" contains the name of ONE column of itab. But - and here is my problem - how can I sort with multiple components?
    Like this:
    SORT itab BY (comp_1) (comp_2) ... (comp_N).
    The number of components (N) shall be flexible. It is not possible to concatenate the components into one string-variable. This causes an error ITAB_ILLEGAL_COMPONENT.
    Brillant would be a solution which also contains the sort-direction (ASCENDING or DESCENDING for each component like this:
    SORT itab BY (comp_1) (dir_1)
                 (comp_2) (dir_2)
                 (comp_N) (dir_N).
    Is there a way to do so?
    Thanks for all hints!
    Mathias

    Hi Matahias ...
    From ABAP help...
    SORT itab.
    Extras:
    1. ... BY f1 f2 ... fn
    2. ... ASCENDING
    3. ... DESCENDING
    4. ... AS TEXT
    5. ... STABLE
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Field symbols not allowed as sort criterion.
    Effect
    The entries in the internal table are sorted in ascending order using the key from the table definition (DATA, TYPES).
    Addition 1
    ... BY f1 f2 ... fn
    Effect
    Uses the sort key defined by the sub-fields f1, f2, ..., fn of the table itab instead of the table key. The fields can be of any type; even number fields and tables are allowed.
    You can also specify the sort fields dynamically in the form (name). If name is blank at run time, the sort field is ignored. If itab is a table with a header line, you can also use a field symbol pointing to the header line of itab as a dynamic sort criterion. A field symbol that is not assigned is ignored. If a field symbol is assigned, but does not point to the header line of the internal table, a runtime error occurs.
    If the line type of the internal table contains object reference variables as components, or the entire line type is a reference variable, you can use the attributes of the object to which a reference is pointing in a line as sort criteria (see Attributes of Objects as the Key of an Internal Table
    You can address the entire line of an internal table as the key using the pseudocomponent TABLE_LINE. This is particularly relevant for tables with a non-structured line type when you want to address the whole line as the key of the table (see also Pseudocomponent TABLE_LINE With Internal Tables).
    If you use one of the additions 2 to 5 before BY, it applies to all fields of the sort key by default. You can also specify these additions after each individual sort field f1, f2, ..., fn. For each key field, this defines an individual sort rule which overrides the default.
    Cheers
    Preetham

  • LOV sorting with upper and lower case

    In a dynamic table, I have the following values:
    aaxyz
    ABC
    Abd
    ACE
    Adf
    AEG
    But when I create the LOV, it sorts
    ABC
    ACE
    AEG
    Abd
    Adf
    aaxyz
    Is there any way to sort a LOV as if case does doesn't matter?

    Except the values in the dynamic table are sometimes acronyms which should be upper case and sometimes not.
    For example:
    eDiscovery
    False Alarm
    FBI
    Federal Department
    where the list sorts:
    FBI
    False Alarm
    Federal Department
    eDiscovery
    The issue is that the list of values is large (over 100 items) and sometimes the item the user is interested in is sorted below all the initial upper case letter (in the case of the eDiscovery element). It needs to sort with the "E" but not be upper case.
    Thanx!

  • DataFormWebPart: Sorting with Last modified bug

    I have created a DataFormWebPart with SPD2013. In my DataFormWebPart, I sort the table by Modifed column. The column is display with follow format:
    <xsl:value-of select="ddwrt:FormatDate(string(@Modified), 2057, 5)"/>
    However, when sorting with descending order. The time at 12:xx is at higher proirity:
    24/04/2015 12:44
    24/04/2015 12:25
    24/04/2015 17:18
    24/04/2015 16:55
    24/04/2015 15:52
    Why is that? Can we fix it? Thank you.

    Thank you for your reply. I have done more test. When I press F5 to refresh the page, the sorting order is correct. However when click on the column header to sort the order is incorrect.
    There are only two sentense start with <xsl:sort
    <xsl:sort select="*[name() = $dvt_sortfield] | @*[name() = $dvt_sortfield] | text()[name(ancestor::*[1]) = $dvt_sortfield]" order="{$dvt_sortdir}" data-type="{$dvt_sorttype}" />
    <xsl:sort select="ddwrt:FormatDate(string(@Modified),2057,5)" order="descending" />
    and here is part of column with wrong order when clicking the header:
    <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
     <xsl:with-param name="fieldname">@Modified</xsl:with-param>
     <xsl:with-param name="fieldtitle">修改時間</xsl:with-param>
     <xsl:with-param name="displayname">修改時間</xsl:with-param>
     <xsl:with-param name="sortable">1</xsl:with-param>
     <xsl:with-param name="fieldtype">x:dateTime</xsl:with-param>
    </xsl:call-template>
    Here is how the sorting looks like:
    24/04/2015 15:52
    24/04/2015 16:55
    24/04/2015 12:44
    27/04/2015 13:49
    27/04/2015 13:53

  • Sorting with Diacritic characters

    Hi,
    While implementing sorting in Endeca search we came across a scenario where the sorting should include diacritic characters. Taking the example of Polish, there are characters like *"A"* and *"Ą"* starting for the product names. When we sort with the product name (A-Z sort), we had seen that the records starting with *"Ą"* are retrieved at the end. In fact the expected behavior being it should follow after the names starting with *"A"*. Please let me know if anyone has come across similar behavior and the fix made for it.
    The endeca version being used is 6.1.3 and the language used is Polish.

    You need to add --lang pl-u-co-standard to the dgidx and dgraph components (in ./config/script/AppConfig.xml).  By default Endeca sorts using endeca collation which "sorts text with lower case before upper case and does not account for character accents and punctuation."  Standard collation sorts data "according to the International Components for Unicode (ICU) standard for the language you specify".  See http://docs.oracle.com/cd/E35641_01/MDEX.621/pdf/AdvDevGuide.pdf , Chapter "Using Internationalized Data" for further details. 
    If by 6.1.3 you mean MDEX 6.1.3 (as opposed to Platform Services) I'm not sure this sorting was available then, you would need to check the chapter listed above in the MDEX 6.1.3 documentation.

  • My computer is all out of sort with the color and it is in like a negitative effect that i cannot seem to fix. How do i fix it?

    my computer is all out of sort with the color and it is in like a negitative effect that i cannot seem to fix. How do i fix it?

    Try System Preferences>Universal Access>Seeing>Display.  See if White on Black' has been selected.
    If so, select 'Black on White'.
    Ciao.
    Message was edited by: OGELTHORPE

  • Sorting with BINS

    Hello people,
    My problem is the following:
    I have 2 columns: C1 and C2.
    The C1 I filter and sort with case.
    The C2 I didn't filter but I use BINS... like, if C2 is something group this in "Others"
    Now, I need to sort this C2, but is not too simple like C1. I'll try to show why:
    TEXT 1 ---------------------------------------
    C1 C2
    C1 C2
    C1 C2
    C1 C2
    TEXT 2 ---------------------------------------
    C1 C2
    C1 C2
    C1 C2
    When I told that I sort C1 with case, is simple, because C1 is not depending to TEXT 1 or TEXT 2.
    C2 is different because depends to TEXT 1 and TEXT 2, and besides this when I sort, the group "Others" appears more than 1 time like as the attributes are:
    If a group cat, dog and bird in "Others" and sort this, didn't sort the Others one time, appears Others 3 times (Trying to sort cat, dog and bird inside Others).
    Someone has a idea of what I can do with this problem ?
    Tks in advance.

    I have this attributes :
    Manifest, Motive1, Motive2
    Values for Manifest: Satisfaction, Reclamation, Idea, ...
    Values for Motive1: Package, Product, Marketing, ...
    Values for Motive2: Mould, Melt, Staning, General, Perfomance, Composition, ...
    Before BIN, i have:
    Manifest: Reclamation
    Motive1: Package Motive2: Perfomance
    Motive1: Package Motive2: Composition
    Motive1: Package Motive2: General
    Motive1: Product Motive2: Mould
    Motive1: Marketing Motive2: General
    Manifest: Satisfaction
    Motive1: Package Motive2: Composition
    Motive1: Package Motive2: Perfomance
    Motive1: Product Motive2: Melt
    After BIN, i have: -- Grouping what I need.
    Manifest: Reclamation
    Motive1: Package Motive2: Perfomance
    Motive1: Package Motive2: Others
    Motive1: Product Motive2: Mould
    Motive1: Marketing Motive2: General
    Manifest: Satisfaction
    Motive1: Package Motive2: General
    Motive1: Product Motive2: Melt
    Now, I have to sort this pivot, but I don't know why. When I try to sort (like perfomance 1 and others 2 marketing 3 product 4 product melt 1 package general 1) I got this:
    Manifest: Reclamation
    Motive1: Package Motive2: Perfomance
    Motive1: Package Motive2: Others
    Motive1: Package Motive2: Others
    Motive1: Marketing Motive2: General
    Motive1: Product Motive2: Mould
    Manifest: Satisfaction
    Motive1: Product Motive2: Melt
    Motive1: Package Motive2: General
    Motive1: Package Motive2: General
    I don't know why, but the BIN didn't sort, they sort ''thinking'' in the things inside the BIN.
    I need to sort this and if possible, without case (to expensive to maintenance..)
    If still unclear, tell pls.
    Tks !

  • Sorting with Name

    hi
    i have procedure with sorting technic..
    for sorting i have used code like this
    ......select ...... .. select ......  rownum rn from table_name
                             where cond...
             where pagenumber ......  pagesize........
    but now i want display result according to sorting,
    with alphabetic sorting.
    means if a user want to search name like start with name "M"
    i want to display result with starting letter is "M" as follows...
    and also user want to move <<next> <<last>> <<first>> <previouse>>for this any doc's or sample example or any ideas
    Edited by: OraclePLSQL on Dec 30, 2010 5:31 PM

    Hi,
    ROWNUM shows the order in which a row was received.
    If the source of the data is a table, then the order is undefined, and ROWNUM is arbitrary.
    If the source of the data is a sub-query or a view, then ROWNUM reflects the ORDER BY clause of that sub-query or view. If there is no ORDER BY clause, then ROWNUM is arbitrarty.
    If you want a Pagination Query , where you each page has a given size (it looks like 3 in your example), and you want to display only one given page (page #2 in your example), then you can use ROWNUM, but assign ROWNUM after the data is ordered.
    So you could modify the query you posted like this:
    SELECT * FROM
       SELECT ENAME,    EMPNO,    SAL
       ,      ROWNUM   AS RN               -- ROWNUM is meaningful here (source is ordered)
       FROM
         SELECT    ENAME, EMPNO, SAL          -- No ROWNUM here (source is not ordered)
         FROM      EMP
    --   WHERE     ename     LIKE 'M%'          -- Any filtering goes here
         ORDER BY  ename
       WHERE ROWNUM <((2*3)+1)
    WHERE RN >= (((2-1)*3)+1)
    ORDER BY  rn
    ;Remember to use an ORDER BY clause in the main query, if you want the output sorted.
    Output (using scott.emp):
    ENAME           EMPNO        SAL         RN
    CLARK            7782       2450          4
    FORD             7902       3000          5
    JAMES            7900        950          6This is the 2nd page; ADAMS, ALLEN and BLAKE would be on page 1.
    I think the analytic ROW_NUMBER function is better than ROWNUM for this kind of thing.
    Also, consider using variables instead of the "magic numbers" 2 and 3 in your WHERE clauses.
    The following query produces the same results as the query above:
    -- How many rows should appear on each page (except maybe the last page)?
    VARIABLE  page_size     NUMBER
    EXEC  :page_size := 3;
    -- Which page do we want to display in this query?
    VARIABLE  page_num     NUMBER
    EXEC  :page_num  := 2;
    WITH     got_rn     AS
         SELECT     ename, empno, sal
         ,     ROW_NUMBER () OVER (ORDER BY ename)     AS rn
         FROM     emp
    --     WHERE     ename     LIKE 'M%'     -- Any filtering goes here
    SELECT       *
    FROM       got_rn
    WHERE       CEIL (rn / :page_size)     = :page_num
    ORDER BY  rn
    ;

  • Pivot table sorting with month_id and average column in BI publisher temp

    In my project we are using the Oracle BI analysis for creating reports in BI publisher.
    At first we are creating the report in OBIEE answers then using it as data model in BI Pub.
    My reporting table holds data like below:
    Month_Name Year Month_Id Compensation Emp ID
    JAN 2011 1000 50 1234
    FEB 2011 1001 60 1235
    We need to show the data in pivot format i.e period(concated month+year) in column and comepsation values as measure and emp id in rows.I also need to show percentage i.e sum(Compensation/no of selected of periods).
    For average in OBIEE pivot i have create one calulated item. But I can't sort the data(for periods with the month_id) as its spillting the average column also.
    How can i sort it? like JAN2011 FEB2011 MAR2011 in pivot
    also in BI pub this calculated item not showing correct value.
    Please help.

    Hi,
    You can achieve this requirement by sort order column based on the month number and year you can sort this criteria column.also by using time_key,if the time_key is in sequence.
    mark if helpful/correct...
    thanks,
    prassu

  • Replace default table sort with order by on the view object

    The Jdeveloper help for af:table says:
    If the underlying model is not a CollectionModel , the Table automatically examines the actual data to determine which properties are sortable. Any column that has data that implements java.lang.Comparable is sortable. This automatic support cannot be nearly as efficient as coding sorting directly into a CollectionModel (for instance, by translating the sort into an "ORDER BY" SQL clause), but is sufficient for small data sets.
    I have a database table with varchar2 columns that can contain string, date or number values. So in the af:table I want to sort the columns either in string, date or number order.
    I tried creating a sort listener and in that listener set the view object order by clause and execute the query, but it does not affect the row order - it is always sorted as a string. I assume that the collection is doing its sort after I do the query, and overwriting the query order. I have tried disabling the sort in the listener by setting the sortcriteria to null but it has no effect.
    Can anyone suggest how to stop the default sort re-ordering the rows, or else how to code sorting directly into the CollectionModel as suggested in the help.
    Hugh Nelson

    By running in debug I discovered that when you click on a column heading to sort by the column values it actually sets the order by clause on the view object and executes a query. The help says that the default sorting is not as efficient as setting the order by clause - perhaps the help is out of date because default sorting does set the order by clause.
    This means that you cannot do a column sort on a transient attribute. The attribute being sorted on must exist in the table/query.
    The easiest solution is to override the setOrderByClause method on the view object. The string parameter is the column to order by eg "COLUMNA". If this column holds date values I can change it to something like "TO_CHAR(TO_DATE(COLUMNA,'DD-MON-YYYY'),'YYYYMMDD')". For numbers I do "LPAD(COLUMNA,10,'0')".
    This works OK.
    Hugh Nelson

  • Make a sort with ODI while generating XML File

    Hi all,
    I made a package whith several interfaces and a treatment.
    Each interface targets a table in my XML schema and the final treatment is a CreateXMLFile.
    Everything goes well, my XML file is generated :D
    Now I'd like to make a sort in an XML element. I know how to order the elements between them but can't find a way to sort a specific element. Excuse my poor english, I'm not really clear...
    My XML is built like this :
    <root>
    <questions>
    <question>
    <questionnumber>1</questionnumber>
    </question>
    <question>
    <questionnumber>2</questionnumber>
    </question>
    <questions>
    <root>
    So my problem is to make the questionnumber ordered.
    I tried to modify the IKM SQL Incremental Update to add a ORDER BY in the "Insert new rows" step.
    The generated code is executed with success... but in the end, my XML file is not sorted :S
    So first question, do you have an idea to be able to view the data in my XML schema tables ? This schema is stored in the memory engine and not in an external base. I ask that because when you try to execute the query "select * from XMLSchema.XMLTable" in the Operator, it appears you get the datas you had when the schema had been reversed. Idem when you try to view the datas in datastore. So first of all I'd like to do this control to be sure my order by is taken into account.
    Second question, do you know how the Odi XML driver builds the XML File with the command CreateXMLFile, because I think that my XML table is well sorted but that the CreateXMLFile doesn't repect this order. I checked the driver tutorial but couldn't find any help on that subject.
    So if anyone has got an idea to help me, I would appreciate a lot.
    Thanks,
    Thierry

    Still searching but without success

  • How can I auto-sort with each new entry

    I'm looking for a formula, a script, or automator service that will allow me to auto-sort by column every time I change an entry.
    My spreadsheet uses steppers. I want to automatically sort the column every time I increase the stepper.
    I'd prefer not to right click on the column to sort.
    any help?

    Not possible within your data table (the ne in which the stepper is changed), but a second table could show the sorted results, and be automatically updated whenever the steper in the first table is changed.
    Here's an example:
    The image above shows the starting position. Column A of "Data" contains the stepper cells.
    Column B, which may be hidden, contains a formula which modifies the stepper value to ensure that each cell contains a value unique within that column by adding a fractional amount dependent on the row in which the conversion is done. The value used in the formula (1000) will work for up to about 490 rows before rounding (used in the first column of the "Sorted" table) will return a result different from the integer value of the stepper. For more rows, replace 1000 with a larger number.
    Data::B2, and filled down: =A2+ROW()/1000
    The second table, "Sorted" sorts the rows of Data using the values in column B as the sort key. Sorted contains one formula, filled into every body cell on the table, and modified in column A:
    Sorted::A2, filled right: =VLOOKUP(SMALL(Data :: $B,ROW()-1),Data :: $B:$E,COLUMN())
    After filling right, modify the formula in A2 by adding ROUND( in front of VLOOKUP and ,0) after COLUMN())
    Sorted A2: =ROUND(VLOOKUP(SMALL(Data :: $B,ROW()-1),Data :: $B:$E,COLUMN()),0)
    Select cells A2:D2, then Fill down.
    In the image below, the stepper in row 10, which held 9 originally, has been stepped down to 4. There is no change in the order of the table "Data", but "Sorted" automatically resorts the rows to match the new stepper value:
    Regards,
    Barry

  • Standart report sorting with HTML expression in it

    hi,
    got a query with report links like +'<_a href="f?p=&APP_ID.:26:&APP_SESSION.:::26:P26_YEAR,P26_MONTH,P26_BACK,P26_STATUS,P26_PROJECT:&P22_YEAR.,&P22_MONTH.,22,0,'||id||'">'||saved||'</_a>'+
    with 'saved' being a numeric value, report column sorting does not work. any suggestions?
    simon

    Hi Simon,
    As you are outputting the entire HTML using SQL, you need include something at the beginning of the HTML that allows sorting to work on the correct values. I tend to use the "title" (tooltip) attribute and ensure that numbers are of equal length by padding them with zeros:
    '&lt; title="' || TO_CHAR(saved,'000000') || '" href = "' ..... etc
    {code}
    Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Material Master Replication From SAP R/3 to SRM

    Hi Gurus For the testing, I maintain a Job for the program SMOF_DOWNLOAD on daily basis in SRM system and I created the 5 material Masters in R/3. I am facing two issues. 1. The Material Master are replicated immediately, its not working as per the j

  • IMac not booting up... need help!!

    Hey guys, I got an update from apple yesterday for I believe it was a new update for quicktime, and after installing and rebooting I found that I had no control over the menubar and the dock, as I could not access anything the only thing I could thin

  • Flash bottom getting cut off

    I need a swf to fill the entire window no matter the screen size or resolution, thus I'm using the percentage system. For some reason the bottom of the swf is cut off even though the window is big enough to show it. http://www.graphicvisionsinc.com/I

  • Report for Network History

    Hi, Is there a report in SAP where I can display all activities of networks dating back in time, e.g. what work was done on a network activity 4 years ago? Thanks. rg PS_PS01

  • Ipod screen not working right

    every time i turn my ipod on the screen turns green and has lines runnung across it. It will not display the name of songs or anything but i can still hear them. I've tried restoring it and reseting but nothing is working..