GetTreeCellRendererComponent(): get path to value without using row-arg?

I'm using a JTree to display hierarchical data which include cyclic dependencies (i.e. an item may be its own ancestor).
If a node shows up for the second time in a hierarchical tree path, I put a stop to further expansion (using the getPath() of a TreeExpansionEvent in a TreeWillExpandListener), and I give the node a special display (using a tree-cell renderer with a custom implementation of getTreeCellRendererComponent()). The implementation uses tree.getPathForRow(row) to get the path by which can be detected if a node is cyclic, but this does not always work: sometimes tree.getPathForRow(row).getLastPathComponent() corresponds to the value-object given as argument to getTreeCellRendererComponent(), but sometimes it does not.
The example below shows the difference (switch the lines marked "Not OK" by the line marked "OK"; to keep it simple, I left the cyclic dependencies out).
Checking the swing source files reveals that if getTreeCellRendererComponent() is called by paintRow() in BasicTreeUI, value and row correspond. But if getTreeCellRendererComponent() is called by getNodeDimensions() in one of the LayoutCache-classes, the given value-object does not correspond to the object at the given tree-row. Somewhere I read that getNodeDimensions() is called to determine preferred sizes of nodes before they are shown for the first time. If that's the case, it is logical that value and row do not correspond, although I would have liked to get a hint, e.g. a row value of -1.
To detect a cyclic node, I need a treepath, but the row-argument is unreliable. Is there another way to determine the path corresponding to the value-object passed to getTreeCellRendererComponent(), so without having to use the row-argument?
* treeUpdate.java
package treeupdate;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.event.EventListenerList;
import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
public class treeUpdate extends javax.swing.JFrame {
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTree jTree1;
    private ItemInHierarchy root = null;
    private SimpleTreeModel htm = new SimpleTreeModel();
    private SimpleTreeCellRenderer htcr = new SimpleTreeCellRenderer();
    public treeUpdate() {
        initComponents();
        generateHierarchy();
        jTree1.setModel(htm);
        jTree1.setCellRenderer(htcr);
    // init
    private void initComponents() {
        setTitle("row-value correspondence");
        setSize(new Dimension(300,500));
        jScrollPane1 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jScrollPane1.setViewportView(jTree1);
        add(jScrollPane1);
    // generate data
    private void generateHierarchy() {
        root = new ItemInHierarchy("Joverra");
        ItemInHierarchy c1 = new ItemInHierarchy("Kondat Kalbendate");
        c1.children.add(new ItemInHierarchy("Linovar Welchessante Somtanessia"));
        c1.children.add(new ItemInHierarchy("Muzarra Frontiminoi Wioppallae"));
        c1.children.add(new ItemInHierarchy("Niobitia Fyttichiokla Quantianou"));
        root.children.add(c1);
        ItemInHierarchy c2 = new ItemInHierarchy("Orud Kalbene");
        c2.children.add(new ItemInHierarchy("Pascalite Welchessante Somtanessia"));
        c2.children.add(new ItemInHierarchy("Quinnime Frontiminoi Wioppallae"));
        c2.children.add(new ItemInHierarchy("Ruttinovi Fyttichiokla Quantianou"));
        root.children.add(c2);
        ItemInHierarchy c3 = new ItemInHierarchy("Si Kae");
        c3.children.add(new ItemInHierarchy("Tonniate Welchessante Somtanessia"));
        c3.children.add(new ItemInHierarchy("Uvverten Frontiminoi Wioppallae"));
        c3.children.add(new ItemInHierarchy("Vlioppala Fyttichiokla Quantianou"));
        root.children.add(c3);
     * Tree model
    private class SimpleTreeModel implements TreeModel {
        protected EventListenerList listenerList = new EventListenerList();
        public Object getRoot() {
            return root;
        public Object getChild(Object parent, int index) {
            ItemInHierarchy i = (ItemInHierarchy)parent;
            return i.children.get(index);
        public int getChildCount(Object parent) {
            ItemInHierarchy i = (ItemInHierarchy)parent;
            return i.children.size();
        public boolean isLeaf(Object node) {
            ItemInHierarchy i = (ItemInHierarchy)node;
            return i.children.size()==0;
        public void valueForPathChanged(TreePath path, Object newValue) {
            // do nothing
        public int getIndexOfChild(Object parent, Object child) {
            ItemInHierarchy i = (ItemInHierarchy)parent;
            for (int k = 0; k < i.children.size(); k++) {
                if (i.children.get(k).equals((ItemInHierarchy)child)) {
                    return k;
            return -1;
        public void addTreeModelListener(TreeModelListener l) {
            listenerList.add(TreeModelListener.class, l);
        public void removeTreeModelListener(TreeModelListener l) {
            listenerList.remove(TreeModelListener.class, l);
     * Cell renderer
    private class SimpleTreeCellRenderer extends JLabel implements TreeCellRenderer {
        public SimpleTreeCellRenderer() {
            setOpaque(true);
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            // OK
            // setText(value.toString());
            // Not OK
            TreePath tp = tree.getPathForRow(row);
            if (tp!=null) {
                setText(tp.getLastPathComponent().toString());
            } else {
                setText("?");
            return this;
     * Item in hierarchy
    public class ItemInHierarchy {
        public List<ItemInHierarchy> children = new ArrayList<ItemInHierarchy>();
        public String name;
        public ItemInHierarchy() {
        public ItemInHierarchy(String name) {
            this.name = name;
        @Override
        public String toString() {
            return name;
    // main
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new treeUpdate().setVisible(true);
}

Kleopatra wrote:
The only general way to hack-around, as far as I remember, is to force the VariableSomething out of the way and make a FixedSomething takes it place. No api, but you can reach that by doing both:
- tree.setLargeModel(true)
- tree.setRowHeight(somevalueabovezero)
Your memory's fine. I ran a short test, this seems to make row- and value-arguments correspond to each other consistently.
Kleopatra wrote:
... before expanding a node it calls the renderer with the row set to the the row following the row of the node to expand (same for all children)...I suspected something like this, and it opens up a way to solve my question, but it seemed like a too shallow basis for coding. I'm satisfied with fixed row heights, so I'll stick to your suggestion above, and I'll include a short equality test in getTreeCellRendererComponent(), just to make sure:
value.equals(tree.getPathForRow(row).getLastPathComponent())Thanks for the help - Jan

Similar Messages

  • How can i get all these values in single row with comma separated?

    I have a table "abxx" with column "absg" Number(3)
    which is having following rows
    absg
    1
    3
    56
    232
    43
    436
    23
    677
    545
    367
    xxxxxx No of rows
    How can i get all these values in single row with comma separated?
    Like
    output_absg
    1,3,56,232,43,436,23,677,545,367,..,..,...............
    Can you send the query Plz!

    These all will do the same
    create or replace type string_agg_type as object
    2 (
    3 total varchar2(4000),
    4
    5 static function
    6 ODCIAggregateInitialize(sctx IN OUT string_agg_type )
    7 return number,
    8
    9 member function
    10 ODCIAggregateIterate(self IN OUT string_agg_type ,
    11 value IN varchar2 )
    12 return number,
    13
    14 member function
    15 ODCIAggregateTerminate(self IN string_agg_type,
    16 returnValue OUT varchar2,
    17 flags IN number)
    18 return number,
    19
    20 member function
    21 ODCIAggregateMerge(self IN OUT string_agg_type,
    22 ctx2 IN string_agg_type)
    23 return number
    24 );
    25 /
    create or replace type body string_agg_type
    2 is
    3
    4 static function ODCIAggregateInitialize(sctx IN OUT string_agg_type)
    5 return number
    6 is
    7 begin
    8 sctx := string_agg_type( null );
    9 return ODCIConst.Success;
    10 end;
    11
    12 member function ODCIAggregateIterate(self IN OUT string_agg_type,
    13 value IN varchar2 )
    14 return number
    15 is
    16 begin
    17 self.total := self.total || ',' || value;
    18 return ODCIConst.Success;
    19 end;
    20
    21 member function ODCIAggregateTerminate(self IN string_agg_type,
    22 returnValue OUT varchar2,
    23 flags IN number)
    24 return number
    25 is
    26 begin
    27 returnValue := ltrim(self.total,',');
    28 return ODCIConst.Success;
    29 end;
    30
    31 member function ODCIAggregateMerge(self IN OUT string_agg_type,
    32 ctx2 IN string_agg_type)
    33 return number
    34 is
    35 begin
    36 self.total := self.total || ctx2.total;
    37 return ODCIConst.Success;
    38 end;
    39
    40
    41 end;
    42 /
    Type body created.
    [email protected]>
    [email protected]> CREATE or replace
    2 FUNCTION stragg(input varchar2 )
    3 RETURN varchar2
    4 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
    5 /
    CREATE OR REPLACE FUNCTION get_employees (p_deptno in emp.deptno%TYPE)
    RETURN VARCHAR2
    IS
    l_text VARCHAR2(32767) := NULL;
    BEGIN
    FOR cur_rec IN (SELECT ename FROM emp WHERE deptno = p_deptno) LOOP
    l_text := l_text || ',' || cur_rec.ename;
    END LOOP;
    RETURN LTRIM(l_text, ',');
    END;
    SHOW ERRORS
    The function can then be incorporated into a query as follows.
    COLUMN employees FORMAT A50
    SELECT deptno,
    get_employees(deptno) AS employees
    FROM emp
    GROUP by deptno;
    ###########################################3
    SELECT SUBSTR(STR,2) FROM
    (SELECT SYS_CONNECT_BY_PATH(n,',')
    STR ,LENGTH(SYS_CONNECT_BY_PATH(n,',')) LN
    FROM
    SELECT N,rownum rn from t )
    CONNECT BY rn = PRIOR RN+1
    ORDER BY LN desc )
    WHERE ROWNUM=1
    declare
    str varchar2(32767);
    begin
    for i in (select sal from emp) loop
    str:= str || i.sal ||',' ;
    end loop;
    dbms_output.put_line(str);
    end;
    COLUMN employees FORMAT A50
    SELECT e.deptno,
    get_employees(e.deptno) AS employees
    FROM (SELECT DISTINCT deptno
    FROM emp) e;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE FUNCTION concatenate_list (p_cursor IN SYS_REFCURSOR)
    RETURN VARCHAR2
    IS
    l_return VARCHAR2(32767);
    l_temp VARCHAR2(32767);
    BEGIN
    LOOP
    FETCH p_cursor
    INTO l_temp;
    EXIT WHEN p_cursor%NOTFOUND;
    l_return := l_return || ',' || l_temp;
    END LOOP;
    RETURN LTRIM(l_return, ',');
    END;
    COLUMN employees FORMAT A50
    SELECT e1.deptno,
    concatenate_list(CURSOR(SELECT e2.ename FROM emp e2 WHERE e2.deptno = e1.deptno)) employees
    FROM emp e1
    GROUP BY e1.deptno;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE TYPE t_string_agg AS OBJECT
    g_string VARCHAR2(32767),
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER
    SHOW ERRORS
    CREATE OR REPLACE TYPE BODY t_string_agg IS
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER IS
    BEGIN
    sctx := t_string_agg(NULL);
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := self.g_string || ',' || value;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
    RETURN ODCIConst.Success;
    END;
    END;
    SHOW ERRORS
    CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
    RETURN VARCHAR2
    PARALLEL_ENABLE AGGREGATE USING t_string_agg;
    /

  • How can I use table headers only without using rows.

    how can I use table headers only, without using rows and without leaving the space.
    If anyone could say me how to paste the pic in this questions, I would have shown it.
    The flow of view is in this way
    {Table header(table on top of table)
    column header1___|| column header2__ || column header3__ ||}
    <b>Here is the blank space I am getting, How to avoid this space?this space is of one table row height</b>
    {Contents column1 || Contents column2 || Contents column3 || (This is of other table below the uper table)}
    I am using scroll for the content part of table only.
    So I am using two tables.
    I am using NW04.

    I did the possibles you explained, but couldn't get rid off the space.
    Any other solutions?
    I am keeping the header static and the content columns scrollable.
    I have used two tables one to display header above and the other to display only the contents.
    I have put the contents table in scroll container.
    And the header table in transperent container.
    Thanks and Regards,
    Hanif Kukkalli

  • Display the 3rd hieghest value without using rowid

    HI All,
    Can any one help me how to display the 3rd hieghest valuer without using a ROWID..
    Thanks
    Basava

    Frank, using ROWNUM = 1 instead of DISTINCT could be a bit faster:
    SQL> SET LINESIZE 132
    SQL> EXPLAIN PLAN FOR
      2  WITH got_r_num AS (
      3                     SELECT  DISTINCT sal,
      4                                      DENSE_RANK() OVER(ORDER BY sal DESC NULLS LAST) AS r_num
      5                       FROM  scott.emp
      6                    )
      7  SELECT  sal
      8    FROM  got_r_num
      9    WHERE r_num = 3
    10  /
    Explained.
    SQL> @?\RDBMS\ADMIN\UTLXPLS
    PLAN_TABLE_OUTPUT
    Plan hash value: 436395657
    | Id  | Operation                 | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT          |      |     9 |   234 |     5  (40)| 00:00:01 |
    |*  1 |  VIEW                     |      |     9 |   234 |     5  (40)| 00:00:01 |
    |   2 |   HASH UNIQUE             |      |     9 |    36 |     5  (40)| 00:00:01 |
    |*  3 |    WINDOW SORT PUSHED RANK|      |     9 |    36 |     5  (40)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL     | EMP  |    14 |    56 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       1 - filter("R_NUM"=3)
       3 - filter(DENSE_RANK() OVER ( ORDER BY INTERNAL_FUNCTION("SAL") DESC
                  NULLS LAST)<=3)
    18 rows selected.
    SQL> EXPLAIN PLAN FOR
      2  WITH got_r_num AS (
      3                     SELECT  sal,
      4                             DENSE_RANK() OVER(ORDER BY sal DESC NULLS LAST) AS r_num
      5                       FROM  scott.emp
      6                    )
      7  SELECT  sal
      8    FROM  got_r_num
      9    WHERE r_num = 3
    10      AND ROWNUM = 1
    11  /
    Explained.
    SQL> @?\RDBMS\ADMIN\UTLXPLS
    PLAN_TABLE_OUTPUT
    Plan hash value: 21859616
    | Id  | Operation                 | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT          |      |     1 |    26 |     4  (25)| 00:00:01 |
    |*  1 |  COUNT STOPKEY            |      |       |       |            |          |
    |*  2 |   VIEW                    |      |    14 |   364 |     4  (25)| 00:00:01 |
    |*  3 |    WINDOW SORT PUSHED RANK|      |    14 |    56 |     4  (25)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL     | EMP  |    14 |    56 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       1 - filter(ROWNUM=1)
       2 - filter("R_NUM"=3)
       3 - filter(DENSE_RANK() OVER ( ORDER BY INTERNAL_FUNCTION("SAL") DESC
                  NULLS LAST)<=3)
    19 rows selected.
    SQL> SY.

  • How to get the update file without using Nokia Sof...

    The network connection is unreliable and downloading the firmware update using PC Suite for my Nokia E90 proves difficult. Does anyone know how I can get the firmware version 300.34.84?
    The trouble is Nokia's Software Updater does not accommodate any slight interruption to the connection during the update process. I will update this discussion with what version of PC Suite I have once I get that info.
    Any help is kindly appreciated

    In fact, it is not Possible to get the update file without using Nokia Software Updater or you should search the net to find the update files in another place and even you get them, you can not use them with NSU.
    You can Update your Device with:
    1 - NSU (Nokia Software Update)
    2 - FOTA (Firmware Over The Air) for FP2 devices ONLY.
    3 - Nokia Care Center
    there is not other way to upgrade.
    Hope useful for u.
    regards
    Nokia N79 4GB
    SW Version: 32.001 RM-348 MEA

  • I have a iphone 4 with no SIM trey hole. Is there anyway i can get the serial number without using itunes?

    I have a iphone 4 with no SIM trey hole. Is there anyway i can get the serial number without using itunes? My iphone is disabled and will not connect to my computer because it is locked.

    Why do you need the serial number? You could get it if you'd ever synced it to that copy of iTunes before, but I'm guessing that's not the case.  You need to put the phone into recovery mode and restore it if it's disabled now. There really isn't any other choice.

  • Max value without using max() function

    Hi
    Is there any way to get the max value from a table without using MAX() function
    Thanks

    well if you think about it i'm sure you'll find a solution
    what does max(field) means, it simply is the value of the field where no other value of the same field that is > than this value exists.
    consider the following :
    table TAB(
    fld NUMBER(5));
    translate the logic and you'll have
    select a.fld from TAB a where NOT EXISTS(select b.fld from TAB b where b.fld>a.fld) and rownum=1;
    of course there are better ways i'm sure, you'll just have to figure'em out.

  • Function that returns N values, without using a string

    Hi, how can i make a function that returns several valures (that hasn't a exact number of returned values, it could return 3 values, or 7) without using a string?
    When i need to return several values from a function, i put the values inside a varchar like thus 'XXX,YYY,ZZZ' and so on. Don't know if this has a poor performance.
    If you can supply simple examples for what im asking, i would be nice.
    (without using a string)

    Can i create the type objects inside a package? If i
    can, they will be local to the package, right?Yes, you're right.
    Pipeline returns a row or several?You can use pipelined function in the same way you use table:
    SELECT * FROM TABLE(pipelined_funct(agr1, agr2));
    It returns results as separate rows.

  • How to get the database value without submitting the jsp page

    Hi,
    I have a form that has many fields (textbox/listbox). when user enter/change a value in the first textbox, I need to pass this value to the database to check whether it exist and get the other values to be displayed to other fields in that form (i cannot get the javascript value to be pass to jsp without reload/refresh/submit. But, I need to get the user entered value, so I thought of hidden popup, iframe, etc but not sure how I could apply and which best suit this case). If I submit the page then I can easily get the value thru 'request.getParameter("fieldname") but cannot use this because I cannot submit the page.
    Pls help and possible provide me with the sample coding
    Thanks

    The best way for you is surely AJAX. But there is another way to stay compatible with older browsers:
    Since the default method a browser supposed to get data is refresh, there is nothing unnatural in it. Browsers are optimized to refreshes, like cached images, etc..
    So for these step-by-step things, you need to roll forward your data from page to page, and make the page to respond according the data it actually have. This can be easily achived with type="hidden" input fields in a form: the user will send you back all the data. Optionally you may show him the data you already have as visible text too.
    A more generalised way to "pull" the data: you make a whole page you include every time you need an additional data. This page will receive 2 parameters from where you've included it. This 2 parameters are each indexed arrays with the datas you have to pull in (here the default value), and you need to push forward. Optionally there is a 3rd parameter, the url it have to return (as the form's action property).
    And for them who now say that it would me more culture way to store this data in the session: Beware! Common mistake: Sessions are to store data about the user itself, not the datas for the next page! You never know what will be the next page! The user click some backward button and refresh button, and depending on your script, it may go stupid! Ok, not all the codes, but I've seen some. It's ok to store a sent file (fx. image) on the server, but always think the evil refresh and back buttons!

  • Sort Rowset field values without using rowset.sort or sortscroll

    Hi dudes,
    any one tell me the different ways to sort a rowset values ie, single field or more than one field without using Rowset.sort or Sortscroll() method. i tried some ways but not get the optimum solution.

    My first question to you would be why you want alternatives for Rowset.sort or Sortscroll.
    Your question doesn't describe your true issue or motive to search for alternatives for delivered PeopleTools Apis & Buildin Functions.

  • How to get path of a VI used in LV project?

    How can I get the path of a VI used in LabVIEW project?
    Actually I want to replace the VI used in LV project by saome other VI, and I think it can be done if I get the path of the VI already present in project and replace that path with path of the VI which I want to include in that project.

    There are several ways to replace a VI, say "MyFirstVI", with another, say "MySecondVI".  The method you use will depend on several factors, including
    the version of LabVIEW you are running
    whether the VIs are in a LabVIEW Project or not (if they are, I'm assuming they are in the same Project)
    whether you want to replace all MyFirstVI instances with MySecondVI, or selected ones
    the size (number of VIs) of the Project.
    As noted, if you want to replace all of MyFirstVI with MySecondVI in a Project, here is one way to do this:
    Close the Project.  You do not want to do this with Project open.
    Rename MyFirstVI to MyOldFirstVI.
    Rename MySecondVI to MyFirstVI.  If MySecondVI already exists in the Project, you might want to Copy it instead of Rename.
    Open the Project.  Find and open an instance of MyFirstVI, verify it has the code of MySecondVI.
    In Project Explorer, find MyFirstVI and rename it MySecondVI.
    Exit Project.  Rename MyOldFirstVI back to MyFirstVI.
    At this point, all of your VIs have their "original" names, but in, say, Main.vi, wherever MyFirstVI was called, you should see MySecondVI.
    For doing selective Replacement (or even total replacement where you want to actually see all of the instances where replacements are made), you can use QuickDrop to your advantage.  You need to have in memory the VIs that use MyFirstVI, and also have MySecondVI in memory.  With the Project open and the relevant VIs in memory:
    Open any VI that shows MyFirstVI on the Block Diagram.  Right-click it and choose "Find All Instances".
    When the search is done, you need to "visit" each of the found VIs -- use Ctrl-G to do this.
    When you find an instance of MyFirstVI, type Ctrl-Space to activate QuickDrop, start typing MySecondVI until it appears on the Selection line (if you are lucky, you will only need to type MySec and it will find the correct VI), then type Ctrl-P to replace MyFirstVI with MySecondVI.
    Type another Ctrl-G to go to the next instance of MyFirstVI and replace as needed.  When you've replaced all of them (or all that you want to replace), stop.
    Bob Schor

  • How to set item values without using fields in branch's ACTION block?

    Okay, I will try to say this in a easy way so it is not weird.
    I have created a button, SAVE, that has a Branch of branch type: Branch To Function Returning A Page. This is my code for the branch:
    if :P2008_NAP_SUPPORTING_MATERIALS = 'Yes' then
    return '2092';
    else
    return '2040';
    end if;
    The code for this type of branch is stored in the ACTION block of the Branch page. The ACTION block for a Branch of branch type: Branch To Function Returning A Page is different than the ACTION block for a Branch of branch type: Branch To Page Or URL.
    I need to set some item values with some specific values, which I can do with a branch type: Branch To Page Or URL. This is not possible with the branch type: Branch To Function Returning A Page. The ACTION block is totally different.
    How can I set some values on say Page 2040 from Page 2008 without using fields in the branch's ACTION block?
    Thank you in advance,
    Maggie

    Andy and Scott,
    I love seeing different perspectives in solving problems, it opens my eyes to new ways of looking at/using the tools (reserved words and 'Function returning a Page', etc.).
    One of my pet peeves has been that on branches I was limited to only 10 variables to be passed (I know, who would want more - but there was an instance where I had to pass more), and an even more frustrating time when using report Column Linking, which limits me to 3 variables.
    At least with the Branch linking I can use your suggestion Andy and add the variable setting statements into the function. I am assuming of course (and I should be able to) that I will be able to set more that 10 variables in a IF condition prior to the RETURN statement. This method will be much more understandable, for me, when looking through the branch at a later time to see what is happening, than an URL link where all the variable are strung out 'in a line' so to speak.
    I will still need to use URL Target branching on Links contained within a Column Attribute when I need to pass more than 3 variables, of which I have several places where I do this.
    Thomas

  • Last cell in range containing data without using ROW()

    Hi,
    I am trying to locate the last cell with data in a range. For example, in this sample range, A1:B4 ...
    ___A___B
    1 6/20 238
    2 6/22
    3 6/24 241
    4 6/25
    I need to return value of 241 and also return the date of 6/24. I initially used this formula in Excel, which worked great to find this information:
    ={(MAX((B$1:B$4<>"")*ROW(B$1:B$4)))-ROW(B$1:B$4)+1}
    However, I then discovered that Xcelsius does not support ROW(). Does anyone have an alternative to using ROW() in this scenario? Thanks!

    Hi,
    I am trying to locate the last cell with data in a range. For example, in this sample range, A1:B4 ...
    ___A___B
    1 6/20 238
    2 6/22
    3 6/24 241
    4 6/25
    I need to return value of 241 and also return the date of 6/24. I initially used this formula in Excel, which worked great to find this information:
    ={(MAX((B$1:B$4<>"")*ROW(B$1:B$4)))-ROW(B$1:B$4)+1}
    However, I then discovered that Xcelsius does not support ROW(). Does anyone have an alternative to using ROW() in this scenario? Thanks!

  • Need to take rownum highest value without using grouping functions

    Hi
    I want to display highest value in the rownum column and customer details without using grouping functions like max or count
    this below query gives me all rownum values and customer details
    SELECT ROWNUM ROWNUM_1, CUSTOMER_NO, CUSTOMER_NAME, CUSTOMER_DOJ, CUSTOMER_MOBILENO FROM CUSTOMER;
    can any one help me.

    The above query won't work as it's missing "from" cluase in the inner select statement.
    And even if corrected it willl print rownum values thrice: value "1",max_rownum, max_rownum followed by customer details.
    Below is the simple query to retrieve max row_num along with the corresponding customer details.
    select * from (SELECT ROWNUM ROWNUM_1, CUSTOMER_NO, CUSTOMER_NAME, CUSTOMER_DOJ, CUSTOMER_MOBILENO FROM CUSTOMER order by rownum_1 desc) where rownum<=1 ;

  • Is there any way to wait for a value without using JDialog or JOptionPane?

    I am implementing a dictionary program by detecting word in a JTextPane and asking a user to choose one of available meanings from JOptionPane or JDialog. The program runs under a while-loop until all dictionary words are detected or a user clicks cancel.
    However, I don't want to use JDialog or JOptionPane because it is sometimes annoying to have a popup window on every detected dictionary word.
    So, I use JList with Buttons on the same Frame as the JTextPane. However, now, the program does not stop when it detects a dictionary word. It just uses a default value of the JList for translating word to meaning.
    Is there any way I can simulate the JDialog or JOptionPane without using it?
    I mean I'd like to stopp the program temporary, wait for an answer from other components, and then continue to detect the next dictionary word.
    Thank you.

    I'm probably reading this all wrong, but instead of the while loop,
    the method just looked for a dictionary word from a particular caretPosition,
    so, to start, it would be findWord(0)
    when found, add whatever to wherever, note the caretPostion at the end of the 'found' word, and method returns.
    when the user selects whatever button, the button's actionListener also calls the method again, using the noted caretPosition
    findWord(42);
    so, it starts searching from 42 (instead of the start)
    basically it is event driven
    findWord sets the button/s
    click a button starts findWord

Maybe you are looking for