How do I set the CoreTable sort column in the managed bean?

I have a CoreTable with two columns, first name and company, from the managed bean in a session scope, how do I set the company column to be the default/selected sort order?
Or is that done by binding the af:column to a CoreColumn object in the managed bean, which method would I use?
<af:column sortProperty="company" sortable="true">
<f:facet name="header">
<af:outputText value="#{common.labelCompany}"/>
</f:facet>
<af:outputText value="#{row.company}"/>
</af:column>
Thanks,
--Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Yes, I know, "sortable", see, I even used it in my example. I don't want to disable default sorting.
What I'm asking is how to have more than one sortProperty. When the user clicks the column heading, I want to sort by "myFirstProperty" AND "mySecondProperty". The sortProperty only seems to allow one sort property.
One possibility seems to be to programatically add items to the List of SortCriterion objects as in your example, but where would I put this code so that it is executed when the user clicks the column heading, but before the table is sorted.

Similar Messages

  • How can I get (using API) the current sort column for some report

    hello,
    How can I get (using API) the current sort column for some report ? For example something like "fsp_sort_1_desc" - if the user sorts by the first column ?
    I cannot use the :REQUEST for this, sometimes the current sort column is not in the :REQUEST, but it is still active.
    I thought it was posssible by using
    APEX_UTIL.GET_PREFERENCE (
    p_preference IN VARCHAR2 DEFAULT NULL,
    p_user IN VARCHAR2 DEFAULT V('USER'))
    RETURN VARCHAR2;
    function, but I don't really know which preference should I pass as parameter.
    looking in WWV_FLOW_PREFERENCES$, i saw preferences_names like FSP4000_P527_R6281510839654570_SORT , I'm not sure how this name is formed.
    I'm using generic columns for that complex report (which has a flexible number of columns shown), and the idea is that sometimes I have to overwrite that sort column, in case the user chose the version of the report with fewer columns than the previous one.
    Can I get (using API) a list of all preferences set for some user ?
    Thank you,

    seems that it is FSP<app_number>P<pagenumber>R<regionnumber>_SORT.
    is there anyplace where I can get these kind of things documented ?
    Thank you.

  • How Can I set up a JTable columns?

    Dear All,
    How can I set up my JTable columns to have the amount the user specifies?
    for example when the user types in 50 in JTextField 1 I want the JTables columns to then set to 50.
    How can this be done?
    Thanks
    lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

    As you can see I have tried this, but no success.
    If I am doing something wrong please accept my apology, and address me in the right direction.
    Thanks
    Lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
         ((DefaultTableModel)perstab.getModel()).setColumnCount(Integer.parseInt(name.getText()));
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

  • How do I change the order of columns in the responses table?

    How do i change the order of columns in the responses table in FormsCentral?  The default setting puts them in reverse order!

    Hi,
    The issue with the default ordering of columns in the response table is something that we hope to address in the next update to FormsCentral. In the meantime, you can reorder the columns by selecting them then click/drag using the gray area above the column name. As shown below, an orange marker will show you where the columns will be placed when you release the mouse button.
    Sorry for the inconvenience.
    Regards,
    Brian

  • I have a new MAcBook Air and my photos don't fit on the internal hard drive.  I want to store my photos on an external hard drive which I will connect to my Air when using Iphoto.  How do I set an external hard drive as the default drive?

    I have a new MAcBook Air and my photos don't fit on the internal hard drive.  I want to store my photos on an external hard drive which I will connect to my Air when using Iphoto.  How do I set an external hard drive as the default drive in Iphoto?

    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • HT1351 I have a new iPod Touch......I was able to successfully set up a new account, but I want it to be separate from the 800 songs I already have in my iTunes library.  How do I set up a separate library on the same computer?

    I have a new iPod touch; I have an iTunes library of music for an older iPod shuffle.  I'd like to set up the iPod touch for my wife with a separate library of music - I was successful in setting up a separte account, but it seems my 800 songs are still there in the library.  How do a set up a new account on the same computer without bringing along all the music that will clog up her iPod touch?

    There's a few ways of doing it. The following document may be of some help:
    How to use multiple iPods, iPads, or iPhones with one computer

  • How do i set up multiple iCloud accounts on the same mac?

    how do i set up multiple iCloud accounts on the same mac?

    Interesting - I was sure I'd seen a note somewhere that it was only Mail, but this article:
    http://support.apple.com/kb/ts4020
    does say
    Your secondary iCloud accounts can be set up and viewed in Settings > Mail, Contacts, Calendars on your iOS device, or Apple () menu > System Preferences > Mail, Contacts, Calendars on OS X Lion. You may choose to do this if you have a second iCloud account and need to access its Mail, Contacts, or Calendar data. 
    Note: While you can configure multiple iCloud Mail accounts in iOS, Push mail will only work for the primary iCloud account in iOS. Secondary account(s) will check for mail based on the settings in Settings > Mail, Contacts, Calendars > Fetch New Data.
    It's not something I can test - I suppose the second account's data gets added to the lists in iCal and Address Book?

  • I bought a used ipad on ebay and the icloud acct is still linked to the old owner who doesn't remember the acct information. How can I set up my apple id on the iPad.

    I bought a used ipad on ebay and the icloud acct is still linked to the old owner who doesn't remember the acct information. How can I set up my apple id on the iPad?

    You will need the previous owner's Apple ID and Password to:
    1. Turn off Find My iPhone
    2. Erase device
    3. Reactivate device

  • How can I set up an email signature in the Nokia 822

    How can I set up an email signature in the Nokia 822?

        Great question, Robobenn! Here is how to add the signature:
    From the Start screen, tap the Mail tile.
    Tap the More icon.
    Tap settings.
    To enable, tap the Signature on/off switch.
    Scroll to, then tap the Signature field.
    Enter the desired signature, then tap the Checked icon.
    For additional support, go to: vzw.com/support
    Thank you,
    LenaA_VZW
    Follow us on Twitter @VZWSupport

  • How do you set a default Home Page in the Safari Applet?

    How do you set a default Home Page in the Safari Applet?

    How do you set a default Home Page in the Safari Applet?

  • How do I set two different beat measures in the same project, e.g. 2/4 and 3/4?

    How do I set two different beat measures in the same project, e.g. 2/4 and 3/4?

    mpcsouza wrote:
    How do I set two different beat measures in the same project, e.g. 2/4 and 3/4?
    you can't, GB is restricted to a single time signature per project
    however, the time sig is really more cosmetic, it doesn't affect the way the project plays back, so you could set the project to 2/4 when working on the 2/4 parts, and 3/4 when working on the 3/4 parts

  • How do I set up my iMac g4 to the Internet?

    How do I set up my iMac g4 to the Internet?

    http://docs.info.apple.com/article.html?artnum=106748 Mac OS X: Troubleshooting a dial-up/PPP Internet connection 
    http://docs.info.apple.com/article.html?artnum=106749 Troubleshooting a cable modem, DSL, or LAN Internet connection

  • How do I set up a second iphone using the same iTunes account?

    How do I set up a second iphone on the same iTunes account but give my wife ability to have her own calendar and contacts?

    Create a separate iTunes library for each device. Note: It is important that you make a new iTunes Library file. Do not just make a copy of your existing iTunes Library file. it will work. I am using it through this

  • How to SQL*loader to skip some columns from the source file?

    I am using oracle9i sqlldr to load some .csv files into db.
    If I want to skip the first two columns in the source file, can I do that?
    If yes, how should I specify it in the ctl file?
    Thanks
    Wendy

    Hello Dave,
    Here is a sample of what you'll need to have in your control fileLOAD DATA
    APPEND
    INTO TABLE <target_table>
    FIELDS TERMINATED BY ','
    ( column_1  FILLER
    , column_2
    , column_3
    , column_4  FILLER
    )Hope this helps,
    Luke

  • I just purchased a song from I tunes this was my first one .... How do I set it as a ringtone on the I phone 5

    I've purchased a song from I tunes how do I set it as a ringtone on the I phone 5 btw this is my first I phone so please help

    You can't use the whole song as a ringtone, you would have to create it either by using itunes or an app.
    http://www.ehow.com/how_2160460_custom-iphone-ringtones-free.html
    There are a lot of ringtone maker in the app store, do a search.  Just make sure you read the reviews before you download it.

Maybe you are looking for