How to implement a go to next node button for an ADF Tree backed by ADF Bin

Dear all,
I have been trying for quite some time now, and I do not get it. For my ADF Tree component, I want to implement a series of little iconic buttons that my users can press to Expand and Collapse the current node - those I have got to work, sort of - and Move to the Next or Previous node. My definition of Next Node is: the next node you can see on the screen; this can either be a child, a sibling or an ancestor's sibling.
+ A
- B
|- C
|+ D
+ E
So from A, next means B, from B next means C, from C it means D and from D it should go to E.
My main question is: how can I programmatically set the currently selected node in the tree? And I mean not just set the focusRowKey...
My tree is bound to a ADF Tree Iterator Binding.
My tree nodes are 'clickable through an action link; this informs a managed bean of the currently selected node, a JUCtrlHierNodeBinding instance.
<f:facet name="DeptView1Node" >
<h:panelGroup>
<af:commandLink text="#{node.Dname}"
immediate="true"
action="StartHrmTree"
>
<af:setActionListener from="#{HrmTreeTree.tree.rowKey}"
to="#{HrmTreeTree.focusRowKey}"/>
<af:setActionListener from="#{node}"
to="#{HrmTreeTree.selectedNode}"/>
<af:resetActionListener/>
</af:commandLink>
</h:panelGroup>
</f:facet>
At that point, in my setSelectedNode method, I can access the Node, its children etc. Methods calls to the tree are less successful; despite their description in the JavaDoc, calls like: getTreeModel().getRowKey() or getContainerRowKey() return null.
From the Next Node button:
<af:commandButton immediate="true" actionListener="#{HrmTreeTree.nextNode}" text="&gt;">
</af:commandButton>
I invoke the nextNode() method on my bean. When I access the selectedNode that I saved on this bean when the node was clicked on, I no longer can access the children of the node. Even the childIterator property returns null.
Using the RowSetIterator I can access the current Row, go to the next row in the RSI, access children, so that seems a reasonable approach. However, I do not know how I can make the first child the currently selected node or even how to tell the tree that the child iterator is the current one.
Using this code:
// find out if the current Node has a child
DCBindingContainer container =
(DCBindingContainer)JsfUtils.getExpressionValue("#{bindings}");
String iterName = "HrmTreeTreeIterator";
JUIteratorBinding ib =
(JUIteratorBinding)container.findIteratorBinding(iterName);
List ibs =container.getIterBindingList();
FacesCtrlHierBinding tree = (FacesCtrlHierBinding)container.findCtrlBinding("HrmTreeTree");
RowSetIterator rsi2 = ib.getRowSetIterator();
I never seem to be able to get beyond the RowSet iterator of the root level nodes. How can I make a child node's row set iterator the current one? How is it that my selected node object does not know how to access its child-nodes or even its childIterator binding? What refresh operation is required here?
Any help will be very much appreciated (and credited in the blog article I will write when it all works out).
Lucas

Can you try setSelectedRowKeys(RowKeySet newSelectionState) API on the tree? That should change the selection.
You can do some thing like this to populate the RowKeySet:
RowKeySet oldSelectionState = null;
RowKeySet newSelectionState = null;
oldSelectionState = table.getSelectedRowKeys(); //table is the table component
newSelectionState = oldSelectionState.clone();
newSelectionState.clear();
Object oldRowKey = table.getRowKey(); //Save the orginal rowKey in the variable
String rowKey = "XXXX" // the key of the row you want to select
table.setRowKey(rowKey); //set the currency of the table to the row you want to select
newSelectionState.setContained(true); //add the current row to the selection key set
table.setRowKey(oldRowKey); //Restore the currency to the old one.
table.setSelectedRowKeys(newSelectionState); //update the table selection
///Now Do some partial update here to change display

Similar Messages

  • How to implement the search help exit to MM01 for Material by product hiera

    Hi,
    How to implement the search help exit to MM01 T-code for Material by product hierarchy,
    but system default it gives the data from MVKE table, my client wants from MARA table,
    i created the one Function Module, write this code in that FM.
    IF CALLCONTROL-STEP EQ 'DISP'.
    REFRESH RECORD_TAB.
    SELECT * FROM MARA INTO TABLE RECORD_TAB
    WHERE PRDHA = 
    ENDIF.
    I Face the problem what variable i have to pass in WHERE CONDITION, FROM THE MM01 T-code.
    is't require to IMPORT variable from MM01 program, what is that import variable, please give me the solution.
    thanks to all.

    Hi there..
    check my web blog on search help exit...
    [Search help exit code|https://wiki.sdn.sap.com/wiki/x/du0]

  • How can I add a custom made share button for Facebook?

    Hi!
    I have built a custom "share"-button for Facebook (with an additional layer for rollover/active states, using photoshop), but I don't know how to make it work?
    What code do I have to use, or can I just create a link using my button? What would the adress be?
    I googled this but couln't find anything that helped...
    Thanks in advance!

    It doesn't appear so simple Tobi. The image is pulled from Facebook's servers and the button in itself is an altogether different HTML page from Facebook shown on your site within an iFrame.
    I found something similar to your request (this requires PHP support on your server). Please check the below link.
    http://www.daddydesign.com/wordpress/how-to-create-a-custom-facebook-share-button-with-a-c ustom-counter/
    Thanks,
    Vikas

  • How to move focus from one JTree node to another one and then back again?

    Hi all!
    Say I have a very simple JTree
    package main;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JTree;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class SelectableTree extends JFrame implements TreeSelectionListener {
        public static void main(String[] args) {
            new SelectableTree();
        private JTree tree;
        private JTextField currentSelectionField;
        public SelectableTree() {
            super("JTree Selections");
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent event) {
                    System.exit(0);
            Container content = getContentPane();
            DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
            DefaultMutableTreeNode child;
            DefaultMutableTreeNode grandChild;
            for (int childIndex = 1; childIndex < 4; childIndex++) {
                child = new DefaultMutableTreeNode("Child " + childIndex);
                root.add(child);
                for (int grandChildIndex = 1; grandChildIndex < 4; grandChildIndex++) {
                    grandChild = new DefaultMutableTreeNode("Grandchild "
                            + childIndex + "." + grandChildIndex);
                    child.add(grandChild);
            tree = new JTree(root);
            tree.addTreeSelectionListener(this);
            content.add(new JScrollPane(tree), BorderLayout.CENTER);
            currentSelectionField = new JTextField("Current Selection: NONE");
            content.add(currentSelectionField, BorderLayout.SOUTH);
            setSize(250, 275);
            setVisible(true);
        public void valueChanged(TreeSelectionEvent event) {
            currentSelectionField.setText("Current Selection: "
                    + tree.getLastSelectedPathComponent().toString());
    }All I need is to move focus from currently selected node, to some other node (does not matter which one), then to "sleep" for a second and finally move it back to return selection to the previously selected node. The only question is how do I do this?

    Use a Seperate Thread to do it:
    Runnable r = new Runnable() {
        public void run() {
                   int k=tree.getSelectionRows()[0];
                   DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
                                if(node.getNextSibling()!=null)
                                     tree.setSelectionRow(k+1);
                                else
                                     tree.setSelectionRow(k-1);
                                sleepe(k);
    public void sleepe(int i){
                         try{
                                Thread.sleep(1000);
                                     }catch(Exception e){
                                         e.printStackTrace();
                                  tree.setSelectionRow(i);
        }Then start this thread in a mouse click event(or any other similar),but not in TableSelectionListener because >>if the current selected row is 1 then it will execute the valueChanged method of TableSe..li. and we set the selected row to 2 then again it will execute the valueChanged method of TableSe..li.It will repeat till something,or in error.
    tree.addMouseListener( new MouseListener(){
    public void mouseClicked(MouseEvent e) {
                       new Thread(r).start();
    public  void mouseEntered(MouseEvent e) {
    public  void mouseExited(MouseEvent e) {
    public  void mousePressed(MouseEvent e)     {
    public  void mouseReleased(MouseEvent e) {
      });Note:it worked perfectly for me. So add all the above in the right place and import necessary.It will execute perfectly.

  • Acrobat 9Pro - How to add a submit (to email address) button for an online fillable PDF form.

    Sorry if this has been answered before, but this is my first time trying to add a submit button to the bottom of a online fillable pdf form. I have 5 of these froms to do. I need the user to go to my website, click the link to open an online fillable form, fill it out and click a submit button in the form, so it can be emailed to an individual. I thought I followed all the steps correctly in Adobe Acrobat 9 Pro, every which way I could find, but the form gives me an error "this operation not permitted", it's in IE, created in Vista and I now have a headache. Do I need to add extra code to my website html somewhere?
    Does anyone have the neccessary steps to make this work, a video would be even better. Do I have to have this LifeCycle Designer thing?
    My url in case anyone wants to see it. http://www.dyenetwebdesign.com/DaysGoneBy/forms/index2.html
    Thanks sooo much!!
    Deb Dye

    Some comments based on your application:
    1. It looks like might likely exceed the 500 use limit, in that case to not use Reader Rights or you will violate the license. The cost beyond that can be negotiated with Adobe (if they will talk to you), but don't expect it to be check. In that case, submit the form data as and FDF file. This file can be imported into the form at your end and get exactly the same results as if the whole form had been sent. The FDF submission does not require Reader Rights. The parent will still be able to print the form, but saving would require having Acrobat, not Reader.
    2. A lot of the data appears to be personal in terms of the name of children, addresses, etc. It would be a good idea to check with legal counsel about submitting such information by e-mail, particularly for children. E-mail is not generally considered secure, unless you possibly used some form of secure e-mail. For that reason you should consider submitting the data to a web script that would be stored someplace for you to obtain it and possibly send you a notice of receipt. A secure website is preferred for this use. You should keep the option open for anyone to submit the form in paper if they object to the potential security risks with your online submission method.
    I know those put rinkles in your forms, but for such an application it is a good idea to consider the potential consequences if you do not worry about the form security and number of uses. The potential is to put you out of business or more. OK, an extremist view, but worth considering.

  • How to make a US map with interactive buttons for every state ...

    I have a photoshop map of the unitedstates with the states seperated. what I would like to do is put this map in dreamweaver so that each state is a button....any ideas?

    imagemap
    best,
    Shocker

  • How can I set up tablet shortcut menu button for the middle button my X230T?

    I think I have a faulty X230T, there are now only three tablet buttons and the middle does not do anything. I have installed 7wg737.exe (tablet short menu for Win7), but it does nothing.
    When I go into Tablet PC setting>buttons, only one button shows up and that's the screen rotation button. 
    Is there a way to assign the middle button to shortcut menu? Otherwise I'm unable to change brightness or volumn during tablet mode which would make this tablet unusable.

    Hi Susan,
    Try Butler...
    http://www.versiontracker.com/dyn/moreinfo/macosx/20035

  • How come I don't have serial number button for FCP academic version?

    I just received the Academic Version FCP and on the installation disk, there is no button to install the serial number or user information.

    FCS comes with the serial numbers printed on the front of the getting started booklet. If you don't have that, you'll need to call Applecare. In the box you should find a card with Applecare phone support numbers.
    Give them a call. New purchases come with 90 days support for installation issues.
    x

  • How to implement a java class in my form .

    Hi All ,
    I'm trying to create a Button or a Bean Area Item and Implement a class to it on the ( IMPLEMENTATION CLASS ) property such as ( oracle.forms.demos.RoundedButton ) class . but it doesn't work ... please tell me how to implement such a class to my button .
    Thanx a lot for your help.
    AIN
    null

    hi [email protected]
    tell me my friend .. how can i extend
    the standard Forms button in Java ? ... what is the tool for that ... can you explain more please .. or can you give me a full example ... i don't have any expereience on that .. i'm waiting for your reply .
    Thanx a lot for your cooperation .
    Ali
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    Henrik, the Java importer lets you call Java classes on the app server side - I think what Ali is trying to do is integrate on the client side.
    If you want to add your own button then if you extend the standard Forms button in Java and then use this class name in the implementation class property then the Java for your button will be used instead of the standard Forms button. And since it has extended the basic Forms button it has all the standard button functionality.
    There is a white paper on OTN about this and we have created a new white paper which will be out in a couple of months (I think).
    Regards
    Grant Ronald<HR></BLOCKQUOTE>
    null

  • How to implement a forever running program?

    i made a program that does some file i/o in an infinite loop (while(!stop)). if all work is one it waits until "jnotify" notifies that a new folder was created and it starts working again. this program has a jmx interface to start and stop this loop. all functionality is done only the main() is missing now.
    how to implement a forever running main, only waiting for (user)-methods called to execute them - just like any gui-application? i guess in a swing-app there is no while(!closed)-loop? (in meantime i noticed - such loops consum 100% cpu ;-)). So is there a best practice or a "pattern" for such common apps?
    thx in advance

    817113 wrote:
    in my case the "inner-jnotify-file-io"-thread it self is stoppable (while(!stop) listen for jnotify events). but if this thread is stopped the hosting main-method must keep runnning - waiting until someone calls start() via jmx or shutdown(). Strictly speaking the main methods only task is to host the jmx interface (, the logger..) and to run until someone calls shutdown (like a swing gui that waits until someone closes the window).
    How to implement such behavior? Do i need another thread within main, waiting for such an event and message it to the hosting main method? Main already runs in its own thread, if your "inner-jnotify-file-io"-thread has to be able to be stopped (instead of just paused), then you need another thread that stays alive.
    You could make the main thread wait() on something that gets notified() when close is called.
    (i could hardly believ that there is no "pattern" or example fo a main()-method/app that is running until someone calls a "close"-methode)No, you're just not understanding the big picture here. It's quite easy to make an app like that. And you've been given ways and information on how to do it.

  • How to Implement a Single Folder - Multiple Authors Scenario für NW 7.3?

    Hello,
    is a version "How to Implement a Single Folder - Multiple Authors Scenario" for NetWeaver 7.3 planned?
    Best regards,
    Arnold Gallemann

    Hi Detlev,
    thanks a lot for sharing your work!
    Due to the reason we need a different configuration in KM, I changed e.g. some values in the .cc.xml and .co.xml files. I rebuild the project and checked the created EAR file. I noticed that the ConfigArchive file in EAR file still has the old values. It seems that SAP NetWeaver Developer Studio 7.3 is not recognizing in a portal application project the configuration of the src.config folder anymore. To test this, I removed the initial provided ConfigArchive in the folder dist\PORTAL-INF\config\ from your project. I rebuild it and the ConfigArchive in the EAR file wasnu2019t included.
    I found in the documentation (http://help.sap.com/saphelp_nw73/helpdata/de/42/60aec0032c1422e10000000a114cbd/frameset.htm) the SAP Note 1572813, which would describe how to use KMC wizards in SAP NetWeaver Developer Studio 7.3. But the article is currently not released to public.
    In addition I have discovered, that it is possible to include the src.config folder in the build process if the project is set up as a development component (see for details bullet point Optionally of http://help.sap.com/saphelp_nw73/helpdata/de/42/60aec0032c1422e10000000a114cbd/frameset.htm). This works. But later on I am facing another problem: I am missing the entry KMC-CM to add it as a dependency for the development component.
    Best regards
    Mario

  • How to implement a simple node-edge graph?

    Can any one give me some advice on how to implement a simple node-edge graph in a frame? Every node is a rectangle which can be moved by mouse, and every edge is a arc between two nodes.
    Should the node class extend JPanel, and the edge class extend Graphics? and so on?

    It is impossible to generate similar update from OWB.
    Does your table1 contain primary key columns? What is the number of rows in this table?
    The only working solution in this case - use table1 twice in mapping - as source and as target (with UPDATE operation),
    link these operators with primary key columns and specify matching by PK columns.
    Updated column link to Constant operator attribute.
    In this case OWB generate SQL like
    merge table1 a
    using table1 b
    on (a.pk_column=b.pk_column)
    when matched then update set column1=1
    Regards,
    Oleg

  • How to implement Dynamic Context Node Mapping between Components

    Hey genuis:
               I am looking for how to implement context mapping bwteen two components. I read some threads, and try to use external context mapping. The example works fine. However, my requirement is more than that.
    I have a context node in Component B, and the attributes in it are dynamically generated. Component A is the main component which use Component B's function. Both A and B work fine by theirselves. 
    When I assemble A and B (external mapping), the system gives me a exception:com.sap.tc.webdynpro.progmodel.context.ContextException: MappedNodeInfo(T8UploadCompInterface.data): cannot create nodes, no mapping defined yet.
    Please give me some suggestion?
    Any responses are appreciated.

    I miss this thread.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6fdae690-0201-0010-a580-d104b459cb44
    This is almost the right solution for my problem.

  • How to implement next line

    hi
    i ahve a problem
    in main window there are line items outputed in rows and columns seperated by vertical lines and horizontal lines
    now my requriment is that under a column say column3 i want an extra line to display some more data in that column only
    how to do it
    mean for all columns 1 column2 there will be n othing corresponding to that particlar row only in column3 data will be tehre rest all columns that data will be blank...
    my q
    wht is command to give next line under for that particlual columns
    and what tabs should i put to escape that data coming to columns 1 and columns2 only for column3 it should come
    how to give blank space for first two columns and reach the third columns what code to write in form
    regards
    Arora

    Hi Nishant,
    I assume you want the output to be as follows.......
    S.No.---- Mat. No----Description
    01--A00101---LCD Screens, Monitors,
    Computing.
    02--A00102---Modems, Networking
    03--A00103---Mouse, I/O Devices,
    Computing.
    The simplest solution for your problem is, for column 3 (here Description), specify a left margin and a right margin. Say, you want the text to be printed at 7 inches from left of the page margin and should end at 10 inches from the page margin, go to paragraph format and create a new one with desired font type and size and specify a left margin with 7 inches and a right margin with 10 inches. The data will be restricted to that particular column and rest of the fields will be printed as per the TABs specified for them.
    Hope this clears your problem. If this was helpful, please award points.

  • How to implement OSS notes : 207260

    Hi All,
    Can anybody please let me know how to impement oss note : 207260.
    I need to implement Note : 207260 which is settlement rule for incorrect last used period.In this note its saying to run ZMIGCOBR to repair incorrect settlement rule for incorrect objects. But in this notes its not given any such program.
    Please let me know how to implement OSS notes since i never done this before.
    Thanks in advance.
    Regards,
    Vishal

    Check the below point:
    SAP R/3 Document : Using Transaction SNOTE
    Implementing OSS Notes Using the new Transaction Code SNOTE
    In this document we will see how to implement an OSS note using the SNOTE
    transaction code.
    The transaction code SNOTE is used to implement OSS Notes. With the SNOTE
    transaction, it is no longer necessary to register ABAP objects such as report function
    modules etc. manually. But data dictionary objects such as screens, tables need to
    be modified manually by registering them in OSS system.
    In order to use the transaction code SNOTE, the relevant transport which implement
    this transaction in the system need to be transported. Please refer to the SNOTE
    guide available at http://service.sap.com
    Execute the Transaction code SNOTE
    One of the first steps to do is to upload the note into your system.
    Follow Goto à SAP Note Download
    You can also use the SAP Note upload if the note has been saved in your local
    machine
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    In the following box that you get, enter the note number. We will take Note 388732
    as an example
    and click on the Execute icon. You will get the note number displayed in the list of the
    OSS notes
    In the above screen, we have two notes listed.
    By double clicking on or on the note number you can display the OSS note.
    You can also check the Status of the note by clicking on the Check SAP Note icon
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    Select the note and click on Check SAP Note icon. In this case we have selected
    note number 388732.
    If the note is not implemented as part of some support pack as per the support pack
    level of your system, you should get the following pop up box.
    Select the note number that you want to implement and goto Edit à Select/deselect
    node
    To implement the OSS note click on the Implement OSS Note icon
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    You will get a confirmation box like the following
    Click on Yes
    Click on the Continue icon
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    You will be prompted to enter a change request number.
    Click on the Create Request icon
    Enter a brief description of for the note and click on the continue icon
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    A change Request number is created for the change that you are making
    Click on the continue icon
    The system will display the objects that are going to be modified during the process
    of note application.
    In our case, Report LTXW0F10 and RTXWCHK1 are going to be modified.
    Click on the Continue icon
    For while the system will show the note in IN PROCESS status
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    After a while, select the note and click on the Check SAP Note icon on the application
    toolbar
    But still the Status of the note is displayed under In Process category.
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    You can also check the status of the note by checking the meaning of the icon next
    to the note number.
    To check the legend, follow Utilities à Color Legend
    As you can see from the legends box, means Implemented Correctly.
    Since the note is implemented, you can change the status of the note from In
    Process to Completed manually.
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    Select the note and click on the Set Processing Status icon
    In the Pop up box that you get, select the Completed radio button
    And click on the Continue icon
    SAP R/3 Document : Using Transaction SNOTE
    http://www.sappoint.com
    The note number is removed from the list
    ü You can also check the logs of the activities performed during the OSS note
    implementation by clicking on the Logs icon on the application toolbar. The log
    information will contain all the steps that were performed from the point of
    downloading the note will its implementation is completed.
    ü If there are any pre-requisite notes for the note that is being applied, the
    system will prompt you to load those notes too into the system. Depending on
    their applicability to your system, the system will prompt you accordingly to
    apply the pre-requisite notes.
    ü You can register the manually implemented SAP notes by executing the report
    SCWN_REGISTER_NOTES.
    ü SNOTE cannot change or modify data dictionary objects. If there is a note
    which requires changes to be made to a structure or a screen then SNOTE will
    not help. Such objects have to be registered and modified manually.
    http://www.sappoint.com/basis/snote.pdf
    Regards,
    Prakash.

Maybe you are looking for

  • How To create a rebate in SAP relating to a product group (3 digit). ??

    How To create a rebate in SAP relating to a product group (3 digit). ??

  • Mac will not start up....

    Need Help I am unable to start up my G4 DP1.25GHz MDD Once I push the startup button the Mac chimes A grey screen appears with a apple sign 1 - 2 mins later it changes to the prohibitory sign and stays on it. I checked the hard disk in another mac an

  • Synching calendar with computer

    I have a new HP Windows computer, and want to synch my Blackberry Torch9810 calendar.  I don't have Outlook, but I do have Windows Calendar.  Will this work?  If not, what Windows 8 calendar programs will?

  • Compare and adjaust configuartion for different Report Servers

    Hi All, in one OFM-environment (11.1.1.6.0), I need to find and adjust different configuartion between reports servers. I can see in EM only ONE Report Server under asinst_1 and colud not find other Report Server (in-process-server). In addition, I c

  • OEBH is stuck at activity Close Blanket - Eligible

    Hi Experts! I am facing issue when Terminating a Blanket sales agreement, the sales agreement is terminated from the front end but when I check the workflow for OEBH, the worklow is waiting at activity 'Close Blanket - Eligible' with the status of ac