Setting annimated image to tree node

Hi all,
I am setting an annimated gif image to tree node like this,
ImageIcon newIcon = ImageIcon.get("test.gif");
setClosedIcon(newIcon);
setOpenIcon(newIcon);
setLeafIcon(newIcon);
but with this the annimation effect doesn't appear in the node.
It is only static image without annimation.
what is wrong here?
how to achieve annimation on tree node?
pls help
-Soni

Thanks for the reply Frank.
I saw the link http://sreevardhanadf.blogspot.in/2012/07/showing-next-row-as-current-row-after.html
However the issue is since I am using custom created tree using POJO tree item (composite object).
calling myTree.getWrappedData() doesn't gives me a handle to JUCtrlHierBinding and subsequent access to JUCtrlHierNodeBinding.
my program gives me data like -
List<MyTreeItem> treeData = (List<MyTreeItem>)treeModel.getWrappedData();
because my tree model is build using -
treeModel = new ChildPropertyTreeModel(items, "children");
where items is List of <MyTreeItem>
Hence I am unable to get a handle using -
List nodeParentList = nodeParent .getKeyPath();
I am programmatically able to invoke the parent node to get the fresh data, only issue is the focus/selection of that node is not happening
Is there a way around?
Thanks
Sachin

Similar Messages

  • Tree node images changes.. with start and stop button

    I create the animator extends JPanel, which start and stop can be controlled with Swing Timer. It works fine with animation control over the panel.
    Now, I have a tree with each image at each node.
    when the start button clicks, one node image should be animated.
    It is implementable. If animation.gif would have worked, I did't have to do this, but animation gif has fatal error with time interval.
    any words would be appreciated. Thanks =

    Damn !
    With version 1.2.1 I think you'll have to create a new class that extends PositionPathInterpolator and add a pause() anr resume() method to it.
    i suggest something like:
    public class MyPositionPathInterpolator() extends PositionPathInterpolator {
    // add some constructors if necessary
    private float pauseAlphaValue = 0;
    // override computeTransform method
    public void computeTransform(float alphaValue, Transform3D transform) {
       float newAlphaValue = alphaValue + pauseAlphaValue; // calculate new alpha value
       if(newAlphaValue > 1)  // modify it if it is out of bounds
          newAlphaValue -= 1;
       else if (newAlphaValue < 0)
          newAlphaValue += 1;
       super.computeTransform(newAlphaValue, transform); // computeTransform with the right alpha value
    public void pause() {
       this.setEnable(false); // it won't compute transform anymore
       pauseAlphaValue = this.getAlpha().value(); // retrieve current alphavalue
    public void resume() {
       pauseAlphaValue -= this.getAlpha().value();
       this.setEnable(true) // restart computing transform
    }Now you invoke pause and resume methods on your myPositionPathInterpolator object when user clicks on the buttons.
    Of course it is a trick and it will work only with increasing alpha.
    c ya
    GnG

  • How to set the default tree node in JTree?

    I want to set a default tree node in JTree when start the program,
    what is the method or the function to call?
    Thanks~

    If you by "default" mean "selected", then you can use one of the setSelectionXXX methods in the JTree API.
    If you by "default" mean something else, never mind this post :-)

  • Setting a single tree node row height?

    Is there any way within my treecelleditor to set the row height of a single node, the one being edited, to a larger height, then when editing is done, set it back to normal? Or does the whole tree have to have every row height changed? I want to provide a 2 row editor when a user edits the node.

    Hello Ken,
    Use fire-bug and see what classes APEX is using to toggle tree nodes (to expand and collapse). Generally, the class "open" is used to Open/Expand and class "closed" is used to Collapse tree node.
    Now, if you can determine, which list id from which you need to expand the tree, depending on the page you are, then you can open all child nodes under it using following JS.
    /* Assuming P1_LIST_ID has the ID of List item from where you want to open all child nodes*/
    $("li#"+$("#P1_LIST_ID").val()).find("li").removeClass("closed").addClass("open");You can put the code under "execute when page load" section of your page.
    Regards,
    Hari

  • How to set Tool Tip Text to Tree Node?

    Hi,
    How to set Tool Tip Text to Tree Node in JTree?
    Pls somebody help me to solve it.

    bsampeieri,
    Been here a long time myself. I don't agree with the one post is enough per se. That is to say, sometimes, it helps to post in several groups so that more eyes may see it. A number of forum posters linger in specific forum topics and may not see the post in another forum.
    Now, if in the previous post you/others answered the question and then the OP posted here later, I could see the complaint.
    For the OP, the better way to cross-post is to have one "main" post, then have all the other posts refer back to that one (link to it) so that people aren't duplicating the effort to answer your question(s). A simple "I have cross-posted this to get more eyes on it. Please reply to this question at this post <link here>"

  • On right click, the focus is not set on tree node.

    Dear members,
    I have a tree and a database block, when i right click on a tree node, the focus is not set on the node.
    If I first click on the node and then right click on selected node it populate the database block.
    But I want to populate the datablock on right click.
    how to implement it?
    Regards:

    No body ever encountered this problem?
    Any advice would be appreciated.
    Thanks

  • Setting Dialog, Tree Node and Menu Font in JDeveloper 11.1.1.4/11.1.1.5

    Hi,
    I'm near sighted and thus dependent on being able to choose larger fonts. For the code editor, this poses no problem. For the widgets in the views surrounding the editor (containing tree nodes) and dialogs (with the Preferences dialog being one example), the font is very small at high screen resolutions (I don't want to resort to a lower resolution since I would like the fonts to appear as detailed as possible).
    Is there any way to override the menu, tree node, and dialog font via command line switches and/or property/config files during JDeveloper startup in a platform independent way?
    If it can't be done platform independently, what are the necessary steps on Linux (probably for the GTK lib) and Windows?
    Thanks in advance!
    Kind regards,
    Holger

    I previously developed under full screen option and my PC resolution was 1600x1200. But when the application was ran on other screens it was displaying with some page contents being cut out. It was due to other machines running on lower resoultion. I will need now redesign the pages to run on user defined lower resolution of 1280x1024. How do I setup Jdeveloper design tab to show for 1280x1024.
    Thanks
    Edited by: user5108636 on Feb 14, 2011 5:23 PM

  • How to set the control-on hierarchical tree nodes

    Hi,
    I have created form in which at the left it has hierarchical tree structure(BOM) and towards the right it brings up the query results for selected node.
    Now, I have a button upon clicking which I navigate to the root node by issuing
    "Ftree.set_Tree_selection(htree, 1, Ftree.select_on);".
    But, it cannot automatically run the ' when-tree-node-selected' trigger '.
    any solution???
    Its really urgent.I have a customer demo on monday.
    Please help me asap.
    regards,
    Nagadeep.

    Hello Nagadeep,
    couldn't you just put the code from the trigger into a procedure
    and run that after the navigation to the item?
    Just a thought,
    Bernd
    The docs state that:
    No programmatic action will cause the When-Tree-Node-Selected trigger to fire. Only end-user action will generate an event.
    Probably due to performance reasons.
    Bernd
    Message was edited by:
    Bernd Prechtl

  • Tree and Tree Node Components - Threadinar7

    Hi All,
    This is the seventh in the "Threadinar" series , please see Threadinar6 at
    http://forum.sun.com/jive/thread.jspa?threadID=100601 for details
    In this Threadinar we will focus on the
    "Tree" and "Tree Node" Components
    Let us begin our discussion with the Tree Component.
    Tree Component
    You can drag the Tree component from the Palette's Basic category to the Visual Designer to create a hierarchical tree structure with nodes that can be expanded and collapsed, like the nodes in the Outline window. When the user clicks a node, the row will be highlighted. A tree is often used as a navigation mechanism.
    A tree contains Tree Node components, which act like hyperlinks. You can use a Tree Node to navigate to another page by setting its url property. You can also use a Tree Node to submit the current page. If the the Tree Node's action property is bound to an action event handler, selecting the node automatically submits the page. If the Tree Node's actionListener property is bound to an action listener, opening or closing the node automatically submits the page. You set Tree Node properties in the Tree Node Component Properties window.
    * If you use this component to navigate between pages of a portlet, do not use the url property to link to a page. Instead, use the Navigation editor to set up your links to pages.
    * Events related to tree node selection do not work correctly in portlets because the component uses cookies to pass the selected node id back and forth, and cookies are not correctly handled by the portlet container. You cannot handle tree node selection events in portlet projects.
    Initially when you drop a tree on a page, it has one root node labeled Tree and one subnode labeled Tree Node 1. You can add more nodes by dragging them to the tree and dropping them either on the root node to create top level nodes or on existing nodes to create subnodes of those nodes. You can also right-click the Tree or any Tree Node and choose Add Tree Node to add a subnode to the node.
    Additionally, you can work with the component in the Outline window, where the component and its child components are available as nodes. You can move a node from level to level easily in the Outline window, so you might want to work there if you are rearranging nodes. You can also add and delete tree nodes in the Outline window, just as in the Visual Designer.
    The Tree component has properties that, among other things, enable you change the root node's displayed text, change the appearance of the text, specify if expanding or collapsing a node requires a trip to the server, and specify whether node selection should automatically open or close the tree. To set the Tree's properties, select the Tree component in your page and use the Tree Component Properties window.
    The following Tutorial ("Using Tree Component") is very useful to learn using Tree components
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/sitemaptree.html
    See Also the Technical Article - "Working with the Tree Component and Tree Node Actions"
    http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/tree_component.html
    Tree Node Component
    You can drag the Tree Node component from the Palette's Basic category to a Tree component or another tree node in the Visual Designer to create a node in a hierarchical tree structure, similar to the tree you see in the Outline window.
    The tree node is created as a subnode of the node on which you drop it. If you drop the node on the tree component itself, a new node is created as a child of the root node. You can see the hierarchical structure clearly in the Outline window, where you can also easily move nodes around and reparent them.
    You can also add a tree node either to a Tree component or to a Tree Node component by right-clicking the component and choosing Add Tree Node.
    A Tree Node component by default is a container for an image and can be used to navigate to another page, submit the current page, or simply open or close the node if the node has child nodes.
    * If you select the Tree Node component's node Tree Node icon in the Outline window, you can edit its properties in the Tree Node Properties window. You can set things like whether or not the Tree Node is expanded by default, the tooltip for the Tree Node, the label for the tree node, and the Tree Node's identifier in your web application.
    * You can use a Tree Node to navigate to another page by setting its url property. You can also use a Tree Node to submit the current page. If the the Tree Node's action property is bound to an action event handler, selecting the node automatically submits the page. If the Tree Node's actionListener property is bound to an action listener, opening or closing the node automatically submits the page.
    - Note: If you use this component to navigate between pages of a portlet, do not use the url property to link to a page. Instead, use the Navigation editor to set up your links to pages. In addition, events related to tree node selection do not work correctly in portlets because the component uses cookies to pass the selected node id back and forth, and cookies are not correctly handled by the portlet container. You cannot handle tree node selection events in portlet projects.
    * If you select the image in the Tree Node, you can see that its icon property is set to TREE_DOCUMENT. If you right-click the image on the page and choose Set Image, you can either change the icon to another one or choose your own image in the Image Customizer dialog box. For more information on working with an image in a tree node, see Image component.
    - Note: The image used in a tree node works best if it is 16x16 or smaller. Larger images can work, but might appear overlapped in the Visual Designer. You can right-click the component and choose Preview in Browser feature to check the appearance of the images.
    Please share your comments, experiences, additional information, questions, feedback, etc. on these components.
    ------------------------------------------------------------------------------- --------------------

    One challenge I had experience was to make the tree
    always expanded on all pages (I placed my tree menu
    in a page fragment so I can just import it in my
    pages).Did you solve this problem. It would be interesting to know what you did.
    To expand a node you call setExpanded on the node. Here is some code from a tutorial that a coworker of mine is working on.
    In the prerender method:
           Integer expandedPersonId = getRequestBean1().getPersonId();
             // If expandedPersonId is null, then we are not coming back
            // from the Trip page. In that case we do not want any trip
            // nodes to be pre-selected (highlighted) due to browser cookies.
            if (expandedPersonId==null) {
                try {
                    HttpServletRequest req =(HttpServletRequest)
                    getExternalContext().getRequest();
                    Cookie[] cookies = req.getCookies();
                    //Check if cookies are set
                    if (cookies != null) {
                        for (int loop =0; loop < cookies.length; loop++) {
                            if (cookies[loop].getName().equals
                                    ("form1:displayTree-hi")) {
                                cookies[loop].setMaxAge(0);
                                HttpServletResponse response =(HttpServletResponse)
                                getExternalContext().getResponse();
                                response.addCookie(cookies[loop]);
                } catch (Exception e) {
                    error("Failure trying to clear highlighting of selected node:" +
                            e.getMessage());
            }                  ... (in a loop for tree nodes)...
                      personNode.setExpanded(newPersonId.equals
                                    (expandedPersonId));In the action method for the nodes:
           // Get the client id of the currently selected tree node
            String clientId = displayTree.getCookieSelectedTreeNode();
            // Extract component id from the client id
            String nodeId = clientId.substring(clientId.lastIndexOf(":")+1);
            // Find the tree node component with the given id
            TreeNode selectedNode =
                    (TreeNode) this.getForm1().findComponentById(nodeId);
            try {
                // Node's id property is composed of "trip" plus the trip id
                // Extract the trip id and save it for the next page
                Integer tripId = Integer.valueOf(selectedNode.getId().substring(4));
                getRequestBean1().setTripId(tripId);
            } catch (Exception e) {
                error("Can't convert node id to Integer: " +
                        selectedNode.getId().substring(4));
                return null;
    It would also be great if I can set the tree
    readonly where the user cannot toggle the expand
    property of the tree (hope this can be added to the
    tree functionality).

  • Action Event Handler on Tree nodes

    I have an actionListener event handler registered on a tree node as follows:
    <af:tree value="#{bindings.SomeViewObj1.treeModel}" var="node" rowSelection="none" id="t1"
    binding="#{EditFormBean.tree1}" displayRow="selected" summary="Tree"
    partialTriggers=":::cb1 :::cb2">
    <f:facet name="nodeStamp">
    <af:panelGroupLayout id="pgl3">
    <af:outputText value="#{node}" id="ot1"/>
    <af:commandImageLink text="E" id="cil3" partialSubmit="true"
    *actionListener="#{EditFormBean.onEdit}"* binding="#{EditFormBean.cmdImageLink}">
    <af:setPropertyListener from="#{node.hiertType.structureDefName}" type="action"
    to="#{viewScope.formView}"/>
    <f:attribute name="node" value="#{node}"/>
    </af:commandImageLink>
    <af:commandImageLink text="A" id="cil1"/>
    <af:commandImageLink text="D" id="cil2"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:tree>
    I have at each node stamp facet a panelGroup Layout that contains the node value and a command Image link. The tree has two hierarchical levels. When I press the command Image link on the first tree noe level, the actioListener method in teh managed bean (EditFormBean.onEdit) gets called. When I press the same commandImage link on the second tree level, the same action listener does not get called. I need to get past this problem before I code the actionListener which needs to set the current row in the iterator based on the key selected on the tree node. I simply have a print statement in the action listener method which shows something when the first level command image link is clicked but does not print anything when the second level command image link is clicked.
    I am using JDeveloper 11.1.2.1.0
    There is also adf faces code around this snippet that uses an af:switcher facea component to display the appropriate form based on the nodee level in which the comman d image link is clicled but it is irrelevant to the problem I am getting.
    Any help on that would be appreciated

    Hi,
    hard to say . Didn't see this before. Can yoiu remove "binding="#{EditFormBean.cmdImageLink}"" from the command link. The tree stamps its children so that it doesn't make sense to keep a handle to the component instance
    Frank

  • How can we set icon to a tree table

    Hi ADF Experts,
    The below is regarding skinning of af:tree table component.
    How can we set icon to a tree table
    Below is the af:tree component. When I run the application I see all the parent and child nodes as folder icon. My question is how can set a file icon to the elements present inside a parent node.
      <af:treeTable value="#{pageFlowScope.MerchandizeTreeModel.productTreeModel}"
                                      id="tt1" var="row"
                                      rowSelection="multiple"
                                      horizontalGridVisible="false"
                                      verticalGridVisible="false">
                          <f:facet name="nodeStamp">
                            <af:column sortable="false" headerText=""
                                       rowHeader="true" id="c11" width="200">
                     <af:panelGroupLayout id="pgl0">
       <af:image source="/images/folder.png" shortDesc="foldericon"
                                id="i1"/>
                      <af:outputText value="#{row.groceryItems}" id="ot11"/>
    </af:panelGroupLayout>
                            </af:column>
                          </f:facet>
                        </af:treeTable>
    Thanks in advance,
    Animesh

    Hi Experts,
    I am having a tree table component in adf. I have set a folder image for the parent node. How can we set a document image for contents inside a parent node.
    Thanks,
    Biswa

  • Zynq Petalinux 2014.4 device tree node for two SD card interfaces?

    I'm using a 3rd party zynq module (Trenz TE0720) for which they provide a .bsp file.  The resulting Petalinux build boots just fine out of the SD card.  But the module also has an on board eMMC memory that should look llike second SD card and it is connected to the zynq's second sdhci controller.  But Linux is unaware of its existence.
    The likely cause is an omission from the device tree script and I would imagine it should be possible to add the missing device tree node.  However all of attempts thus far have failed.  The (very simple) device tree script looks like the below.
    Can anyone point me to a correct SD card device tree node for a Petalinux 2014.4 device tree script?  Also the full present device tree script archive is attached.  Thanks!
    /dts-v1/;
    /include/ "system-conf.dtsi"
    aliases {
    mio = &gpio0;
    /* TE0720-02 uses Spansion Flash */
    &qspi {
    flash0: flash@0 {
    compatible = "spansion,s25fl256s1";
    &usb0 {
    dr_mode = "host";
    &gem0 {
    phy-handle = <&phy0>;
    mdio {
    #address-cells = <1>;
    #size-cells = <0>;
    phy0: phy@0 {
    compatible = "marvell,88e1510";
    device_type = "ethernet-phy";
    reg = <0>;
    /* restore LED settings */
    marvell,reg-init = <0x3 0x10 0x0000 0x0501 0x3 0x11 0x0000 0x4415>;
    &i2c1 {
    /* Real Time Clock RAM is not supported, map as EEPROM */
    eeprom@57 {
    compatible = "at,24c01";
    reg = <0x57>;
    /* Real Time Clock, rtc0 name can used to set time at startup! */
    rtc0: rtc@6F {
    compatible = "isl12022";
    reg = <0x6F>;
    };

    I figured out a solution by myself:
    The Kernel image was not read from the correct position in the QSPI flash. In order to find out which is the correct address to read from, I modified the .bif-file (./build/bootgen.bif)  that was generated by petalinux-package:
    the_ROM_image:
    [bootloader] ./images/linux/zynq_fsbl.elf
    ./images/linux/u-boot.elf
    ./images/linux/image.ub
    Then I executed:
    bootgen -image newbif.bif -o test.bin -debug -w
    The -debug is important here. This gave me:
    *** After Link
    -- Dump of Binary cache ----
    00000000 Len: 000008a0 Res: 00000000 "BootHeader"
    000008c0 Len: 00000014 Res: 00000000 "ImageHeaderTable"
    00000900 Len: 00000024 Res: 00000000 "ImageHeader zynq_fsbl.elf"
    00000940 Len: 00000020 Res: 00000000 "ImageHeader u-boot.elf"
    00000980 Len: 00000020 Res: 00000300 "ImageHeader image.ub"
    00000c80 Len: 00000040 Res: 00000000 "PartitionHeader zynq_fsbl.elf.0"
    00000cc0 Len: 00000040 Res: 00000000 "PartitionHeader u-boot.elf.0"
    00000d00 Len: 00000040 Res: 00000000 "PartitionHeader image.ub.0"
    00000d40 Len: 00000040 Res: 000009c0 "PartitionHeader Null"
    00001700 Len: 0001800c Res: 00000000 "zynq_fsbl.elf.0"
    00019740 Len: 00043054 Res: 00000000 "u-boot.elf.0"
    0005c7c0 Len: 00691ac0 Res: 00000000 "image.ub.0"
    -- End of Dump
    Here we see that the Kernel image is to be found at an offset of 0x0005c7c0 and has a length of 0x00691ac0.
    The image can therefore be booted in u-boot by doing:
    U-Boot-PetaLinux> sf read $netstart 0005c7c0 00691ac0
    SF: 6888128 bytes @ 0x5c7c0 Read: OK
    U-Boot-PetaLinux> bootm $netstart
    This loads and successfully boots the kernel, finally presenting me a login prompt.
    Hope this helps someone in the future. 

  • Commandtoolbarbutton enabling/disabling based on tree node selection

    i am using the tree tag to generate a set of nodes and every node is a command link.... i have a set of commandtoolbarbuttons on top of the tree... the functionality i am trying to obtain is on press of the tree node( i.e, command link ) the commantoolbarbuttons are enabled or disabled.. on press of link i am able to get the tree node selected in the backing bean, and also i am setting some variables for the "disabled" attribute of commandtoolbarbutton. The problem i am facing here is i have a partialtrigger attribute in the commandtoolbarbutton pointing to the commandlink id. But the partial trigger is unable to identify the command link id outside the tree. And i cannot put the commandtoolbar buttons inside the tree...
    Can anyone please let me know how can i resolve this?? or is there anyother approach??
    The source code is as mentioned below...
    <af:panelGroupLayout layout="horizontal" halign="right">
    <f:facet name="separator">
    <af:spacer width="5px"/>
    </f:facet>
    <af:toolbox id="mainTab_box" >
    <af:toolbar id="mainTab_bar">
    <af:spacer width="80"/>
    <af:commandToolbarButton icon="/resources/images/new_ena.png" partialSubmit="true"
    shortDesc="New" id="ctb1_mainTab" disabled="#{nodeSelectionHandler.createToolbar}" partialTriggers="cl1"/>
    <af:commandToolbarButton icon="/resources/images/update_ena.png" partialSubmit="true"
    shortDesc="Update" id="ctb2_mainTab" disabled="#{nodeSelectionHandler.editToolbar}" partialTriggers="cl1"/>
    <af:commandToolbarButton icon="/resources/images/delete_ena.png" partialSubmit="true"
    shortDesc="Delete" id="ctb3_mainTab" disabled="#{nodeSelectionHandler.cancelToolbar}" partialTriggers="cl1"/>
    <af:commandToolbarButton icon="/resources/images/importIcon.png" partialSubmit="true"
    shortDesc="Import" id="ctb4_mainTab" disabled="#{nodeSelectionHandler.exportToolbar}" partialTriggers="cl1"/>
    <af:commandToolbarButton icon="/resources/images/exportIcon.png" partialSubmit="true"
    shortDesc="Export" id="ctb5_mainTab" disabled="#{nodeSelectionHandler.importToolbar}" partialTriggers="cl1"/>
    </af:toolbar>
    </af:toolbox>
    </af:panelGroupLayout>
    <af:panelGroupLayout layout="scroll">
    <af:tree var="node"
    value="#{browserTreeModel}"
    id="browsertree" inlineStyle="min-width:200px;min-height:400px;width:100%;height:100%"
    rowSelection="single" clientComponent="true" contentDelivery="immediate"
    >
    <f:facet name="nodeStamp">
    <af:panelGroupLayout id="pgl10">
    <af:image id="nodeIcon"
    inlineStyle="margin-right:3px; vertical-align:middle; height:16px; width:16px;"
    shortDesc="directory icon" rendered="#{node.destination != null}"
    source="#{node.destination}"/>
    <af:commandLink text="#{node.text}"
    id="cl1"
    disabled="false" partialSubmit="true"
    actionListener="#{nodeSelectionHandler.selectionPerformed}" >
    <f:attribute name="nodeId" value="#{node.id}"/>
    <f:attribute name="operation" value="#{node.associatedOperation}"/>
    </af:commandLink>
    </af:panelGroupLayout>
    </f:facet>
    </af:tree>
    </af:panelGroupLayout>

    With apologies, you're not aware of ELUtils class devised by Steve Muench:
    package view;
    import javax.faces.context.FacesContext;
    import javax.faces.el.MethodBinding;
    import javax.faces.el.ValueBinding;
    public class ELUtils {
      public static boolean test(String booleanExpr) {
        return Boolean.TRUE.equals(get(booleanExpr));
      public static String getAsStringWithDefault(String expr, String defaultExpr) {
        return (String)getWithDefault(expr, defaultExpr);
      public static String getAsString(String expr) {
        return (String)get(expr);
      public static Integer getAsInteger(String expr) {
        return (Integer)get(expr);
      public static Object get(String expr) {
        FacesContext fc = FacesContext.getCurrentInstance();
        ValueBinding vb = fc.getApplication().createValueBinding(expr);
        return vb.getValue(fc);
      public static Object getWithDefault(String expr, String defaultExpr) {
        Object exprVal = get(expr);
        return exprVal != null ? exprVal : get(defaultExpr);
      public static void set(String expr, String value) {
        Object valToSet = value;
        if (isELExpr(value)) {
          valToSet = get(value);
        set(expr, valToSet);
      public static void set(String expr, Object value) {
        FacesContext fc = FacesContext.getCurrentInstance();
        ValueBinding vb = fc.getApplication().createValueBinding(expr);
        vb.setValue(fc, value);
      private static boolean isELExpr(Object o) {
        if (o instanceof String) {
          String str = (String)o;
          str.trim();
          return str.startsWith("#{") && str.endsWith("}");
        return false;
      public static Object invokeMethod(String expr, Class[] paramTypes, Object[] params) {
        FacesContext fc = FacesContext.getCurrentInstance();
        MethodBinding mb = fc.getApplication().createMethodBinding(expr, paramTypes);
        return mb.invoke(fc, params);
      public static Object invokeMethod(String expr, Class paramType, Object param) {
        return invokeMethod(expr, new Class[] { paramType }, new Object[] { param });
    }Try that.
    CM.

  • Tree node selection handler...

    Hi i am having a tree of nodes..
    I am looking for a functionality where on the click of the tree node ( i.e, on just clicking or selecting the disabled command link ), the af:commandToolbarButton icons on the toolbar are enabled or disabled. Can anyone please let me know how can i do this??
    please find the tree code as mentioned below...
    <af:tree var="node"
    value="#{tree}"
    id="brtree" inlineStyle="min-width:200px;min-height:400px;width:100%;height:100%"
    rowSelection="single" clientComponent="true" contentDelivery="immediate">
    <f:facet name="nodeStamp">
    <af:panelGroupLayout id="pgl10">
    <af:image id="nodeIcon"
    inlineStyle="margin-right:3px; vertical-align:middle; height:16px; width:16px;"
    shortDesc="directory icon" rendered="#{node.destination != null}"
    source="#{node.destination}"/>
    <af:commandLink text="#{node.text}"
    id="cl1"
    disabled="#{not node.renderAsLink}" partialSubmit="true"
    actionListener="#{nodeSelectionHandler.selectionPerformed}">
    <f:attribute name="nodeId" value="#{node.id}"/>
    <f:attribute name="operation" value="#{node.associatedOperation}"/>
    </af:commandLink>
    </af:panelGroupLayout>
    </f:facet>
    </af:tree>

    Try this.
    Change your tree as follows:
    <af:tree id="myTree" value="#{bindings.NodesViewTree.treeModel}" selectionListener="#{treeBean.onTreeSelection}"...
    (Assuming your tree's binding is called "NodesViewTree")
    ...note the use of the selectionListener calling our bean's onTreeSelection method.
    In your bean:
      boolean toolbarItem1Enabled = true; // also create the appropriate getter/setter
      boolean toolbarItem2Enabled = true; // also create the appropriate getter/setter
      public void onTreeSelection(SelectionEvent selectionEvent) {
        ELUtils.invokeMethod("#{bindings.NodesViewTree.treeModel.makeCurrent}", SelectionEvent.class, selectionEvent);
        FacesCtrlHierBinding hierBinding = (FacesCtrlHierBinding)AdfUtils.findCtrlBinding("NodesViewTree");   
        RichTree richTree = (RichTree)selectionEvent.getSource();
        RowKeySet rowKeySet = richTree.getSelectedRowKeys(); 
        Object key = rowKeySet.iterator().next();
        richTree.setRowKey(key);
        JUCtrlHierNodeBinding node = (JUCtrlHierNodeBinding)richTree.getRowData();
        String someValue = (String)node.getAttribute("someValue"); // assuming String attribute
        if (/* make some decision about enabling/disabling fields based on selected node's someValue */) {
          toolbarItem1Enabled = false;
          toolbarItem2Enabled = false;
        } else {
          toolbarItem1Enabled = false;
          toolbarItem2Enabled = false;
    }Then in your command items modify them as follows:
    <af:commandMenuItem disabled="#{treeBean.toolbarItem1Enabled}" partialTriggers="myTree"}>
    <af:commandMenuItem disabled="#{treeBean.toolbarItem2Enabled}" partialTriggers="myTree"}>
    Please note I haven't tested the exact solution above, I've just cut and copied a bunch of code in from different sources. However it should give you the thread on a possible approach.
    Cheers,
    CM.

  • How to add custom ADF Tree Node icon

    Hi All,
    i am using below code in style sheet to set the tree node icon,
    af|tree::node-icon:nodetype-collapsed
    but i don't have any idea how to add getnodetype() method in the node class, (I am using Jdeveloper 11.1.1.2.0). please suggest me the steps to achive it.
    Thanks,
    Mahesh

    i did as you suggested, but i am not getting any image, below is my source
    <nodeDefinition DefName="com.mahesh.SSCExplorer.model.ROview.OrdrHdrVO"
    Name="OrdrHdr20"
    TargetIterator="${bindings.OrdrHdr2Iterator}"
    ClosedIcon="/Nuvola_filesystems_folder.png"
    OpenIcon="/Nuvola_filesystems_folder.png"
    Icon="/Nuvola_filesystems_folder.png">
    please suggest is there any other settings i need to do.
    Thanks,
    Mahesh

Maybe you are looking for

  • IBook wear and tear

    Hi everyone. I'm writing this as I've got an iBook that is approaching its third birthday this year, and while there doesn't seem to be any major problem with my machine, there are a lot of minor things going wrong with it that concern me. 1. Unless

  • IBook G3 & iWork

    I am starting college on Monday and I have a gliding instructor job coming up in the summer. As a result, I have been looking at getting an iBook to make my time more productive and portable. I want it to run Panther and need it to run Microsoft Offi

  • Need to design the database design to support Chinese language

    Hi,   can anybody give me suggusstion to redesign the SQL Server 2008 R2 database with chinese language support for existing database with varchar datatype (Non- Unicode Data Type) Thanks Pari

  • Order as direct material in catalog, with contract

    Hi, We are using SRM 5.5 and we have an issue concerning direct materials in a SC. In the shopping cart via a catalog, when you choose "Order as direct material" function for an item on the 'Basic data' detail screen, the information about the contra

  • Roles in the database

    Hi Team ! I need to find out the Roles in the database which contains only Read only Permission on the Objects . Could you please help me out . Thanks in advance . Regards, Augustine