Change state nodes of af:menuTree by oher component ( h:commandButton )

I have a page with <af:menuTree> and <h:commandButton> components.
I want a action in a <h:commandButton for the <af:menuTree> back to the initial state (none expanded nodes).
By other words, a action that changes the nodes states (to closed nodes), by other component (for example a <h:commandButton) .
thanks,
Sérgio Morais

Hello
I hope that JSF is made more robust in the future.
I would like to extend UIData and create my own custom components and I would like that creating custom components would be easier. Now I am lost. Should I put all UIData TLD-attributes to custom extended UIData TLD-description or not and what else to do... Does attribute descriptions become inherited in TLD? Obviously not? It seems that there are not straight and honest 'how to' for extending JSF-components. At least I am so far out of luck with extending... and even in using custom attributes in custom renderer. Why to put attributes to tag and to component? I think I have seen this in some examples.
And then there are properties. I have not yet learned what is the difference between attributes and properties... and when to use which... but I guess I have to learn this too.
What comes to IFrames, I think that nothing MS IE -specifc should be put into JSF. Mozilla and Firefox etc. browsers are quite popular, especially in Java community. All ready made standard components of course would be welcome, and I am looking forward to get to extend them for customization.

Similar Messages

  • Changing state of application from within a custom component

    Hello, I have several custom components all of which are included in the parent application.
    When I try to change state from a custom component, I get an error  saying "undefined state: state name". How do I change the state of the  application from within a custom component ? All the states are defined in the parent application.

    @linrsvp,
    If you are using Flex3 try Application.application.currentState = "somestate";
    If you are using Flex4 try FlexGlobas.topLevelApplication.currentState = "somestate";
    Don't forget to import the corresponding namespaces for the above.
    Thanks,
    Bhasker

  • Changing states from within a component

    Let's say that I have a TileList that is rendering data in a
    VBox. Eventually the TileList fills up and starts scrolling. I want
    to change states when clicking on item in the TileList.
    I don't want to place the click-attribute in the TileList,
    because it will change states when I am scrolling the list without
    actually selecting anything.
    I want to say click="currentState='state2'" inside the VBox,
    but that does not work because state2 is at the root level, and I
    don't know how to get to the root-level (in lack of a better word)
    from withing the component.
    This is not the proper syntax, so misunderstand me the right
    way here... Is there an equivallence to
    click="currentState='_root.state2'" in mxml?
    Thanks for any suggestions or best practices. I want the easy
    way out.
    This is the general structure...
    <mx:Application>
    <mx:states>
    <mx:State id="state1"/>
    <mx:State id="state2"/>
    <mx:State id="state3"/>
    </mx:states>
    <mx:TileList dataprovider="{...}">
    <mx:itemRenderer>
    <mx:component>
    <mx:VBox id="ClickThisBoxToChangeStates">
    <mx:Image/>
    <mx:Label/>
    </mx:Vbox>
    </mx:component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

    Your assumption is right.
    It doesn't work because there is no state2-state defined
    within the mx:component.
    In the documentation about changing states it says that I can
    go from application level and change states within a component;
    like this: click="currentState='mycomponent.anotherstate'" but not
    how I can change a state at application level from within a state.
    When I try, it says (at runtime) that the state is not defined.
    So I don't know why <mx:VBox
    click="currentState='state2'"/> doesn't work.
    I apprechiate your expertese a lot.

  • How to change the node's icon in a tree when the node collapse or expand?

    how to change the node's icon in a tree when the node collapse or expand?

    Hi,
    You may need to use custom skin for that.
    -Arun

  • How to change state of a constraint from DEFERABLE to IMMEDIATE?

    Hi,
    I am runnig 10gR2 and would like to change state of a constraint from
    DEFERABLE to IMMEDIATE without recreating it.
    The change is working at the session level with
    SET CONSTRAINT <constraint name> IMMEDIATE;
    But this is not visible for other users.
    So my question is, if there is any other way to do it, so the change would be visible for every user.
    Here is what I have done:
    CREATE TABLE TEST_TBL
    ID NUMBER
    ALTER TABLE TEST_TBL ADD CONSTRAINT pk_test_tbl PRIMARY KEY(ID)
    INITIALLY DEFERRED DEFERRABLE;
    SQL> INSERT INTO test_tbl VALUES(1);
    1 row created.
    SQL> INSERT INTO test_tbl VALUES(1);
    1 row created.
    SQL> INSERT INTO test_tbl VALUES(1);
    1 row created.
    SQL> COMMIT;
    COMMIT
    ERROR at line 1:
    ORA-02091: transaction rolled back
    ORA-00001: unique constraint (TEST_SCHEMA.PK_TEST_TBL) violated
    The constraint is checked only at commit,
    To change this:
    SQL> SET CONSTRAINT pk_test_tbl IMMEDIATE;
    Constraint set.
    SQL> INSERT INTO test_tbl VALUES(1);
    1 row created.
    SQL> INSERT INTO test_tbl VALUES(1);
    INSERT INTO test_tbl VALUES(1)
    ERROR at line 1:
    ORA-00001: unique constraint (TEST_SCHEMA.PK_TEST_TBL) violated
    But if I would connect with user B, I would be able to do multiple inserts with value 1.
    Thanks

    I am runnig 10gR2 and would like to change state of a constraint from
    DEFERABLE to IMMEDIATE without recreating it.From Oracle Constraints:
    Note: A non-deferrable constraint is generally policed by a unique index (a unique index is created
    unless a suitable index already exists). A deferrable constraint must be policed by a non-unique index
    (as it's possible for a point of time during a transaction for duplicate values to exist). This is why
    it is not possible to alter a constraint from non-deferrable to deferrable. Doing so would require
    Oracle to drop and recreate the index.
    A PK enforces uniqueness procedurally without relying on a unique index. The main advantage
    of a non-unique index is the constraint can be disabled and re-enabled without the index being dropped and recreated.

  • Multiple STATEMENT nodes in target structure for JDBC adapter

    Hi All,
    I have a file to JDBC scenario . At the receiver side we need to update two tables simultaneously .
    So in the target structure for JDBC , is it possible to have two STATEMENT nodes , so that 2 tables can be updated simultaneously.
    Please help.
    Thanks & Regards,
    Loveena.

    Hi,
    U can do tht..please see below link..
    http://help.sap.com/saphelp_nw04/Helpdata/EN/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    Regards,
    Manisha

  • PSD Rollover Button with image in front stops button from changing state

    I have a wide PSD button that changes state when rolled over. I would like to place a PNG image with transparency in some areas over the top of it so that the rollover button shows through the transparent areas of the PNG.
    How can you get it to do the rollover effect when the user mouses over the bit of the button that the image is in front of? Is ther a way of making the PNG 'invisible' to the mouse?
    I know I could redesign the button so that it includes the image but I'm trying to keep file sizes and load times to a minimum, I use this button a lot on my website with a different on each, and having that number of individual buttons would result in a bloated, slow-loading website.

    Hi Abhishek
    Thanks for your reply. I was able to achieve the effect I wanted by having the PNG and the PSD Button with the same link and then grouping them. This means I can mouse over the PNG and still get the PSD rollover effect, which is perfect.
    However I also have another similar problem. I have some different PSD Rollover Buttons which have some text in front of them (basically it's the button label). On some of these buttons when you roll over the text it prevents the rollover state of the button, and on other buttons the rollover effect occurs as it should, and there doesn't appear to be any consistency about which does what. Grouping or ungrouping doesn't appear to make a difference. Can you help?

  • Changing a Node in a DOM

    Hi,
    I was wondering if it is possible to Change a Node in a Document with a another node e.g. A Node is a copy, but has a different Value.
    So effectively updating th Node and the Document.
    Cheers,
    IJ...

    Do you need replaceChild?
         Node parent = node.getParentNode();
         parent.replaceChild(el, node);

  • Changing JTree node text results in "..."

    I'm working with a JTree, and I have a problem if I change the text displayed on a node. After changing the node, I call nodeChanged( node ) on the tree model.
    What happens is that if the new text on the node is longer than the previous one, the text is cut short and the end replaced by "...". E.g. if the old text was "foo" and the new is "foobar", it turns out as "foo...". This happens even if there is more than enough space in the tree to hold the complete new name, e.g other nodes in the same column with longer names.
    I guess somehow, the tree doesn't properly correct the layout of the cell to accomodate the longer text. I feel it is a bug, since I use the proper calls on the tree model to notify of the change.

    nodeStructureChanged() will give the exact same behavior.
    A solution is to use SwingUtilities.invokeLater().
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){model.nodeChanged(node);}
        });

  • Change States in component from main view

    The scenario like this:
    The main view includes many component views. On my main view
    there have a radio button to choice different role type, for
    example: admin and user. For different role have different views.
    But they don’t have big difference.
    My question is how could I implement my component view change
    states when I click button on the main view? I don’t want do
    change states in main view since I need create two component views
    for different roles.
    Thanks.

    Consider adding a second state to your application, even if
    you don't put anything into it.
    In each of the components that should change state when the
    role is changed, add a listener on the application for the state
    change event ("currentStateChange"). When this event is fired,
    query the application for its current state:
    var appState:String = (Application.application as
    Application).currentState;
    Use that to change the state of the component. Remember
    you'll also need to do this when your component is first
    created.

  • Change state option in SM51

    Hello,
    I would like to know if activate/deactivate option in SM51 (see below)
    menu--->edit -
    >change state -
    >activate/deactivate
    is used for activating and deactivating servers? If not what is its functionality?
    mm

    Hi,
    There are the following application server states -
    initial  - The application server has logged on to the message server. When the server is in this state, it cannot be accessed.
    starting  - The application server starts the work process and initializes all required services. Requests cannot be processed in this phase.
    active - This is the "normal" state of the application server. It receives and processes requests, and creates and sends requests to other servers.
    passive - In this state, the application server can continue to process received requests or create requests itself. However, no new requests should be sent to the server. The purpose of this state is to "logically" remove from the system a server that has to be stopped during productive operation. The server finishes processing its existing requests, but does not accept any new requests and can be terminated without having to interrupt any relevant requests such as updates or batch jobs. This state can be changed to the "active" state.
    shutdown - The application server is in the shutdown phase, that is, it will be terminated. This state is similar to the "passive" state, but cannot be changed to the "active" state. This state or phase ends with the termination of the server.
    stop - The application server has terminated the connection to the message server and can no longer be accessed.
    Use
    The server functions are used to deactivate or close down SAP servers without jeopardizing the requests the server is currently processing. They enable the server to complete all the requests it is currently processing without accepting any new requests.
    Integration
    These functions allow the state of an SAP server to be changed. The possible server states are described under SAP Application Server States.
    Prerequisites
    The functions in question are system administration functions that may only be used when a valid username and password are given.
    Features
    The following functions can be used on the selected servers.
    Hard-terminate server
    A hard termination is equivalent to a signal 2 on the operating system level. The dispatcher and all its work processes are terminated; requests in the queue are ignored; and requests that are currently being processed are terminated.
    Soft-terminate server
    All services that the application server provides (updates, batch, and so on) are no longer available, but all requests that are still in the queue are completed by the work processes. Once all requests are completed, the application server terminates.
    The server state is then shutdown.
    The activate function can no longer be used to activate the server.
    Close connection
    In this case, the connection between the selected server and the message server is terminated. No more requests from other application servers can reach the server.
    This function tests the connection to the message server, because normally the connection has to be re-established.
    Deactivate
    This has the same effect as soft terminate, except that the server does not shut down when it has finished processing all requests. Instead, it enters the passive state and can be re-started at any time by means of the activate function.
    Activate
    This is used to re-activate servers in the passive state. The state then returns to active.
    Activities
    In the initial screen of the Message Server Monitor (transaction SMMS), choose Go To -> Expert Functions -> Server.
    Hope this would help you in understanding the concepts.
    Please award points if useful.
    Regards,
    Sree

  • Difference between At new and on change statement?

    What is the difference between at new and on change statement? Please explain with an example.

    hi
    on change of differs from at new in the following respects:
    It can be used in any loop construct, not just loop at. For example, it can be used within select and endselect, do and enddo, or while and endwhile, as well as inside get events.
    A single on change of can be triggered by a change within one or more fields named after of and separated by or. These fields can be elementary fields or field strings. If you are within a loop, these fields do not have to belong to the loop.
    When used within a loop, a change in a field to the left of the control level does not trigger a control break.
    When used within a loop, fields to the right still contain their original values; they are not changed to contain zeros or asterisks.
    You can use else between on change of and endon.
    You can use it with loop at it where . . ..
    You can use sum with on change of. It sums all numeric fields except the one(s) named after of.
    Any values changed within on change of remain changed after endon. The contents of the header line are not restored as they are for at and endat.
    REGARDS
    PRASANTH

  • Change SIA node name after restaure

    hi,
    we have backup an XI31 system (on server named AAA) and restaure it on another windows server ( named BBB).
    on CCM the SIA name is SIA.AAA
    on CMC the node for each server XI is AAA
    the pid for each server is AAA.server.pid
    how to change this node name ?
    recreate SIA ?
    thank's

    Hi
    you have two options:
    1) In the CCM create a new SIA with the default servers (use other CMS and SIA ports than the defaults) and point the CMS to the old repository. hen finished just remove the old SIA. Drawback: you have to reconfigure your server settings.
    2) Try to clone the old servers in the CMC (I assume you already have a CMS running on the new node) and when you through activate the new servers and remove the old ones. Do not forget to deactivate the old SIA in the CCM.
    Regards,
    Stratos

  • Changing Certain Node Icons

    I can't seem to figure out how to change certain node icons in a JTree due to a 3 letter string. For example 2 nodes one saying "Intro" the other say "Edit - SEC" - the one with SEC has a different icon to "Intro"
    MyRenderer class, here the code which is used to check the string of the node......
    if(leaf && isSecuredFile(value)) {
    setLeafIcon(leafSecuredIcon);
    setToolTipText("This file is Secured Access Only");
    else {
    setToolTipText(null);
    return this;
    protected boolean isSecuredFile(Object value) {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
    NodeRecord nodeInfo = (NodeRecord)(node.getUserObject());
    String nodeTitle = nodeInfo.NodeRecord;
    if(nodeTitle.indexOf("SEC") >= 0) {
    return true;
    return false;
    }// MyRenderer class
    I tried the above piece of code, and it compiles with no errors but when I try to run the applet it comes up not initialised with the following....
    java.lang.NoClassDefFoundError: MyRenderer
    at firstPanel.<init>(firstPanel.java:99)
    at JNavigator.jInit(JNavigator.java:55)
    at JNavigator.init(JNavigator.java:40)
    at sun.applet.AppletPanel.run(AppletPanel.java:344)
    at java.lang.Thread.run(Thread.java:484)
    However if I take out this code it works fine but I need to be able to assign different icons depending on the node title string. Therefore I need help.

    here's the whole class, if thats any help...
    public class MyRenderer extends DefaultTreeCellRenderer {
    ImageIcon leafIcon;
    ImageIcon leafSecuredIcon;
    public MyRenderer() {
    leafIcon = new ImageIcon("Leaf.gif");
    leafSecuredIcon = new ImageIcon("LeafSecured.gif");
    public Component getTreeCellRendererComponent(JTree tree, Object val, boolean sel, boolean expand, boolean leaf, int row, boolean hasFocus) {
    super.getTreeCellRendererComponent(tree, val, sel, expand, leaf, row, hasFocus);
    // sets Icons
    setLeafIcon(leafIcon);
    setClosedIcon(new ImageIcon("Folder95C.gif"));
    setOpenIcon(new ImageIcon("Folder95O.gif"));
    // set Expansion icons to + -
    ComponentUI treeUI = tree.getUI();
    if(treeUI instanceof BasicTreeUI) {
    ((BasicTreeUI)treeUI).setExpandedIcon(new ImageIcon("minus.gif"));
    ((BasicTreeUI)treeUI).setCollapsedIcon(new ImageIcon("plus.gif"));
    // decides who icon to use
    if(leaf && isSecuredFile(value)) {
    setLeafIcon(leafSecuredIcon);
    setToolTipText("This file is Secured Access Only");
    else {
    setToolTipText(null);
    return this;
    protected boolean isSecuredFile(Object value) {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
    NodeRecord nodeInfo = (NodeRecord)(node.getUserObject());
    String nodeTitle = nodeInfo.NodeRecord;
    if(nodeTitle.indexOf("DOM") >= 0) {
    return true;
    return false;
    }

  • On change statement problem

    Hi All,
    I am craeting program for automatic sending mail..... in that program i have write body part with header and line item.....
    present my output is like below:
    Controling Area | Cost center | Company Code
    5000                | 159040        | 040
    Cost element    | Description                       | Allocation change
    0000600100      | SALARIES                       | No
    6475FC            |  647500 AIGOSS              | No
    Controling Area | Cost center | Company Code
    5000            | 361001      | 001
    Cost element    | Description                    | Allocation change
    0000600100      | SALARIES                       | No
    Controling Area | Cost center | Company Code
    5000            | 361040      | 040
    Cost element    | Description                       | Allocation change
    0000600100      | SALARIES                       | No
    6475FC            |  647500 AIGOSS              | No
    But i want space between each cost center
    when my cost center(ex: 159040 ,361001,361004) l want space
    like below i want output:
    Controling Area | Cost center | Company Code
    5000                | 159040        | 040
    Cost element    | Description                       | Allocation change
    0000600100      | SALARIES                       | No
    6475FC            |  647500 AIGOSS              | No
    Controling Area | Cost center | Company Code
    5000            | 361001      | 001
    Cost element    | Description                    | Allocation change
    0000600100      | SALARIES                       | No
    Controling Area | Cost center | Company Code
    5000            | 361040      | 040
    Cost element    | Description                       | Allocation change
    0000600100      | SALARIES                       | No
    6475FC            |  647500 AIGOSS              | No
    I use on change statement also
    like below:
    on change of costcenter
          space
    endof.
    but very first time its left the space for each costcenter...
    Please help me..... give me some idea
    thanks
    Jigar

    Hi Vijay,
    I used at new costcenter statement its working fine but for one user, i have to send many user in one time. in my loop so many email id is there, for first user its working fine its left the space...... between each cost center but for other user its not working i check in debug mode also every time its not entered in space statement
    my code is below:
    loop at emailid
        loop at all costcenter where emailid = email
           at new costcenter
               space
            endat.
        endloop.
    endloop.
    its working for first email id
    its not working for rest of user id
    can i change anything here?
    Please guide me
    Thanks
    Jigar

Maybe you are looking for