Hideshow region column sort problem

Hi,
I have a HideShow region containing a PPR report. All is well except that the region hides when I click a column header to sort.
Anyone got a solution to this?
I've tried a few methods involving trying to store the ID of the region in a user-preference, but so far no joy.
Seems the kind of thing we need a generic method for.
Many thanks,
John D

carl,
Thanks for the quick response.
Glad to hear that it's a fairly easy fix, but sad to say I don't know how to implement it. Could I ask you to be more explicit?
I will be too. The problem affects any hideshow region with sortable columns, so I'm looking ideally for a generic fix.
The specific case in point is a page with 3 reports, each in a hideshow region and each in a ppr report template (though the ppr bit is irrelevant - happens with standard templates too, as it would).
The column headers generate HTML such as:
HREF="f?p=100:625:1253185985800118:fsp_sort_2::RP&fsp_region_id=2004914903282889">FirstName<(I left out the <A... A> to aid legibility here)
So I guess (yep, guess) what's required is something like:
- on an fsp_sort request, somehow trap and store the ID of the given region;
- either in the page onload code, or maybe in the page footer, fire the onclick method for the toggle element for the given region, as you suggest.
Unfortunately this is currently beyond me. Any further help will be much appreciated.
Thanks
john

Similar Messages

  • ADF Faces: columns sort problem

    Hi all,
    I'm new ADF Faces italian user and I have some problem sorting columns of table component...
    I have tried to convert my ResultSet in a List, and the data are correctly inserted in the "af:table" but the column sort don't work...
    I have already read the "af:table" Oracle specification but I have not just found a solution...
    This is the part of my backing bean that return the List:
    private List anagsList;
    public List getAnagsList()
    Connection connection;
    Statement statement;
    ResultSet resultset;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    connection = DriverManager.getConnection("jdbc:oracle:thin:@192.168.168.75:1521:ORA1", "EL2DEMO", "admin");
    statement = connection.createStatement();
    if(inputText1.getValue().toString().equals(""))
    resultset = statement.executeQuery("SELECT AN_RAGSOC, AN_NOME, AN_DATANASCITA FROM ANAGS");
    else
    String query="SELECT AN_RAGSOC, AN_NOME, AN_DATANASCITA FROM ANAGS WHERE ";
    query=query + "AN_RAGSOC LIKE '%" + inputText1.getValue() + "%' OR ";
    query=query + "AN_NOME LIKE '%" + inputText1.getValue() + "%' OR ";
    query=query + "AN_DATANASCITA LIKE '%" + inputText1.getValue() + "%'";
    resultset=statement.executeQuery(query);
    anagsList = new ArrayList();
    while(resultset.next())
    anagsList.add(new AnagsRecord(resultset.getString(2), resultset.getString(1), resultset.getString(3)));
    resultset.close();
    statement.close();
    connection.close();
    catch(Exception e)
    System.out.println(e);
    return anagsList;
    This is my AnagsRecord class:
    package mypackage.backing;
    public class AnagsRecord
    private String nome;
    private String cognome;
    private String dataNascita;
    public AnagsRecord(String nome, String cognome, String dataNascita)
    setNome(nome);
    setCognome(cognome);
    setDataNascita(dataNascita);
    public String getNome()
    return nome;
    public void setNome(String nome)
    this.nome = nome;
    public String getCognome()
    return cognome;
    public void setCognome(String cognome)
    this.cognome = cognome;
    public String getDataNascita()
    return dataNascita;
    public void setDataNascita(String dataNascita)
    this.dataNascita = dataNascita;
    And this is table component:
    <af:table var="al" emptyText="No records found."
    rows="20" value="#{backing_ADFFaces.anagsList}"
    banding="row" bandingInterval="1">
    <af:column sortable="true" sortProperty="dataNascita">
    <f:facet name="header">
    <af:outputText value="DATA NASCITA"/>
    </f:facet>
    <af:outputText value="#{al.dataNascita}"/>
    </af:column>
    <af:column sortable="true" sortProperty="cognome">
    <f:facet name="header">
    <af:outputText value="COGNOME"/>
    </f:facet>
    <af:outputText value="#{al.cognome}"/>
    </af:column>
    <af:column sortable="true" sortProperty="nome">
    <f:facet name="header">
    <af:outputText value="NOME"/>
    </f:facet>
    <af:outputText value="#{al.nome}"/>
    </af:column>
    </af:table>
    I have already installed the ADF Faces demos (column_sortable.jspx) and it works well, but the backing bean is not very understandable...
    please help me...
    ciao!

    Hi,
    I have the same problem (with another language), national characters are not sorted properly.
    Any pointers how to solve this?
    Regards,
    Patrik

  • Report Column Sorting problem

    I have a report based on a view. For some reason some of the columns are not being sorted correctly. After pressing the column header to sort date columns the underlying data is not sorted properly (it’s out of order) or it’s not sorted at all.
    Can you please let me know if there is a known bug causing that?

    I think I'm having the same problem.
    I have a report with data columns, several "not shown" columns, and several column links. I've noticed that any columns in the query after a certain point, will not sort the correct column. If I show all the columns and allow them all to sort, then some of the columns will sort the data in another column. (for example clicking on the header/sort link for column x sorts the table by column y and clicking on the sort link for column z sorts column x, etc).
    I've noticed that I can move columns around in my select query and no matter how they are arranged, after the 7th or 8th column in the select statement, none of the columns following that will sort properly. I've tried all kinds of things, changing my select query around, enabling and disabling sorting, adding additional null columns in, setting and unsetting the default sort order, changing the order of the columns in the report. I don't have an order by in my query or anything weird besides some where clauses (most of which are from the default search functionality).
    Has anyone found a solution to this problem? We just upgraded from HTML DB 2.2 to APEX 3.0 and the problem remained the same.
    Thanks,
    Greg

  • Column sorting problem

    The fields which represent prices are not sorted logically at
    all, whether I set the column type to "number" or not. If the price
    list contains values {90, 60.5, 42.5, 400}, sorted ascending gives
    {90, 60.5, 42.5, 400} and descending {400, 42.5, 60.5, 90}??? And
    how can I achieve to have two decimal numbers even if the number is
    whole like 90 => 90.00 or 60.5 => 60.50. Setting the colum
    type to "number" I lose these decimal numbers.

    If I have the following code:
    // data set
    <script type="text/javascript">
    <!--
    var ds1 = new Spry.Data.XMLDataSet("employees-02.xml",
    "employees/employee");
    ds1.setColumnType("value", "number");
    //-->
    </script>
    //html markup
    <div spry:region="ds1">
    <table>
    <tr>
    <th spry:sort="value">Value</th>
    </tr>
    <tr spry:repeat="ds1">
    <td>{value}</td>
    </tr>
    </table>
    </div>
    The xml file is:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <employees xmlns="
    http://www.foo.com/employees">
    <employee id="123543">
    <value>90</value>
    </employee>
    <employee id="127944">
    <value>60.5</value>
    </employee>
    <employee id="127373">
    <value>400</value>
    </employee>
    <employee id="127373">
    <value>42.5</value>
    </employee>
    </employees>
    Please check with you page what's wrong, because with the
    code that I gave you above it works.
    Diana

  • Report region columns constrained to 4000 chars?   Hitting LOV problems.

    Hi all,
    I've hit a problem that I'm hoping will have a simple answer.
    Quick overview of issue:
    APEX 3.01 application running against a 10gR2 DB.
    We have an LOV defined that works just fine on various forms but in report regions where the LOV is available via a drop down column value in the report region HTML table we are hitting the error:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Some judicious debugging reveals that this seems to be because we are trying to load in more than 4000 characters into the LOV drop down in the report regions HTML table column (it's a moderately large LOV)..
    This suggests that the default column type in a report region HTML table is VARCHAR2 and thus that there is a default 4000 character limit on any such column values, would that be a fair assumption? I know that the actual report row size always used to be limited to a total of 32k but this limit is a new one to me.
    If there is such a limit, does anyone have any suggestions on how to work-around it i.e. is it possible to redefine report region column values to be other datatypes/dimensions or should we be looking at using an alternative such as a pop-up instead?
    Many thanks.

    Hi Scott,
    Okay, what we have is a fairly simple Dynamic Page with two report regions (both standard type of 'SQL Query'). The second report region is the one causing us the headache. The column headings are set to 'Custom' but apart from that everything seems as it should be.
    The following query populates an HTML table being generated in the second report region (problem line in bold):
    SELECT apex_item.hidden(7,task_id)||
    apex_item.select_list_from_lov(1, estimate_type, 'TASKSMK', NULL, 'YES', 0,'** Select Task **',NULL, NULL) as "Task Type",
    '<img src="/i/themes/aqa/required.gif" alt="Required Field" tabindex="999" />'||apex_item.text(2, description,30,4000,'required="true"') as "Work Item(s)",
    dbms_lob.substr(apex_item.select_list_from_lov_xl(3, username, 'PEOPLE', NULL, 'YES', 0, '** Select Resource **', NULL, NULL),4000) as "Resource",
    apex_item.text(4, days,5,5) as "Days",
    apex_item.text(5, start_date,11,11) as "target Start (dd-mon-yyyy)",
    apex_item.text(6, NVL(end_date,ADD_MONTHS(start_date,1)),11,11) as "Target End (DD-MON-YYYY)",
    rownum link
    FROM
    (SELECT t.task_id,
    e.estimate_type,
    t.description,
    t.username ,
    t.days,
    t.start_date,
    t.end_date
    FROM estimate e, task t
    WHERE e.project_project_id = TO_NUMBER(:F172_PROJECT_ID)
    AND e.active_yn = 'Y'
    -- and t.days > 0
    AND t.ese_id = e.id
    --AND e.creation_date = (SELECT MAX(ei.creation_date) FROM estimate ei WHERE ei.project_project_id = e.project_project_id AND ei.active_yn = 'N')
    UNION ALL
    SELECT 0 task_id,
    0 estimate_type,
    NULL description,
    '0' username,
    NULL days,
    sysdate start_date,
    ADD_MONTHS(sysdate,1) end_date
    FROM dual
    CONNECT BY LEVEL < = TO_NUMBER(:P19_ROWS_CNT))
    All appears well until the number of values being returned in the second LOV (retrieved by the apex_item.select_list_from_lov_xl) exceeds 4000 characters and then we get the error first detailed. The substr around the function isn't usually present, it was added during the debugging, if I allow one more character than the 4000 or remove the substr completely then I get the error again. If the same function is used to retrieve the LOV on a normal Dynamic Form field then all is well, it only seems to have a problem when present in the HTML table being generated.
    Are we doing something silly here?
    Thanks.
    Message was edited by:
    jac

  • Problem with Column Sorting in Request Table View

    We've enabled column sorting on the table view in an Answers request but it doesn't work when more than around 400 rows are returned. It works Ok when fewer than 400 rows are returned. Does anyone know if there is a specific limit to the number of rows where column sorting works?
    Thanks,
    Mike

    I've dug into the query log a little more. When this request returns more than around 400 records and you click on a column heading to sort the table view, the query from the log is not changing to reflect the new sort order. It stays as whatever the default sort order was for the request.
    Column heading sorting on other requests in different subject areas on this same server works fine. I've tested this other request with up to 6400 rows returning and it's sorting works.
    All caching is turned off for the subject area.

  • Problem with column sort in myFaces dataTable

    Hello,
    In my dataTable I am trying to do a column sort on each column, When i click on the column header link nothing is happening. Could somebody please help. Please let me know if I am missing something.
    Here is the code.
    The jsf is as follows:
    <h:panelGrid columns="1" styleClass="tableHeaderAction">
    <t:dataTable id="fooS" value="#{supervisorsDto.tableRows}"
    var="tableRow" rows"30" styleClass="dataTable"
    headerClass="tableHeader" first="0"
    columnClasses="string,string,string,string"
    rowClasses="odd,even"
    sortAscending="#{supervisorsDto.ascending}"
    sortColumn="#{supervisorsDto.sort}"
    preserveSort="true" >
    <t:column>
    <f:facet name="header">
    <t:commandSortHeader columnName="lastName" arrow="false">
    <t:outputText value="#{screen.lastName}" />
    </t:commandSortHeader>
    </f:facet>
    <t:outputText value="#{tableRow.lastName}" />
    </t:column>
    <t:column>
    <f:facet name="header">
    <t:commandSortHeader columnName="firstName" arrow="false">
    <t:outputText value="#{screen.firstName}" />
    </t:commandSortHeader>
    </f:facet>
    <t:outputText value="#{tableRow.firstName}" />
    </t:column>
    <t:column>
    <f:facet name="header">
    <t:commandSortHeader columnName="loginName" arrow="false">
    <t:outputText value="#{screen.loginName}" />
    </t:commandSortHeader>
    </f:facet>
    <t:outputText value="#{tableRow.loginName}" />
    </t:column>
    <t:column>
    <f:facet name="header">
    <t:commandSortHeader columnName="team" arrow="false">
    <t:outputText value="#{screen.team}" />
    </t:commandSortHeader>
    </f:facet>
    <t:outputText value="#{tableRow.team}" />
    <h:inputHidden id="key" value="#{tableRow.empID}" />
    </t:column>
    </t:dataTable>
    </h:panelGrid>
    The sort method in SupervisorsDto is as follows:
    public class SupervisorsDto implements Serializable {
    private String sort="lastName";
    private boolean ascending= true;
    @SuppressWarnings("unchecked")
    public void sort(final String column,final boolean ascending)
    Comparator comparator = new Comparator()
    public int compare(Object o1, Object o2)
    Supervisors c1 = (Supervisors)o1;
    Supervisors c2 = (Supervisors)o2;
    if (column == null)
    return 0;
    if (column.equals("lastName"))
    return ascending ? c1.getLastName().compareTo(c2.getLastName()) : c2.getLastName().compareTo(c1.getLastName());
    else if (column.equals("firstName"))
    return ascending ? c1.getFirstName().compareTo(c2.getFirstName()) : c2.getFirstName().compareTo(c1.getFirstName());
    else if (column.equals("loginName"))
    return ascending ? c1.getLoginName().compareTo(c2.getLoginName()) : c2.getLoginName().compareTo(c1.getLoginName());
    else if (column.equals("team"))
    return ascending ? c1.getTeam().compareTo(c2.getTeam()) : c2.getTeam().compareTo(c1.getTeam());
    else return 0;
    Collections.sort(tableRows, comparator);
    public void sort(String sortColumn)
    if (sortColumn == null)
    throw new IllegalArgumentException("Argument sortColumn must not be null.");
    if (sort.equals(sortColumn))
    //current sort equals new sortColumn -> reverse sort order
    ascending = !ascending;
    else
    //sort new column in default direction
    sort = sortColumn;
    ascending = isDefaultAscending(sort);
    sort(sort, ascending);
    protected boolean isDefaultAscending(String sortColumn)
    return true;
    public String getSort() {
    return sort;
    public void setSort(String sort) {
    this.sort = sort;
    public boolean isAscending() {
    return ascending;
    public void setAscending(boolean ascending) {
    if(ascending != this.ascending)
    this.ascending = ascending;
    Thanks!

    I think I get really good at answering my own questions.
    It seems when you select the sort option on a column you must also set the "Sort Sequence".

  • Drag-drop data column sorting

    Hey guys,
    Does any one know how to achieve drag-drop data column
    sorting? I tried, but could not find an efficient way to do this.
    It would be an awesome spry feature if possible, but if someone
    else knows how to do this already it would help.
    Thanks,
    Timothy D Farrar

    Hey guys,
    We aim to be as compatible as possible with the other
    frameworks but sometimes problem may exists. We need to see the
    crashing pages to be able to determine the causes for the JS error
    message and where the incompatibilities are located and either fix
    the problems or help you to change your pages to work.
    In this situation I suspect the issue appears because the
    spry region is generated after the drag and drop code from the
    script.aculo.us is instantiated and we destroy the initial elements
    to which this widget is binded. In this situation the solution is
    to instantiate the drag and drop after the region generate its
    content by using the region observers. You'll have to put the drag
    and into a separated function and register the code so the region
    will call it automatically onPostUpdate.
    We include in our documentation more details about the
    Region
    observer notifications. Please search the dedicated chapter
    inside this doc: "Region observer notifications"
    Regards,
    Cristian MARIN

  • Itunes / ipod column sort locked?

    When looking at my ipod via itunes the column sort is locked on sort by "Genre" and i can't change it? When looking at my computer files it works fine it's just on the ipod? I know it worked last week? not sure if i did something or ???
    thanks

    I'm having the same problem with my iphone.  When I click the "manually manage music, it prompts me that the iphone is synced with another library.  Do i want to erase this iphone and sync with this itunes library?
    Of course I dont want to do this!  My iphone is "synced" with my computer at home, while at work, I'd like to listen to music to my iphone through my work mac (which has no mp3s on it) using itunes.  Annoying!
    Anyone find a third party solution to this?

  • JSP TableView Sorting Problem

    I have been trying to get a tableview to be sortable by clicking on the header of columns.  I have been reviewing existing threads on the forum in particular the one below.
    https://forums.sdn.sap.com/thread.jspa?threadID=16417
    I seem to understand the concept but for some reason my table does not sort, it just does nothing.  Could someone take a look and see if you can find any problems - I can't wait to give points.
    Here is all my code.
    Here is the Java....
    package MSSPackage;
    import MSSBeanPackage.PositionOverviewBean;
    import MSSPackage.SortTableModel;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentSession;
    import com.sapportals.htmlb.event.*;
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.table.*;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    import javax.servlet.http.*;
    // SAP RFC Imports
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.JCO;
    import com.sapportals.portal.prt.service.jco.IJCOClientPoolEntry;
    import com.sapportals.portal.prt.service.jco.IJCOClientService;
    import com.sapportals.portal.prt.runtime.PortalRuntime;
    import java.util.*;
    public class PositionOverview extends PageProcessorComponent {
      public DynPage getPage(){
         return new PositionOverviewDynPage();
      public static class PositionOverviewDynPage extends JSPDynPage{
         JCO.Repository mRepository;
         public JCO.Table tblRelations;
         public JCO.Table tblPositions;     
         public SortTableModel tableModel;
         public int visibleRow = 1;     
         private boolean OrgUnitSelected = false;
         public void doInitialization(){
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean oBean = new PositionOverviewBean();
              // Table Start row
              oBean.setvisibleRow(new Integer(this.visibleRow).toString());          
              oSession.putValue("myBean", oBean);
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              // Define bean reference to bean
              PositionOverviewBean myBean = new PositionOverviewBean();
              // Table Start row
              myBean.setvisibleRow(new Integer(this.visibleRow).toString());
              // Place bean in user profile.          
              myProfile.putValue("myBean", myBean);
         public void doProcessAfterInput() throws PageException {
         public void doProcessBeforeOutput() throws PageException {
              String NavType = "RCORGUNIT";
              String OType = "O";
              //String OBjid = "10004399";
              String OBjid = "";
              String sapSystem = "SAP_R3_HumanResources";          
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean myBean = (PositionOverviewBean) oSession.getValue("myBean");
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    /*          IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              //HttpSession session = request.getServletRequest().getSession();          //dmm
              //Get Bean from Profile
              PositionOverviewBean myBean = (PositionOverviewBean) myProfile.getValue("myBean");
              //PositionOverviewBean myDataBean = (PositionOverviewBean) session.getValue("POviewBean");               //dmm
              String ddlbSelection = "";
              String ddlbValue = "";
              DropdownListBox ddlbOrgUnits = (DropdownListBox) getComponentByName("ddlbOrgUnits");
              if (ddlbOrgUnits != null)
                   ddlbSelection = ddlbOrgUnits.getSelection();
                   ddlbValue = ddlbOrgUnits.getValueAsDataType().getValueAsString();
                   OBjid = ddlbValue;
                   myBean.setObjId(OBjid);
              else
                   OBjid = "";
                   myBean.setObjId(OBjid);                 
              IJCOClientService clientService;
              IJCOClientPoolEntry poolEntry;          
              JCO.Client client;          
              try
                   clientService = (IJCOClientService) PortalRuntime.getRuntimeResources().getService(IJCOClientService.KEY);
                   poolEntry = clientService.getJCOClientPoolEntry(sapSystem, request);
                   client = poolEntry.getJCOClient();
                // connect to SAP system, logon
                   client.connect();
                // Create Jco Repository Object
                   mRepository = new JCO.Repository("R3USERMENU", client);
                // Reset function object
                   JCO.Function function = null;
                // Run RFC Module on SAP system
                   function = this.createFunction("HRWPC_GET_NAV_OBJECTS");
                   JCO.ParameterList input = function.getImportParameterList();
                   input.setValue("RCORGUNIT", "NAVTYPE");               
                   client.execute(function);
                   tblRelations = function.getTableParameterList().getTable("RESULT_OBJEC");
                   myBean.setRowcnt(tblRelations.getNumRows());
                   if (tblRelations.getNumRows() != 0)               
                        myBean.setOrgUnits(tblRelations);
                        if (ddlbOrgUnits == null)
                             // check to see if there is not a position id already assigned
                             tblRelations.setRow(0);
                             OBjid = tblRelations.getString("OBJID");
                             myBean.setObjId(OBjid);
                             //myBean.sTemp = OBjid;                         
                   // GET THE POSITION DETAILS
                   function = null;
                   input = null;
                   function = this.createFunction("Z_GET_POSITION_OVERVIEW");
                   input = function.getImportParameterList();               
                   input.setValue(NavType, "NAVTYPE");               
                   input.setValue(OType, "OTYPE");
                   input.setValue(OBjid, "OBJID");               
                   client.execute(function);
                   tblPositions = function.getTableParameterList().getTable("RESULT_OBJEC");
                   myBean.setRowcnt(tblPositions.getNumRows());
                   tableViewFormat();
                   tableModel.setTesting("Startxxxx");
                   myBean.settableModel(tableModel);
                   //tableModel.setTesting("SSSS");               
                   //myDataBean.settableModel(tableModel);                                             //dmm               
                   //session.setAttribute("POviewBean", myDataBean);                                //dmm
                   oSession.putValue("myBean", myBean);
              //Release pool entry
              poolEntry.release();                           
           catch(Exception ex)
                //name = ex.getMessage();                         
           //String sTest = "this is a test";      
           //request.getComponentSession().putValue("Test", sTest);
           //myProfile.putValue("Testx", sTest);
           this.setJspName("PositionOverviewJSP.jsp");
         public void getPositions()
              String NavType;
              String Root_Ot;
              String Root_ObjId;
         public void tableViewFormat()
              // Define the vectors used to build tableView
              Vector tempRec = new Vector();
              Vector dataRec = new Vector();
              String sDate = "";
              String sPosLink = "";
              String sPosVal = "";
              String sENameLink = "";
              String sENameVal = "";
              String sStatus = "";
              // Loop at company code list and add to vectors
              for (int i = 0; i < tblPositions.getNumRows(); i++)
                   tblPositions.setRow(i);
                   tempRec = new Vector();
                   sStatus = (String) tblPositions.getString("STATUS");
                   if (sStatus != null)
                        if (sStatus.equals("0"))                    
                             sDate = tblPositions.getString("ZHR_VACANT_BEGDA");
                             sDate = sDate.substring(5, 7) + "/" + sDate.substring(8, 10) + "/" +  sDate.substring(0, 4);                         
                        else
                             sDate = "";                    
                   sPosVal = tblPositions.getString("STEXT");
                   sENameVal = tblPositions.getString("ENAME");
                   if (sPosVal.equals(""))
                        sPosLink = sPosVal;
                   else
                        sPosLink = "<a HREF="myLink" onclick="return EPCM.doNavigate('ROLES://portal_content/com.sap.portal.migrated/ep_5.0/pages/com.sap.pct.hcm.positionprofile?CKey=000000" + tblPositions.getString("OBJID") + "', 1)">" + tblPositions.getString("STEXT") + "</a>";
                   if (sENameVal.equals(""))
                        sENameLink = sENameVal;
                   else
                        sENameLink = "<a HREF="myLink" onclick="return EPCM.doNavigate('ROLES://portal_content/com.phi/com.phi.mgt/com.phi.mss/com.phi.hr/com.phi.pages/com.phi.mgt.mss.hr.pages.positionholder?CKey=000000" + tblPositions.getString("OBJID") + "', 1)">" + tblPositions.getString("ENAME") + "</a>";
                   tempRec.addElement(sStatus);
                   tempRec.addElement(tblPositions.getString("OBJID"));
                   tempRec.addElement(sPosLink);
                   tempRec.addElement(sENameLink);
                   tempRec.addElement(sDate);               
                   dataRec.addElement(tempRec);
              // Then define the technical column names
              Vector colNames = new Vector();
              colNames.addElement("STATUS");
              colNames.addElement("OBJID");
              colNames.addElement("STEXT");     
              colNames.addElement("ENAME");
              colNames.addElement("ZHR_VACANT_BEGDA");
              // Now we build the actual tableView
              //tableModel = new DefaultTableViewModel(dataRec, colNames);
              tableModel = new SortTableModel(dataRec, colNames, 5);     
              // Define tableView parameters
              tableModel.setKeyColumn(2);
              TableColumn column = tableModel.getColumn("STATUS");
              column.setEncode(false);
              column.setType(com.sapportals.htmlb.enum.TableColumnType.USER);
              column.setTitle("Vacant");
              column = tableModel.getColumn("OBJID");
              column.setTitle("Position Number");
              column = tableModel.getColumn("STEXT");
              column.setTitle("Position");
              column = tableModel.getColumn("ENAME");
              column.setTitle("Holder of Position");          
              column = tableModel.getColumn("ZHR_VACANT_BEGDA");
              column.setTitle("Vacant as of");
         //     * Navigation Button Clicked
         public void myOnNavigate(Event event)
              TableNavigationEvent tne = (TableNavigationEvent) event;
              visibleRow = tne.getFirstVisibleRowAfter();
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              // Get Bean from profile
              PositionOverviewBean myBean = (PositionOverviewBean) myProfile.getValue("myBean");
              // Table Start row
              myBean.setvisibleRow(new Integer(this.visibleRow).toString());
         public void onHeaderClick(Event event)
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean myBean = (PositionOverviewBean) oSession.getValue("myBean");
              TableHeaderClickEvent tne = (TableHeaderClickEvent) event; // get the event
              SortTableModel tblModel = myBean.gettableModel();
              //tblModel.sort();
              int col = 3;
              tblModel.sortByColumn(col);
              myBean.settableModel(tblModel);
              oSession.putValue("myBean", myBean);
         // Create Function object for RFC Calls
         public JCO.Function createFunction(String name) throws Exception
              try
                   IFunctionTemplate ft = mRepository.getFunctionTemplate(name.toUpperCase());
                   if (ft == null)
                        return null;
                   return ft.getFunction();
              catch (Exception ex)
                   ex.printStackTrace();
                   throw new Exception("Problem retrieving JCO.Function object");
         public void onSelectddlbOrgUnits(Event event) throws PageException
              OrgUnitSelected = true;          
    Here is the JSP
    <%@ page import="com.sap.mw.jco.*" %>
    <%@ page import="com.sapportals.htmlb.enum.*" %>
    <%@ page import="MSSPackage.TableViewCellRenderer" %>
    <%@ page import="com.sapportals.portal.prt.component.IPortalComponentRequest" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="com.sapportals.portal.prt.component.IPortalComponentContext" %>
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
         <hbj:page title="PageTitle">
              <hbj:form id="myFormId" >  
              <jsp:useBean id="myBean" scope="session" class="MSSBeanPackage.PositionOverviewBean" />     
                   <hbj:gridLayout rowSize="1" columnSize="1" cellSpacing="1">
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="1">
                             <hbj:textView id="ddlbLable" text="Select organizational unit to display positions" design="STANDARD" />
                        </hbj:gridLayoutCell>                         
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="2">
                             <hbj:dropdownListBox id="ddlbOrgUnits" onSelect="onSelectddlbOrgUnits" selection="<%=myBean.getObjId()%>">                                                       
                                  <%                         
                                       JCO.Table org_units = null;                                                       
                                       org_units = myBean.getOrgUnits();
                                       for (int i = 0; i < org_units.getNumRows(); i++)
                                            org_units.setRow(i);
                                            String sUnit = org_units.getString("STEXT");
                                            String Unit_Id = org_units.getString("OBJID");
                                  %>
                                  <hbj:listBoxItem key="<%=Unit_Id%>" value="<%=sUnit%>" />
                                  <%
                                  %>
                             </hbj:dropdownListBox>                                                                                                   
                        </hbj:gridLayoutCell>
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="3">
                             <hbj:textView id="listLable" text="To designate a vacant position, click the icon in the 'Create Form' column" design="STANDARD" />                    
                        </hbj:gridLayoutCell>                    
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="4">     
                             <hbj:tableView
                                  id="myTableView"
                                  headerVisible="true"
                                  footerVisible="true"
                                  fillUpEmptyRows="true"
                                  selectionMode="NONE"                              
                                  navigationMode="BYPAGE"
                                  onNavigate="myOnNavigate"                                        
                                  visibleFirstRow="<%= myBean.getvisibleRow() %>"                                                  
                                  visibleRowCount="5" >                                                            
                                  <%
                                  myTableView.setOnHeaderClick("onHeaderClick");
                                  myTableView.setUserTypeCellRenderer(new TableViewCellRenderer());                                                             
                                  myTableView.setModel(myBean.gettableModel());
                                  myTableView.setColumnType(TableColumnType.LINK, 3);
                                  myTableView.setColumnType(TableColumnType.LINK, 4);                              
                                  %>
                             </hbj:tableView>
                        </hbj:gridLayoutCell>                                        
                   </hbj:gridLayout>   
              </hbj:form>
         </hbj:page>
    </hbj:content>
    Here is the BEAN
    package MSSBeanPackage;
    //import com.sapportals.htmlb.enum.TableColumnType;
    import MSSPackage.SortTableModel;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    //import com.sapportals.htmlb.table.TableColumn;
    //import com.sapportals.htmlb.table.TableView;
    //import com.sapportals.htmlb.table.TableViewModel;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.JCO.Table;
    public class PositionOverviewBean {
    //     public DefaultTableViewModel tableModel;
         public SortTableModel tableModel;
         public JCO.Table OrgUnits;
         public String ObjId;
         public String visibleRow;
         public int rowcnt;
         public String sTemp;
         // Get and Set methods for table model
    //     public DefaultTableViewModel gettableModel() { return tableModel; }
    //     public void settableModel(DefaultTableViewModel tableModel)     { this.tableModel = tableModel;     }
         public SortTableModel gettableModel() { return tableModel; }
         public void settableModel(SortTableModel IntableModel)     { this.tableModel = IntableModel;     }     
         public JCO.Table getOrgUnits()     { return OrgUnits; }
         public void setOrgUnits(JCO.Table value) { this.OrgUnits = value; }
         // Get and Set methods for visiblerow
         public String getvisibleRow() {     return visibleRow; }
         public void setvisibleRow(String visibleRow) { this.visibleRow = visibleRow; }     
         public int getRowcnt() { return this.rowcnt; }
         public void setRowcnt(int rowcnt) { this.rowcnt = rowcnt; }
         public String getObjId() { return this.ObjId; }
         public void setObjId(String value) { this.ObjId = value; }     
    Here is the sorting class
    package MSSPackage;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.Vector;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    public class SortTableModel extends DefaultTableViewModel implements Comparator {
         //protected int currCol;
         public int currCol;
         protected Vector ascendCol; // this vector stores the state (ascending or descending) of each column
         protected Integer one = new Integer(1);
         protected Integer minusOne = new Integer(-1);
         public String testing;
         public SortTableModel()
              super();
              ascendCol = new Vector();
         public SortTableModel(Vector vec)
              super(vec);
              ascendCol = new Vector();
         public SortTableModel(Vector vec, Vector vec2, int numberOfColumns)
              super(vec, vec2);
              ascendCol = new Vector();
              setSortOrder(numberOfColumns);
         public int compare (Object v1, Object v2)
              // the comparison is between 2 vectors, each representing a row
              // the comparison is done between 2 objects from the different rows that are in the column that is being sorted
              int ascending = ((Integer)ascendCol.get(currCol)).intValue();
              if (v1 == null && v2 == null)
                   return 0;
              else if (v2 == null)
              { // Define null less than everything.
                   return 1 * ascending;
              else if (v1 == null)
                   return -1 * ascending;
              Object o1 = ((Vector)v1).get(currCol);
              Object o2 = ((Vector)v2).get(currCol);
              // If both values are null, return 0.
              if (o1 == null && o2 == null)
                   return 0;
              else if (o2 == null)
              { // Define null less than everything.
                   return 1 * ascending;
              else if (o1 == null)
                   return -1 * ascending;
              if (o1 instanceof Number && o2 instanceof Number)
                   Number n1 = (Number)o1;
                   double d1 = n1.doubleValue();
                   Number n2 = (Number)o2;
                   double d2 = n2.doubleValue();
                   if (d1 == d2)
                        return 0;
                   else if (d1 > d2)
                        return 1 * ascending;
                   else {
                        return -1 * ascending;
              else if (o1 instanceof Boolean && o2 instanceof Boolean)
                   Boolean bool1 = (Boolean)o1;
                   boolean b1 = bool1.booleanValue();
                   Boolean bool2 = (Boolean)o2;
                   boolean b2 = bool2.booleanValue();
                   if (b1 == b2)
                        return 0;
                   else if (b1)
                        return 1 * ascending;
                   else
                        return -1 * ascending;
              else
                   // default case
                   if (o1 instanceof Comparable && o2 instanceof Comparable)
                        Comparable c1 = (Comparable)o1;
                        Comparable c2 = (Comparable)o2; // superflous cast, no need for it!
                        try
                             return c1.compareTo(c2) * ascending;
                        catch (ClassCastException cce)
                        // forget it... we'll deal with them like 2 normal objects below.
                   String s1 = o1.toString();
                   String s2 = o2.toString();
                   return s1.compareTo(s2) * ascending;
         * This method sorts the rows using Java's Collections class.
         * After sorting, it changes the state of the column -
         * if the column was ascending, its new state is descending, and vice versa.
         public void sort()
              Collections.sort(dataVector, this);          
              //Collections.sort(dataVector);
              Integer val = (Integer)ascendCol.get(currCol);
              ascendCol.remove(currCol);
              if (val.equals(one)) // change the state of the column
                   ascendCol.add(currCol, minusOne);
              else
                   ascendCol.add(currCol, one);
         public void sortByColumn(int column)
              this.currCol = column;
              sort();
         public void setSortOrder(int numberOfColumns)
              for (int i = 0; i < numberOfColumns; i++)
                   ascendCol.add(one);
         public void setTesting(String inStr)
              testing = inStr;
    Any help would be greatly apprciated and rewarded...

    Hi Don,
    be aware that after the method onHeaderClick(Event event) is executed the method doProcessBeforeOutput() is executed as well.
    I look over your code and found the following:
    1) In method onHeaderClick you sort the table model and store the table model in the bean
    2) In method doProcessBeforeOutput() you create a new table model from scratch (in helper method tableViewFormat())and store it in the bean. Thus you overwrite the sorted model.
    I suggest that you move the initial creation of the table model in method doInitialization(). Do not forget to store the created table in the bean. In method doProcessBeforeOutput() you retrieve the table model from the bean instead of creating a new one for every request.
    Best regards,
    Martin

  • ALV Sort problem

    Hi Experts,
    I have encountered a peculiar situation with respect to ALV, using sort. The problem is as follows:
    1. I have an internal table with 3 fields, upon which I am supposed to implement a sort criteria on the first two fields.
    2. My data is something like this, for ex:
    abc  1  a
    abc  1  b
    cde  1  a
    cde  1  b
    3. I have applied sort criteria, on the first two fields and passed to the fm "REUSE_ALV_GRID_DISPLAY'.
    4. Now the output is as follows:
    abc  1  a
      --  b
    cde --  a
    ---   --  b
    Here ( -- ) dotted lines mean the identical entry from the previous row...
    5. My requirement is I want the output as:
    abc  1  a
    ---  --   b
    cde  1  a
    ---   --  b 
    I mean the sort critetia of the second column should follow the first(adjacent column) sort criteria
    I hope it is clearly explained, and kindly let me know how this can be solved..
    Thank you,
    Shashi

    Hi Bala,
    The suggested solution is not giving the desired results..
    This happens because, when i sort the entries i mentioned earlier, remains the same, even after the two explicit sort statements on the internal table.
    Kindly check the same and let me know.
    Regards,
    Shashi

  • Sort problem on dynamic query !!

    Hi,
    I have a dynamic query written in pl/sql, when I check "Sort" for each field in Report Attribute, error message raised up as "ORA-01785: ORDER BY item must be the number of a SELECT-list expression".
    If I do not check Sort, it works fine. In my apps I need all fields sorted by user, how to fix this problem?
    My query as below:
    declare
    query varchar2(2000):='select';
    s_class varchar2(1000);
    cursor c1 is select * from demo_preference;
    begin
    for c1_val in c1 loop
    if c1_val.login is not null then
    query := query ||' ' || 'login' || ',';
    end if;
    if c1_val.id is not null then
    query := query ||' ' || 'id' || ',';
    end if;
    end loop;
    query := SUBSTR(query, 1, length(query)-1);
    s_class := '(NVL(:P2_class, ''%'' || ''null%'') = ''%'' || ''null%'' OR
    EXISTS (SELECT 1 FROM apex_collections WHERE collection_name = ''P2CLASSCOL'' AND c001 = class))';
    query := query ||' ' || 'from ming.reg_report_view1 where'
    || ' ' || s_class;
    return(query);
    end;

    Maybe the internally mapped column used when you clicked on sort is not shown in the report. Try using aliases when you construct the query string, it could help apex internally in identifying a column even if its order changes for a different user. After all the column order in the code is dynamic and I guess even the no of columns displayed might vary both of which could make sorting on a column identified with a number, invalid.
    How about displaying the report query somewhere, so that you know what is the exact query being processed, it might give you better information about the problem.
    If the problem persists, then use a collection that is fetched those record using the same query string and change the report to refer the collection and then set column sorting on. This way apex would get confused on what columns are being sorted and it would just sort on a c001..c050 column as though it was a string(yes problems with number columns sorting when you do this).

  • Reports serialising when column sort attributes used

    If an Apex user has two sessions and runs the same report page in both, then if the report uses column sort attributes (rather than an ORDER BY in the SQL), the second is blocked by the first; once the first completes the second then runs and completes. This appears to be because the user preferences for column sorting are being updated each time, even if they have not been changed.
    This application demonstrates the problem:
    http://htmldb.oracle.com/pls/otn/f?p=15827:2
    Create 2 sessions using that URL. The page has a report based on ALL_OBJECTS with an item "Owner" to filter on. Enter "%" in the first session and press Enter and the report will run, taking about 1 minute. Meanwhile in the second session enter a specific owner (or just XXX) and press Enter. The second report will finish just after the first finishes, even though when run alone it only takes half a second or so.
    Is this a bug?

    Hi Tony,
    If you're using this on unauthenticated pages, then the sort preferences are stored per user for the APEX_PUBLIC_USER (or HTMLDB_PUBLIC_USER), which is potentially why you're seeing the serialisation/dead-locking.
    Could you perhaps use the suggestion by Scott in this thread -
    Re: Report sorting affected by other users
    To use the session ID as the APEX user (or anything else you prefer), to mitigate the potential for the deadlock? (It's worth trying and should take just a few seconds to test in your sample app?).
    John.

  • Sorting problem in standard vendor search help

    Hi all,
    I'm enhancing the vendor search help.
    I found that there is a sorting problem in the original standard search help.
    The 1st time to search vendor in the search help returns a correct list, then I just sort the vendor in ascending order. This time the column name of the hit list changes and mismatch the actual values.
    Any one faced this problem before?
    What's wrong are there ?
    Thanks.

    Thanks Peluka.
    But even I don't enhance the vendor search help, I still found that the original standard version has this problem after sorting.
    Is that the program bug?
    Have anyone encountered this problem before?

  • Embedded images disappear on column sorts when viewing SSRS via url in an iframe

    RE:   SQL Server - 2008 R2  Reporting Services
    We deliver an ASP.Net MVC (5) application and some of the views show/display SSRS report via url in an iframe (so the report is displayed vi the web viewer).   There are images in the header of some of these reports which display correctly on the initial
    view, but "disappear" when the user uses a report column sort and/or changes the report zoom (via the SSRS web viewer toolbar). There are other quirky behaviors as well (depending on the browser), but we are dealing with IE versions 8 thru 11.  I've
    already set the ReportViewer.aspx to use <meta http-equiv="X-UA-Compatible" content="IE=7">, and our application pages/views use <meta http-equiv="X-UA-Compatible" content="IE=edge">.
    Does anyone have a "fix" for this? I know it's related to the ReportViewer.aspx and displaying the report(s) in an iframe, but I can't seem to find any information on how to fix the issue.

    Hi,
    According to your description, when you preview report through url in an iframe, the embed images can be displayed, images can’t be displayed after users used sort and changed report zoom.
    To troubleshoot the problem, please refer to the following steps:
    Run the report in Business Intelligence Development Studio (BIDS) to make sure that the images can be displayed correctly.
    The issue may be relevant to compatibility of browser, please use different browser to check whether the issue persists.
    If you are using embedded image of jpg type, please change the extension of the image to png.
    Set the ReportViewer.aspx to use <meta http-equiv="X-UA-Compatible" content="IE=8">.
    Here is a relevant thread you can reference:
    https://social.technet.microsoft.com/Forums/en-US/56650bf4-e65d-4f84-8ac0-a57cb26543b2/image-disappears-when-sorting-in-ssrs-for-server-report-on-report-vieweron-aspx-page?forum=sqlreportingservices
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.
    Wendy Fu
    TechNet Community Support

Maybe you are looking for

  • IWeb not showing .Mac web gallery albums in Web Widgets pull down menu

    I'm trying to update a webpage and insert a .Mac Web gallery album using the Web Widgets pull down menu. The problem is the menu isn't offering/showing ALL of my .Mac Web Gallery albums. It shows some and I can insert those, however, it isn't showing

  • Database memory dump (please help!!!!!).

    Hello people, I have a big problem with one of the database of my company, it seems that is a memory fail when try to allocate space or something, i search the Metalink looking for a solution but, I really don´t know what is the real problem of this

  • Regarding A/C posting

    HI experts, i hv to a develope a report,the scenario is like this... **There is no report to see the personal numbers whose account posting has been done.eg..A table showing the personal number,run number,document number and the amount which is being

  • 3rd Party Apps not working after 3.1 update

    As the topic says, none of my third party apps are working at the moment. I tried doing a full restore and backup and that doesn't seem to do anything. I've also noticed that most of my music is not syncing, even though podcasts and movies are. I'm r

  • How to make custom start end shapes for stroke (arrowheads)...

    hello... Indesign cs4 have nice start end stroke shapes like arrowheads, circles, squares...circles is clear, without fill. I need fill in it. How to make custom shapes or edit existings start/end shapes to functioning like original provided with ind