Editable Table Sort Action

All,
We have a requirement where user can perform inline table (af:table) edits. If the user after editing few columns, tries to sort/applies a filter, the table refreshes and all the uncommitted data is lost.
Any suggestions/workarounds on how we could solve this issue?
JDev version: 11.1.1.3 (PS2)

When you click the sort, the table by default re-executes the query to populate the iterator - so before it does this it wants to make sure it doesn't loose any changes you made.
So the behavior is logical.
If you have another approach you want to take you can code it in the sortListener for the table to override the default behavior.

Similar Messages

  • Table Sort Action

    Hi,
    I have a table with no datas.I enter some new data and then try to sort it the values in the table is being vanished .but if i submit the data it is submitted in the database
    can you pleas help me to solve the issue.

    Please mention your jdev version and a use case...
    How about submitting the data to the db first and then sorting it?
    Sorting a table normally means that a query with the specific 'order by' clause is run through the db. So if your DB table doesn't have any data, you don't get any data back resulting in an empty table. Still the new not committed records are part of the current transaction and are getting posted to the db with the next commit.
    Timo

  • Table sorting

    Hello All,
    I already implement table sorting in my application.How can i trigger a table sort action on a particular column after I have compeleted some other action?
    Thanks

    Use IWDNode.sortElements(Comparator).
    The Comparator instance passed to this method should cast its arguments to the node element interface and compare them by the attribute displayed in the particular column.
    Say your node is named "Employees" and the attribute is "Name" and has type "String", then it looks like
    Comparator comparator = new Comparator()
      public int compare(Object x1, Object x2)
        IEmployeesElement e1 = (IEmployeesElement ) x1;
        IEmployeesElement e2 = (IEmployeesElement ) x2;
        return e1.getName().compareTo(e2.getName());
    node.sortElements(comparator);
    Armin

  • Table Sorting: How is firstVisibleRow being affected?

    Dears,
    I'm confused at table sorting using Tablesorter.java.
    When sorting, how does Tablesorter affect the firstVisibleRow of the table?
    In the "[Working with tables|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90ac0015-d1c5-2a10-d788-aed89990811d]" sample SDN provided, when press "sorting asending" or "sort descending", the table's first visible row changes automatically.
    I didn't understand why firstVisibleRow changed to be so. And I don't know how the firstVisibleRow will change to be.
    I checked the code of Tablesorter, and I also tried to debug into it, but didn't find any track.
    Any word is appreciated. Thanks in advance.
    Edited by: gangtee gangtee on May 2, 2008 4:59 PM

    Attached is Tablesorter.java
    package com.sap.tc.webdynpro.tests.utils;
    import java.text.Collator;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Comparator;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Map;
    import java.util.StringTokenizer;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByIndex;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByKey;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractInputField;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractTableColumn;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDCaption;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDCheckBox;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDLink;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDProgressIndicator;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDRadioButton;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableCellEditor;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableColumn;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableColumnGroup;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextEdit;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextView;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDTableColumnSortDirection;
    import com.sap.tc.webdynpro.progmodel.api.IWDAction;
    import com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent;
    import com.sap.tc.webdynpro.progmodel.api.IWDNode;
    import com.sap.tc.webdynpro.progmodel.api.IWDNodeElement;
    import com.sap.tc.webdynpro.progmodel.api.IWDViewElement;
    import com.sap.tc.webdynpro.services.sal.localization.api.WDResourceHandler;
    * Helper class that makes a Web Dynpro table UI element sortable (column-wise).
    public final class TableSorter {
          * @param table
          * @param sortAction
          * @param comparators
         public TableSorter(IWDTable table, IWDAction sortAction, Map comparators) {
              init(table, sortAction, comparators, null);
         public TableSorter(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns) {
              init(table, sortAction, comparators, sortableColumns);
          * Initialisation stuff
         private void init(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns){
              this.table = table;
              if(sortableColumns == null){
                   sortableCols = null;
              }else{
                   sortableCols = new HashMap();
                   for (int i = 0; i < sortableColumns.length; i++) {
                        sortableCols.put(sortableColumns<i>, sortableColumns<i>);
              // sanity checks
              if (sortAction == null)
                   throw new IllegalArgumentException("Sort action must be given");
              if (table == null)
                   throw new IllegalArgumentException("Table must be given");
              if (table.bindingOfDataSource() == null)
                   throw new IllegalArgumentException(
                        "Data source of table with id '" + table.getId() + "' must be bound");
              // make the columns sortable
              String dataSourcePrefix = table.bindingOfDataSource() + ".";
              setComparatorsForColumns(dataSourcePrefix, table.iterateGroupedColumns(), comparators);
              //set up the table properties
              table.setOnSort(sortAction);
              table.mappingOfOnSort().addSourceMapping(IWDTable.IWDOnSort.COL, "selectedColumn");
              table.mappingOfOnSort().addSourceMapping(IWDTable.IWDOnSort.DIRECTION, "sortDirection");     
          * Try to make the given columns sortable (recusivly, if necessary)
         private void setComparatorsForColumns(String dataSourcePrefix, Iterator columnIterator, Map comparators){
              int index = 0;
              for (Iterator it = columnIterator; it.hasNext(); ++index) { // for every column: try to make it bindable
                   IWDAbstractTableColumn abstractColumn = (IWDAbstractTableColumn) it.next();
                   if(abstractColumn instanceof IWDTableColumn){
                        IWDTableColumn column = (IWDTableColumn)abstractColumn;
                        if(sortableCols == null || sortableCols.containsKey(column.getId())){
                             //try to make this column sortable
                             Comparator comparator = null;
                             if (comparators != null){
                                  comparator = (Comparator)comparators.get(column.getId());
                             NodeElementByAttributeComparator elementComparator = null;     
                             if (comparator instanceof NodeElementByAttributeComparator) {
                                  // the easy one, attribute and ordering are given
                                  elementComparator = (NodeElementByAttributeComparator)comparator;
                             } else { // attribute must be determined
                                  String bindingOfPrimaryProperty = bindingOfPrimaryProperty(column.getTableCellEditor());
                                  if (bindingOfPrimaryProperty == null || !bindingOfPrimaryProperty.startsWith(dataSourcePrefix)){
                                       //no attribute found or outside of data source
                                       column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                                       continue;
                                  String attributeName = bindingOfPrimaryProperty.substring(dataSourcePrefix.length());
                                  Collection subnodes = new ArrayList();
                                  if (attributeName.indexOf('.') >= 0){
                                       //attribute not immediately below data source
                                       String[] tokens = tokenize (attributeName, ".");
                                       for(int i=0; i<tokens.length-1; i++){
                                            subnodes.add(tokens<i>);
                                       attributeName = tokens[tokens.length-1];
                                  if(subnodes.size() == 0){
                                       elementComparator = new NodeElementByAttributeComparator(attributeName, comparator);
                                  }else{
                                       elementComparator = new NodeElementByAttributeComparator(attributeName, comparator, subnodes);
                             // set up internal data structures
                             comparatorForColumn.put(column, elementComparator);
                             //set sort state
                             column.setSortState(WDTableColumnSortDirection.NONE);
                        }else{
                             //column should not be sortable
                             column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                   }else if (abstractColumn instanceof IWDTableColumnGroup){
                        //it's just a column group -> try to bind the columns of the column group
                        IWDTableColumnGroup columnGroup = (IWDTableColumnGroup)abstractColumn;
                        setComparatorsForColumns(dataSourcePrefix, columnGroup.iterateColumns(), comparators);
          * Tokenizes the input string according to the given delimiters. The delimiters will be left out.
          * Example: tokenize("Hello_World", "_") results ["Hello", "World"]
         private String[] tokenize (String input, String delim){
              StringTokenizer tokenizer = new StringTokenizer(input, delim);
              String[] tokens = new String[tokenizer.countTokens()];
              int index = 0;
              while(tokenizer.hasMoreTokens()){
                   tokens[index] = tokenizer.nextToken();
                   index++;
              return tokens;
          * This method must be called from the event handler of this table sorter's
          * sort action. It performs the actual sort operation.
         public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
              // find the things we need
              String columnId = wdEvent.getString("selectedColumn");
              String direction = wdEvent.getString("sortDirection");
              IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
              NodeElementByAttributeComparator elementComparator = (NodeElementByAttributeComparator) comparatorForColumn.get(column);
              if (elementComparator == null){
                   //not a sortable column
                   column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                   return;
              // sorting
              elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
              dataSource.sortElements(elementComparator);
          * Returns the binding of the given table cell editor's property that is
          * considered "primary" or <code>null</code> if no such binding exists or no
          * such property can be determined.
         private static final String bindingOfPrimaryProperty(IWDTableCellEditor editor) {
              return editor instanceof IWDViewElement ? bindingOfPrimaryProperty((IWDViewElement) editor) : null;
          * Returns the binding of the given view element's property that is
          * considered "primary" or <code>null</code> if no such binding exists or no
          * such property can be determined.
         private static final String bindingOfPrimaryProperty(IWDViewElement element) {
              if (element instanceof IWDAbstractDropDownByIndex)
                   return ((IWDAbstractDropDownByIndex) element).bindingOfTexts();
              if (element instanceof IWDAbstractDropDownByKey)
                   return ((IWDAbstractDropDownByKey) element).bindingOfSelectedKey();
              if (element instanceof IWDAbstractInputField)
                   return ((IWDAbstractInputField) element).bindingOfValue();
              if (element instanceof IWDCaption)
                   return ((IWDCaption) element).bindingOfText();
              if (element instanceof IWDCheckBox)
                   return ((IWDCheckBox) element).bindingOfChecked();
              if (element instanceof IWDLink)
                   return ((IWDLink) element).bindingOfText();
              if (element instanceof IWDProgressIndicator)
                   return ((IWDProgressIndicator) element).bindingOfPercentValue();
              if (element instanceof IWDRadioButton)
                   return ((IWDRadioButton) element).bindingOfSelectedKey();
              if (element instanceof IWDTextEdit)
                   return ((IWDTextEdit) element).bindingOfValue();
              if (element instanceof IWDTextView)
                   return ((IWDTextView) element).bindingOfText();
              return null;
          * Instance of a comparator according to the ordering imposed by the
          * implementation of <code>Comparable</code>.
         private static final Comparator DEFAULT = new Comparator() {
               * Compares the given objects according to the ordering imposed by the first
               * ones <code>compareTo(Object)</code> function. Furthermore, <code>null</code>
               * is treated to be less than any object.
               * @see java.lang.Comparable#compareTo(java.lang.Object)
               * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
              public int compare(Object o1, Object o2) {
                   if (o1 == null && o2 == null)
                        return 0;
                   if (o1 == null)
                        return -1;
                   if (o2 == null)
                        return +1;
                   if (o1 instanceof Boolean && o2 instanceof Boolean)
                        return o1.toString().compareTo(o2.toString()); // false < true
                   if (o1 instanceof String && o2 instanceof String){
                        //Use a Collator for sorting according to the given Locale
                        Collator collate = Collator.getInstance(WDResourceHandler.getCurrentSessionLocale());
                        return collate.compare(o1, o2);                    
                   return ((Comparable) o1).compareTo((Comparable) o2);
          * Map of table column to comparator (<code>ReversableComparator</code>)
          * used for sorting that column (sortable columns only).
         private Map comparatorForColumn = new HashMap();
          * The table to be sorted.
         private IWDTable table = null;
          * Column-IDs of the columns, which should be sortable
         private Map sortableCols = null;
          * Generic comparator that compares node elements by a given attribute with
          * the help of a given comparator.
         public final class NodeElementByAttributeComparator implements Comparator {
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute according to the natural ordering of that attribute's
               * type (which must implement <code>java.lang.Comparable</code>).
              public NodeElementByAttributeComparator(String attributeName) {
                   this(attributeName, null, false, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute with the help of the given comparator. If no comparator
               * is given, the natural ordering of that attribute's type is used.
              public NodeElementByAttributeComparator(String attributeName, Comparator comparator) {
                   this(attributeName, comparator, false, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute either as objects (i.e. "in internal format") or as text
               * (i.e. "in external format") as indicated. The ordering is the natural
               * ordering of that attribute's type (which must implement
               * <code>java.lang.Comparable</code>) in case objects are compared or the
               * natural ordering of <code>java.lang.String</code> in case texts are compared.
              public NodeElementByAttributeComparator(String attributeName, boolean compareAsText) {
                   this(attributeName, null, compareAsText, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute according to the natural ordering of that attribute's
               * type (which must implement <code>java.lang.Comparable</code>). In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, Collection subnodes) {
                   this(attributeName, null, false, subnodes);
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute with the help of the given comparator. If no comparator
               * is given, the natural ordering of that attribute's type is used. In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, Comparator comparator, Collection subnodes) {
                   this(attributeName, comparator, false, subnodes);
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute either as objects (i.e. "in internal format") or as text
               * (i.e. "in external format") as indicated. The ordering is the natural
               * ordering of that attribute's type (which must implement
               * <code>java.lang.Comparable</code>) in case objects are compared or the
               * natural ordering of <code>java.lang.String</code> in case texts are compared. In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, boolean compareAsText, Collection subnodes) {
                   this(attributeName, null, compareAsText, subnodes);
               * Internal constructor.
              private NodeElementByAttributeComparator(
                   String attributeName,
                   Comparator comparator,
                   boolean compareAsText,
                   Collection subNodes) {
                   if (attributeName == null)
                        throw new IllegalArgumentException("Attribute name must not be null");
                   if (comparator == null)
                        comparator = DEFAULT;
                   this.attributeName = attributeName;
                   this.comparator = comparator;
                   this.compareAsText = compareAsText;
                   this.sortDirection = true;
                   this.subNodes = subNodes;
               * Sets the sort direction of this comparator to the given direction. The comparator sort in ascending order by default.
               * @see com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDTableColumnSortDirection
              public void setSortDirection(WDTableColumnSortDirection direction){
                   if(direction.equals(WDTableColumnSortDirection.UP)){
                        sortDirection = true;
                   }else if(direction.equals(WDTableColumnSortDirection.DOWN)){
                        sortDirection = false;
               * Compares the given objects which must be instances of <code>IWDNodeElement</code>
               * according to the values of the attribute given at construction time
               * with the help of the comparator given at construction time.
               * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
               * @see com.sap.tc.webdynpro.progmodel.api.IWDNodeElement
              public int compare(Object o1, Object o2) {
                   IWDNodeElement element1 = (IWDNodeElement) o1;
                   IWDNodeElement element2 = (IWDNodeElement) o2;
                   if(subNodes.size() > 0){
                        element1 = getSubNodeElement(element1, 0);
                        element2 = getSubNodeElement(element2, 0);
                   Object attributeValue1 = null;
                   Object attributeValue2 = null;
                   if(element1 != null){
                        attributeValue1 =
                             compareAsText
                                  ? element1.getAttributeAsText(attributeName)
                                  : element1.getAttributeValue(attributeName);
                   if(element2 != null){
                        attributeValue2 =
                             compareAsText
                                  ? element2.getAttributeAsText(attributeName)
                                  : element2.getAttributeValue(attributeName);
                   if(sortDirection){
                        return comparator.compare(attributeValue1, attributeValue2);
                   }else{
                        return comparator.compare(attributeValue2, attributeValue1);
               * Determines recursivly the child node, which have an attribute with the given name.
               * The path to this child node must be specified in the subnodes property of this comparator.
               * Start this method with index = 0.
              private IWDNodeElement getSubNodeElement(IWDNodeElement currentElement, int index){
                   if(currentElement == null || index >= subNodes.size()){
                        //end of recursion
                        return currentElement;
                   }else{
                        return getSubNodeElement(currentElement.node().getChildNode((String)subNodes.toArray()[index], currentElement.index()).getCurrentElement(), index+1);
                        //return getSubNodeElement(currentElement.node().getChildNode((String)subNodes.toArray()[index], currentElement.index()).getElementAt(0), index+1);
               * Name of the attribute used for comparisons.
              private final String attributeName;
               * Comparator used for comparing the attribute's values.
              private final Comparator comparator;
               * Indicates whether attribute values are compared as text (as opposed to
               * "as objects").
              private final boolean compareAsText;
               * Sort direction (true = ascending order, false = descending order)
              private boolean sortDirection;
               * List of child node names
               * (Description of the path from the given context node to the specified attribute)
              private Collection subNodes;

  • EIT SSHR Table sorting

    Hi all,
    I have successfully personalized the EIT SSHR screen to display one of the configured EIT on a custom responsibility using a custom function(so that I can do personalization on function level without affecting other EIT screens).
    Now my challenge is that, when I click on the menu function, it takes me to the people search page, I do a search and select a employee, then it shows me the list of existing EIT records with an option of add, update and delete. Here, I need to show the existing records in a sorted order. I need the latest entry entered to appear in the top. If this is not possible, it would be great if I can have the table sorted as per one of the segment value.
    Is there a way to do this. Can someone help me in doing this and let me know the steps to do the same.
    Cheers
    Arun

    I think Tomahawk is the way to go here.
    Tomahawk allows sorting of data in the data table.
    For action based on row selection, you need to invoke java script function
    using rowOnClick attribute of t:dataTable and then make a hidden command button "click" from
    the java script.
    Regards,
    Joshua

  • CS4 - Still no table sorting

    OK -- We're up to version 6 now with InDesign and Adobe still hasn't incorporated a built-in table row sorting feature? Is it me, or does anyone else think this is absolutely absurd.
    It seems table sorting would be a big issue not just for the technical publishing crowd...but maybe I'm wrong.
    Unless I'm mistaken, from what I can gather there are 3 methods that people are currently using to sort their table row data:
    1) FREE - Manually sort the data in a Word table or Excel, then paste back into ID (which of course loses most formatting and applied styles)
    2) FREE - Use a Script like:
    http://www.kahrel.plus.com/indesign/tablesort.html
    3) EXPENSIVE - Purchase a plugin like:
    http://www.woodwing.com/en/Smart_Styles
    Anybody have any other solutions? We would love to see an inexpensive plugin that does what Smart Styles offers (without all of the other non-sorting features)...or do we have to wait another year for CS5 to find out if this feature finally makes it in.

    The several-year gap in postings on this thread, may indicate that there's not a lot of interest in having the feature built into InDesign. However, if you really need it now, look into the commercial Active Tables plug-in from dtptools.com. There's a free trial. Besides sorting, it can perform many spreadsheet functions within ID tables.
    [/EDIT] I forgot to mention that you can add your formal support for building the feature into ID here: Wishform.[/EDIT]
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    moyler0316 wrote:
    This would be an EXTREMELY helpful feature. I have to sort at least one table in nearly every technical publication I create. These are 2-3 pages + long, so I'd much rather click a button than do it by hand or try 1/2 a dozen different work arounds. 
    Message was edited by: peter at knowhowpro

  • [JHS 10.1.2.2 build 32] Editting table results in NoSuchElementException

    Hi All,
    hopefully somebody has already encountered and solved this problem.
    We are using jHeadstart 10.1.2.2 build 32 and have generated our application in JSPs. But i'm running into a quite structural problem when using the editable table.
    I execute the following steps:
    - On a few pages we have editable tables that display one empty (new) row at the bottom.
    - The tables (views) have a few mandatory columns (attributes).
    - I do not fill all the required field in the empty row
    - I press the commit button
    The page shows the relevant message (the field is mandatory) in the screen but also dumps a NoSuchElementException in the last line.
    The last line shown is the 'new' row.
    java.util.NoSuchElementException
         at java.util.AbstractList$Itr.next(Unknown Source)
         at org.apache.taglibs.standard.tag.common.core.ForEachSupport$SimpleForEachIterator.next(ForEachSupport.java:143)
         at org.apache.taglibs.standard.tag.common.core.ForEachSupport.next(ForEachSupport.java:165)
         at javax.servlet.jsp.jstl.core.LoopTagSupport.doAfterBody(LoopTagSupport.java:301)
         at _web_2d_inf._page._referentie._TalenTable._jspService(_TalenTable.java:367)
         [SRC:/WEB-INF/page/referentie/TalenTable.jsp:161]
         at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:782)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:226)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at oracle.jheadstart.controller.strutsadf.JhsRequestProcessor.process(JhsRequestProcessor.java:385)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:130)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.jheadstart.controller.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:176)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:617)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:794)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.2.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Unknown Source)I've tracked the problem down to the RangeSetWrapper class that returns a size of 6 but fills the errorBeans property with only 5 objects. When getting the 6th row (index 5) the errorBeans array throws an IndexOutOfRangeException which in turn results in the NoSuchElement exception.
    Does anybody recognize this problem? Does anybody have a solution? I'm trying to hack into the RangeSetWrapper class, but am not very succesfull at the moment (Well the Exception is gone, but rows get mixed up ;-))
    Regards,
    Robert Willems of Brilman
    Ps. An extract from the JSP page:
    <c:set var="RbsTalenViewNewRows" value="1" scope="request"/>
    <c:forEach var="RbsTalenView" varStatus="status" items="${jhsTableBindings.RbsTalenView.rangeSet}">
       <html:hidden name="RbsTalenView" property="rowKeyStr" indexed="true"/>
       <c:set var="editMode" scope="request" value="${status.index lt bindings.TalenIterator.estimatedRowCount and bindings.TalenIterator.currentRowIndexInRange!=-1}"/>
            <tr class="altRow<c:out value="${status.index % 2 + 1 }"/>">
          <c:set var="rowKeyStr" scope="request" value="${RbsTalenView.rowKeyStr}"/>
       <td nowrap="nowrap">
          <font class="required">*</font>
          <c:if test='${RbsTalenView.TalenUnicode == null}' >
            <html:text name="RbsTalenView" property="TalenUnicode" size="10" maxlength="3" indexed="true"/>
          </c:if>
          <c:if test='${RbsTalenView.TalenUnicode != null}' >
            <html:text name="RbsTalenView" property="TalenUnicode" size="10" maxlength="3" indexed="true" disabled="true"/>
          </c:if>
       </td>
       <td nowrap="nowrap">
          <html:text name="RbsTalenView" property="TalenNaam" size="30" maxlength="64" indexed="true"/>
       </td>
       <td class="fixed">
              <jsp:include page="/common/customDeleteButton.jsp" flush="true">
                <jsp:param name="deleteEvent" value="setCurrentRowWithKey~RbsTalenView"/>
              </jsp:include>
       </td>
            </tr>
          </c:forEach>   The exception is raised during the </c:forEach> (afterBody)

    Problem solved....
    It seems we had overridden some framework method in a subclass of JhsDataAction called clearFormBeanValues(). If you don't call this method you will get the exception stack i encountered. (The comments said the forms were always cleared and it shouldn't do that when errors were encountered.... too bad, not a name ;-))
    Hopefully nothing else will break now i ripped out that code ;-)
    Regards,
    Robert

  • Large editable tables

    I have a datatable with input fields assigned to each column. The user can edit values freely and then submit the changes for update. Because of the size of the list it appears that a huge amount of processing is required even though only a couple of rows are actually modified by the user.
    Is there a "best practices" for handling large editable tables that anyone is aware of?
    Thanks

    Presuming Oracle backend database.....(you didnt say)
    Partitioning would seem a quick (and expensive $$$$) win, if you partition on date, be sure to use the same date key to perform 'partition pruning' , which is to say give the optimizer a chance to throw away all unrequired partitions before it starts going to disk. When you say 'didnt improve performance much' you need to give a partition wise join for the partitioning to become effective at query time - did you do this ? for example a dashboard prompt with a filter on week / month would help (assuming your week / month time dim column is joined on partition key)
    Is your data model a star schema ? Do you have dimension metadata in your database ? I'd be looking at Materialized views and looking for some sort of aggregate rollup query re-write whereby you queries are re-written at run time to the Mview and does not hit your fact table.
    As for caching, OBIEE caching is the last resort after you exhaust every other alternative, its not there to speed up queries and you would be hiding the problem, what when a user drills down or needs to run an ad-hoc report that is not cached ?
    I would start with understanding Oracle execution plans, review your data model (with the view on speedy data extraction) and look at what Oracle DB gives for data warehousing appliances :
    parallelism is your friend!
    star transformation,
    Mviews (table or Cube based)
    OLAP

  • EA 19 Table Sorting

    I've downloaded adf faces ea19. In its documentation is descripted
    this feature:
    <<Aspect API
    A new Aspect API (this name will likely be changed in upcoming
    releases) lets component changes
    persist across requests. For example, the sort order of a table or
    expansion of a tree can
    automatically be restored for you when you return to a page. This API
    is currently not active by
    default, but has been turned on in the demo bundle with the
    oracle.adf.view.faces.ASPECT_PERSISTENCE
    context parameter. See the Javadoc and the enclosed demos for more
    information.>>
    I'm very interested to preserve the sort order in my pages with
    tables, so I've add the follow lines in web.xml:
    <context-param>
    <param-name>oracle.adf.view.faces.CHANGE_PERSISTENCE</param-name>
    <param-value>session</param-value>
    </context-param>
    But I think ASPECT_PERSISTENCE doesn't work.
    The table sort order is not preserved, no change respect the
    precedent adf version.
    Anyone with some ideas about this problem?
    Thank you

    I think Tomahawk is the way to go here.
    Tomahawk allows sorting of data in the data table.
    For action based on row selection, you need to invoke java script function
    using rowOnClick attribute of t:dataTable and then make a hidden command button "click" from
    the java script.
    Regards,
    Joshua

  • How to create editable table with one empty row ?

    I'm looking for solution how to create editable table with one empty row using ADF BC. I have seen this solution in application that was created in JHeadstart and it's very well idea to use it insead of creation form.

    hammm, i do it this:
    drop the VO on the page, select Table->ADF Table....
    so, drop the botton create, from de VO->operations->create (the firts), and right botton (mouse) Edit binding....
    in Data collection select the VO, in Select an action select CreateInsert
    luck

  • Editable table with multiple rows

    Hi All!
    We're trying to develop some application in VC 7.0. That application should read data from some R/3 tables (via standard and custom functional modules), then display data to user and allow him/her to modify it (or add some data into table rows), and then save it back to R/3.
    What is the best way to do that?
    There's no problem with displaying data.
    But when I try to add something to table (on portal interface), I'm able to use only first row of the table... Even if I fill all fields of that row, I'm not able to add data to second row, etc.
    Second question. Is it possible to display in one table contents of output of several BAPIs? For example we have three bapis, one displaying user, second displays that user's subordinates, and the third one - that user's manager. And we want one resulting table...
    And last. What is the best way to submit data from table view in VC (portal) to R/3 table? I understand that we should write some functional module, that puts data to R/3. I'm asking about what should be done in VC itself. Some button, or action...
    Any help will be appreciated and rewarded :o)
    Regards,
    DK

    Here are some former postings:
    Editable table with multiple rows
    and
    Editable table with multiple rows
    Are you on the right SP-level?
    Can you also split up your posting: one question, one posting? This way you get faster answers, as people might just browse the headers.

  • Table sorter

    Hi,
         i have to implement a table sorter in one of my webdypro application. I have done all the steps mentioned in one of the blog and have also imported TableSorter.java class. i am getting sorting icons in column headers. but on clicking icon nothing happens...i think there is some problem with the java class which i have imported. So can anybody provide the code of tablesorter.java class.
    Thanks in advance,
        Reena

    Hi Reena,
    Here is the code.Just change the package name.
    * Created on Sep 6, 2007
    * To change the template for this generated file go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package ibm.com.tradefund.utils;
    * @author Administrator
    * To change the template for this generated type comment go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    import java.text.Collator;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Comparator;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Map;
    import java.util.StringTokenizer;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByIndex;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByKey;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractInputField;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractTableColumn;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDCaption;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDCheckBox;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDLink;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDProgressIndicator;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDRadioButton;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableCellEditor;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableColumn;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableColumnGroup;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextEdit;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextView;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDTableColumnSortDirection;
    import com.sap.tc.webdynpro.progmodel.api.IWDAction;
    import com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent;
    import com.sap.tc.webdynpro.progmodel.api.IWDNode;
    import com.sap.tc.webdynpro.progmodel.api.IWDNodeElement;
    import com.sap.tc.webdynpro.progmodel.api.IWDViewElement;
    import com.sap.tc.webdynpro.services.sal.localization.api.WDResourceHandler;
    * Helper class that makes a Web Dynpro table UI element sortable (column-wise).
    public final class TableSorter {
          * @param table
          * @param sortAction
          * @param comparators
          * Creates a table sorter for the given table using the given sort action.
          * This constructor must be called from <code>wdDoModifyView()</code>, but
          * usually only when that hook is called for the first time. Store the newly
          * created instance in a context attribute with Java native type
          * <code>com.sap.tc.webdynpro.tests.utils.TableSorter</code>.
          * The given sort action's event handler will be bound to the <code>onSort</code>
          * event of the table and must at least call this table sorter's
          * <code>sort(wdEvent)</code> method.
          * Every column of the table is made sortable if possible according to the
          * following rules.
          * If a comparator is given for a column's ID and it is a
          * <code>NodeElementByAttributeComparator</code>, then that comparator defines
          * both the attribute and the ordering used to sort that column.
          * If any other comparator is given and an attribute can be determined from
          * that column's table cell editor, then that attribute is used to sort that
          * column according to the ordering imposed by the given comparator.
          * If no comparator is given but an attribute can be determined from
          * that column's table cell editor, then that attribute is used to sort that
          * column according to the natural ordering of that attribute's type.
          * Else that column is left untouched.
          * Additionally it is possible to define the sortable columns by their
          * TableColumn UI element ids.
          * @see sort()
          * @see NodeElementByAttributeComparator
          * @see com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTable
         public TableSorter(IWDTable table, IWDAction sortAction, Map comparators) {
              init(table, sortAction, comparators, null);
         public TableSorter(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns) {
              init(table, sortAction, comparators, sortableColumns);
          * Initialisation stuff
         private void init(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns){
              this.table = table;
              if(sortableColumns == null){
                   sortableCols = null;
              }else{
                   sortableCols = new HashMap();
                   for (int i = 0; i < sortableColumns.length; i++) {
                        sortableCols.put(sortableColumns<i>, sortableColumns<i>);
              // sanity checks
              if (sortAction == null)
                   throw new IllegalArgumentException("Sort action must be given");
              if (table == null)
                   throw new IllegalArgumentException("Table must be given");
              if (table.bindingOfDataSource() == null)
                   throw new IllegalArgumentException(
                        "Data source of table with id '" + table.getId() + "' must be bound");
              // make the columns sortable
              String dataSourcePrefix = table.bindingOfDataSource() + ".";
              //TODO: remove the following line since this method is not longer available in later releases
              setComparatorsForColumns(dataSourcePrefix, table.iterateColumns(), comparators);
              setComparatorsForColumns(dataSourcePrefix, table.iterateGroupedColumns(), comparators);
              //set up the table properties
              table.setOnSort(sortAction);
              table.mappingOfOnSort().addSourceMapping(IWDTable.IWDOnSort.COL, "selectedColumn");
              table.mappingOfOnSort().addSourceMapping(IWDTable.IWDOnSort.DIRECTION, "sortDirection");     
          * Try to make the given columns sortable (recusivly, if necessary)
         private void setComparatorsForColumns(String dataSourcePrefix, Iterator columnIterator, Map comparators){
              int index = 0;
              for (Iterator it = columnIterator; it.hasNext(); ++index) { // for every column: try to make it bindable
                   IWDAbstractTableColumn abstractColumn = (IWDAbstractTableColumn) it.next();
                   if(abstractColumn instanceof IWDTableColumn){
                        IWDTableColumn column = (IWDTableColumn)abstractColumn;
                        if(sortableCols == null || sortableCols.containsKey(column.getId())){
                             //try to make this column sortable
                             Comparator comparator = null;
                             if (comparators != null){
                                  comparator = (Comparator)comparators.get(column.getId());
                             NodeElementByAttributeComparator elementComparator = null;     
                             if (comparator instanceof NodeElementByAttributeComparator) {
                                  // the easy one, attribute and ordering are given
                                  elementComparator = (NodeElementByAttributeComparator)comparator;
                             } else { // attribute must be determined
                                  String bindingOfPrimaryProperty = bindingOfPrimaryProperty(column.getTableCellEditor());
                                  if (bindingOfPrimaryProperty == null || !bindingOfPrimaryProperty.startsWith(dataSourcePrefix)){
                                       //no attribute found or outside of data source
                                       column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                                       continue;
                                  String attributeName = bindingOfPrimaryProperty.substring(dataSourcePrefix.length());
                                  Collection subnodes = new ArrayList();
                                  if (attributeName.indexOf('.') >= 0){
                                       //attribute not immediately below data source
                                       String[] tokens = tokenize (attributeName, ".");
                                       for(int i=0; i<tokens.length-1; i++){
                                            subnodes.add(tokens<i>);
                                       attributeName = tokens[tokens.length-1];
                                  if(subnodes.size() == 0){
                                       elementComparator = new NodeElementByAttributeComparator(attributeName, comparator);
                                  }else{
                                       elementComparator = new NodeElementByAttributeComparator(attributeName, comparator, subnodes);
                             // set up internal data structures
                             comparatorForColumn.put(column, elementComparator);
                             //set sort state
                             column.setSortState(WDTableColumnSortDirection.NONE);
                        }else{
                             //column should not be sortable
                             column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                   }else if (abstractColumn instanceof IWDTableColumnGroup){
                        //it's just a column group -> try to bind the columns of the column group
                        IWDTableColumnGroup columnGroup = (IWDTableColumnGroup)abstractColumn;
                        setComparatorsForColumns(dataSourcePrefix, columnGroup.iterateColumns(), comparators);
          * Tokenizes the input string according to the given delimiters. The delimiters will be left out.
          * Example: tokenize("Hello_World", "_") results ["Hello", "World"]
         private String[] tokenize (String input, String delim){
              StringTokenizer tokenizer = new StringTokenizer(input, delim);
              String[] tokens = new String[tokenizer.countTokens()];
              int index = 0;
              while(tokenizer.hasMoreTokens()){
                   tokens[index] = tokenizer.nextToken();
                   index++;
              return tokens;
          * This method must be called from the event handler of this table sorter's
          * sort action. It performs the actual sort operation.
         public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
              // find the things we need
              String columnId = wdEvent.getString("selectedColumn");
              String direction = wdEvent.getString("sortDirection");
              IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
              NodeElementByAttributeComparator elementComparator = (NodeElementByAttributeComparator) comparatorForColumn.get(column);
              if (elementComparator == null){
                   //not a sortable column
                   column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                   return;
              // sorting
              elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
              dataSource.sortElements(elementComparator);
          * Returns the binding of the given table cell editor's property that is
          * considered "primary" or <code>null</code> if no such binding exists or no
          * such property can be determined.
         private static final String bindingOfPrimaryProperty(IWDTableCellEditor editor) {
              return editor instanceof IWDViewElement ? bindingOfPrimaryProperty((IWDViewElement) editor) : null;
          * Returns the binding of the given view element's property that is
          * considered "primary" or <code>null</code> if no such binding exists or no
          * such property can be determined.
         private static final String bindingOfPrimaryProperty(IWDViewElement element) {
              if (element instanceof IWDAbstractDropDownByIndex)
                   return ((IWDAbstractDropDownByIndex) element).bindingOfTexts();
              if (element instanceof IWDAbstractDropDownByKey)
                   return ((IWDAbstractDropDownByKey) element).bindingOfSelectedKey();
              if (element instanceof IWDAbstractInputField)
                   return ((IWDAbstractInputField) element).bindingOfValue();
              if (element instanceof IWDCaption)
                   return ((IWDCaption) element).bindingOfText();
              if (element instanceof IWDCheckBox)
                   return ((IWDCheckBox) element).bindingOfChecked();
              if (element instanceof IWDLink)
                   return ((IWDLink) element).bindingOfText();
              if (element instanceof IWDProgressIndicator)
                   return ((IWDProgressIndicator) element).bindingOfPercentValue();
              if (element instanceof IWDRadioButton)
                   return ((IWDRadioButton) element).bindingOfSelectedKey();
              if (element instanceof IWDTextEdit)
                   return ((IWDTextEdit) element).bindingOfValue();
              if (element instanceof IWDTextView)
                   return ((IWDTextView) element).bindingOfText();
              return null;
          * Instance of a comparator according to the ordering imposed by the
          * implementation of <code>Comparable</code>.
         private static final Comparator DEFAULT = new Comparator() {
               * Compares the given objects according to the ordering imposed by the first
               * ones <code>compareTo(Object)</code> function. Furthermore, <code>null</code>
               * is treated to be less than any object.
               * @see java.lang.Comparable#compareTo(java.lang.Object)
               * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
              public int compare(Object o1, Object o2) {
                   if (o1 == null && o2 == null)
                        return 0;
                   if (o1 == null)
                        return -1;
                   if (o2 == null)
                        return +1;
                   if (o1 instanceof Boolean && o2 instanceof Boolean)
                        return o1.toString().compareTo(o2.toString()); // false < true
                   if (o1 instanceof String && o2 instanceof String){
                        //Use a Collator for sorting according to the given Locale
                        Collator collate = Collator.getInstance(WDResourceHandler.getCurrentSessionLocale());
                        return collate.compare(o1, o2);                    
                   return ((Comparable) o1).compareTo((Comparable) o2);
          * Map of table column to comparator (<code>ReversableComparator</code>)
          * used for sorting that column (sortable columns only).
         private Map comparatorForColumn = new HashMap();
          * The table to be sorted.
         private IWDTable table = null;
          * Column-IDs of the columns, which should be sortable
         private Map sortableCols = null;
          * Generic comparator that compares node elements by a given attribute with
          * the help of a given comparator.
         public final class NodeElementByAttributeComparator implements Comparator {
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute according to the natural ordering of that attribute's
               * type (which must implement <code>java.lang.Comparable</code>).
              public NodeElementByAttributeComparator(String attributeName) {
                   this(attributeName, null, false, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute with the help of the given comparator. If no comparator
               * is given, the natural ordering of that attribute's type is used.
              public NodeElementByAttributeComparator(String attributeName, Comparator comparator) {
                   this(attributeName, comparator, false, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute either as objects (i.e. "in internal format") or as text
               * (i.e. "in external format") as indicated. The ordering is the natural
               * ordering of that attribute's type (which must implement
               * <code>java.lang.Comparable</code>) in case objects are compared or the
               * natural ordering of <code>java.lang.String</code> in case texts are compared.
              public NodeElementByAttributeComparator(String attributeName, boolean compareAsText) {
                   this(attributeName, null, compareAsText, new ArrayList());
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute according to the natural ordering of that attribute's
               * type (which must implement <code>java.lang.Comparable</code>). In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, Collection subnodes) {
                   this(attributeName, null, false, subnodes);
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute with the help of the given comparator. If no comparator
               * is given, the natural ordering of that attribute's type is used. In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, Comparator comparator, Collection subnodes) {
                   this(attributeName, comparator, false, subnodes);
               * Creates a new comparator for the given attribute name that compares values
               * of that attribute either as objects (i.e. "in internal format") or as text
               * (i.e. "in external format") as indicated. The ordering is the natural
               * ordering of that attribute's type (which must implement
               * <code>java.lang.Comparable</code>) in case objects are compared or the
               * natural ordering of <code>java.lang.String</code> in case texts are compared. In addition it is possible
               * to define the path to a child node with the <code>java.util.Collection</code> subnodes.
               * (List of child node names in the correct order)
              public NodeElementByAttributeComparator(String attributeName, boolean compareAsText, Collection subnodes) {
                   this(attributeName, null, compareAsText, subnodes);
               * Internal constructor.
              private NodeElementByAttributeComparator(
                   String attributeName,
                   Comparator comparator,
                   boolean compareAsText,
                   Collection subNodes) {
                   if (attributeName == null)
                        throw new IllegalArgumentException("Attribute name must not be null");
                   if (comparator == null)
                        comparator = DEFAULT;
                   this.attributeName = attributeName;
                   this.comparator = comparator;
                   this.compareAsText = compareAsText;
                   this.sortDirection = true;
                   this.subNodes = subNodes;
               * Sets the sort direction of this comparator to the given direction. The comparator sort in ascending order by default.
               * @see com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDTableColumnSortDirection
              public void setSortDirection(WDTableColumnSortDirection direction){
                   if(direction.equals(WDTableColumnSortDirection.UP)){
                        sortDirection = true;
                   }else if(direction.equals(WDTableColumnSortDirection.DOWN)){
                        sortDirection = false;
               * Compares the given objects which must be instances of <code>IWDNodeElement</code>
               * according to the values of the attribute given at construction time
               * with the help of the comparator given at construction time.
               * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
               * @see com.sap.tc.webdynpro.progmodel.api.IWDNodeElement
              public int compare(Object o1, Object o2) {
                   IWDNodeElement element1 = (IWDNodeElement) o1;
                   IWDNodeElement element2 = (IWDNodeElement) o2;
                   if(subNodes.size() > 0){
                        element1 = getSubNodeElement(element1, 0);
                        element2 = getSubNodeElement(element2, 0);
                   Object attributeValue1 = null;
                   Object attributeValue2 = null;
                   if(element1 != null){
                        attributeValue1 =
                             compareAsText
                                  ? element1.getAttributeAsText(attributeName)
                                  : element1.getAttributeValue(attributeName);
                   if(element2 != null){
                        attributeValue2 =
                             compareAsText
                                  ? element2.getAttributeAsText(attributeName)
                                  : element2.getAttributeValue(attributeName);
                   if(sortDirection){
                        return comparator.compare(attributeValue1, attributeValue2);
                   }else{
                        return comparator.compare(attributeValue2, attributeValue1);
               * Determines recursivly the child node, which have an attribute with the given name.
               * The path to this child node must be specified in the subnodes property of this comparator.
               * Start this method with index = 0.
              private IWDNodeElement getSubNodeElement(IWDNodeElement currentElement, int index){
                   if(currentElement == null || index >= subNodes.size()){
                        //end of recursion
                        return currentElement;
                   }else{
                        return getSubNodeElement(currentElement.node().getChildNode((String)subNodes.toArray()[index], currentElement.index()).getCurrentElement(), index+1);
                        //return getSubNodeElement(currentElement.node().getChildNode((String)subNodes.toArray()[index], currentElement.index()).getElementAt(0), index+1);
               * Name of the attribute used for comparisons.
              private final String attributeName;
               * Comparator used for comparing the attribute's values.
              private final Comparator comparator;
               * Indicates whether attribute values are compared as text (as opposed to
               * "as objects").
              private final boolean compareAsText;
               * Sort direction (true = ascending order, false = descending order)
              private boolean sortDirection;
               * List of child node names
               * (Description of the path from the given context node to the specified attribute)
              private Collection subNodes;
    Re: Webdynpro Table: Column Header sort icon not visible
    Regards,
    Mithu

  • 30EA3 - Edit Table/Create Table(Advanced) - Table Name, Text Box Size

    I am not sure if its the same on non-Linux versions, but in the edit table dialog, the table name text box size is tiny. Its only wide enough that you can see approx 7 chars.
    Is it possible to increase this? The size of the text box in the simple create table dialog seems like a good size. As far as I can tell, it is not tiny to conserve space for other items.
    Anyway, it's just a minor issue that wont prevent me from doing work - just think it'd be better a bit bigger. I am sure it didn't used to be this small.
    Ta,
    Trent

    oh interesting.
    are you using openJDK?
    $ /usr/lib/jvm/java-6-sun-1.6.0.22/bin/java -version
    java version "1.6.0_22"
    Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
    Ta,
    Trent

  • Not able to figure out the table index for Edit table User Properties Dialo

    Studio Edition Version 11.1.1.0.0
    Build JDEVADF_MAIN.D5PRIME_GENERIC_080403.0915.4920
    I'm trying to automate the various features in Jdeveloper dialogs. At one point I got struck with table in Edit Table Dialog.
    Right Click on New -> Database Tier-> Select APPS: Import to offline database Objects. Step 1- Step5 dialogs comes up. Click on Next till finish button comes up. After that one table along with xdf file will be shown in the Jdeveloper Tree Menu. Right click on Table, Go to Properties. Then Select User Properties in the Left Pane. On Right Side table will be shown. I want to know what is the index for this table and also I need to input certain text and select some drop downs from this table.
    Automation Tool: JFCUnit
    Could you please tell how can I put values in some of the fields and select the values from the drop downs.
    Kindly let me know if you need any more Information for the same.

    Hi,
    if you are from Oracle, please use an internal forum. If not, the JDeveloper 11 forum is at: JDeveloper and OC4J 11g Technology Preview
    Frank

  • How can I edit an Automator action for Word?

    I'm running Word 2008 on a Macbook Pro, Mac OS 10.5.
    Word comes with a selection of Automator actions, including one to find and replace text in Word. I often want to convert standard numerals to old-style numerals, which are part of the extended glyphs set in fonts I use. Automator will allow me to set up ten find/replace actions (for the numbers 0-9) that successfully replace all the numerals with old-style numerals. But it only does it for the main body of the document, not for the footnotes. I need to be able to do it for all the footnotes.
    I thought I might find a workaround by adding an AppleScript to my workflow, which would shift the focus in Word to the footnotes and rerun the find/replace actions. I mapped the menu item View/Footnotes to the keystroke command-) and inserted this AppleScript into the Automator workflow:
    tell application "Microsoft Word"
    tell application "Microsoft Word" to activate
    tell application "System Events"
    tell process "Microsoft Word"
    keystroke ")" using command down
    end tell
    end tell
    end tell
    But the find/replace actions simply repeat what they'd done before, converting the numerals in the main body but not in the footnotes. I then thought that perhaps I should have an AppleScript to do the find/replace itself, once the footnotes have been selected, so I created the following (command-H accesses the find/replace dialog box in Word 2008):
    tell application "Microsoft Word"
    tell application "Microsoft Word" to activate
    tell application "System Events"
    tell process "Microsoft Word"
    keystroke "H" using command down
    keystroke "1"
    keystroke tab
    keystroke ""
    end tell
    end tell
    end tell
    The character after the fourth keystroke command is the glyph for old-style numeral 1. For some reason Word reinterprets this as the letter a. So using AppleScript I can only replace the numerals 1-9 with the letters a-i.
    I'm pretty hopeless at even this very basic level of programming, but I presume that there's something in the Automator action 'Find and replace in Word' that specifically tells it not to look anywhere but the footnotes. I also presume it's possible to insert a command to tell it to operate on the footnotes (and headers and footers: everywhere!) too.
    Does anyone know a way to edit an Automator action? I'm willing to experiment and fiddle with one until I find a way that works, if nobody knows the exact changes that I'd need to make, but I just don't know how to edit an Automator action in the first place. A bit of googling suggests that I could do it in XCode, and that that is bundled with my Mac, but I don't have it.
    This all used to work when Office used to allow VBA (and I was using a horrible Windoze machine). Maybe someone would prefer just to find a way of creating a solution our of the old code, so here's one part of what I used (to change the number 1):
    For Each aStory In ActiveDocument.StoryRanges
    With aStory.Find
    .ClearFormatting
    With .Replacement
    .ClearFormatting
    End With
    .Execute FindText:="1", ReplaceWith:=ChrW(63281), _
    Format:=True, MatchCase:=True, Replace:=wdReplaceAll
    End With
    Next aStory
    Thanks in advance for any help.

    Thanks to all three contributors for their generous help so far. Mac people are lovely.
    BDAqua's suggestion wouldn't work, I think, because copying footnote text into another application and then back into Word would lose all the associations between footnote references in the body and the footnotes themselves. I wish I could do what Klaus1 says, but Word 2008 won't allow the creation of Macros any more. They've shut off support for their creation. Nice MS. red_menace's suggestion seems very plausible and I'll look into a way of mapping the old style numerals to specific keystrokes. That might do it.
    Reflecting on what you all said, I looked again through Word's help menus and eventually got pointed towards this page of 'help': <http://tinyurl.com/6398l6>. This is completely impenetrable for me, though it does compare a VBA script for Word 2004 to an AppleScript. This encourages me to hope that it should be possible to translate my original VBA script (part of which I included in my first message) into AppleScript, though I don't know how to do it because I don't really understand the language in the first place (the VBA script was put together by someone else).

Maybe you are looking for