Remove a Dynamically Added Child Symbol

I am trying to check if a symbol exists, and if it does remove it. Otherwise, add it. Since this is being added to a bettun, the goal is that an object shows up when you click and goes away when you click again.
My current code is below. Help?!
var chatPanel = sym.getSymbol("chat_wrap").getChildSymbols;
if (chatPanel.length > 0) {
chatPanel[0].deleteSymbol();
else {
    // handle the error however you want here, or fail silently
    sym.createChildSymbol("chat_panel", "chat_wrap");
    console.log("symbol added")

Hi Phil and thanks for your answer.
I have got my own cellrenderer but i do handle selected nodes different..
Here the code in the paint method of my treecellrenderer:
public void paint(Graphics g)
     super.paint( g );
     Icon currentIcon = getIcon();
     TreeModelNode node = getCurrentUserObject();
     //Set color for node, selected or not.
     if(selected)
          g.setColor( new Color(0,0,132) );
          setForeground( Color.white );
     else
          g.setColor( getParent().getBackground() );
     //Get textarea to paint.     
     if( currentIcon != null && getText() != null )
          int offset = ( currentIcon.getIconWidth() + getIconTextGap() );
          g.fillRect( offset, 0, getWidth() - offset +1 ,getHeight()-1 );
     else
          g.fillRect( 0, 0, getWidth() +1, getHeight()-1 );
}

Similar Messages

  • How to Position of a dynamically created child symbol.

    Hello Everyone,
    I created symbols instances on the stage by
    for(alpha = 0; alpha < 5; alpha++)
        sym.createChildSymbol("rect", "Stage");
    Now I wanted to set the position of each symbol  - The probelm is I don't know the names of the symbols instances that has been created. so I tried the following
    childSymbols = sym.getChildSymbols();
    for(k = 0; k < 5; k++)
        childSymbols[k].css({"position":"relative","left":k*50});
    it did not position the child symbols where i need it to be..
    HOWEVER, when I tried to apply css to an element inside the symbol it worked.
    for(k = 0; k < 5; k++)
        childSymbols[k].$("Rectangle2").css({"position":"relative","left":k*50});
    Please can anyone help..

    y = 0;
    x = 30;
    $.getJSON('slides.json', function(data){
                     for(alpha = 0; alpha < 5; alpha++){
                         var s = sym.createChildSymbol("rect", "Stage");
                         s.getSymbolElement().css({
                                          "top": x+"px",
                                          "position":"absolute",
                                          "right": y*315+20+"px"
                        x+=100;
                      // y+=100;
                              }//for

  • Adding and removing tabs dynamically as in explorer

    adding and removing tabs dynamically as in explorer or firefox

    Think about how many translations are required to move your avatar, then think how many translations are required to move everything else in the entire world. Depending on whether there is more to translate in your avatar or in the rest of the world, you have your solution.
    Not knowing how your system works I can't really suggest anything further but could the collision avoidance be interacting with everything in the world as well? That would increase the workload somewhat.

  • Removing the dynamic attributes from view context

    Hi,
    I have added an attribute dynamically using the following line of code in wdDoModifyView():
    wdThis.wdGetContext().getContext().getRootNodeInfo ().addAttribute(<attributename>, <datatype>);
    Now I want to remove the dynamically created attribute from the context.
    Pls suggest me in this regard.
    Regards,
    Ramesh.

    Hi Ramesh,
    You can use the following code to remove the attribute dynamically:
    Iterator itr = wdContext.node<NodeName>().getNodeInfo().iterateAttributes();
    <i>// If the node where you are making these attributes is a context node then just do:</i>
    // <b>wdContext.getNodeInfo().iterateAttributes()</b>, <i>for iterator</i>
    while(itr.hasNext()){
         IWDAttributeInfo attrInfo = (IWDAttributeInfo)itr.next();
         attrInfo.remove();
    This will solve your problem.
    Regards
    Pravesh
    PS: Please consider rewarding points if helpful and solved.

  • Dynamically adding a column to a jtable - simple & urgent

    I am new to using JTables.
    I have read the tutorial and looked at several examples, but I am still confused as to how to add/remove columns and how to add rows to the table.
    I want to have a totally dynamic table which will allow me to add/remove columns and to add rows.
    The table gets the data to be displayed (and the column header values) from an outside object. I thought about writing my own table model.
    Here is the code for my simple table model:
    import javax.swing.table.*;
    import java.util.Vector;
    public class MyTableModel extends AbstractTableModel{
       private Vector columnHeaders;
       private Vector data;
       // simple constructor
       public MyTableModel() {
          columnHeaders = new Vector();
          data = new Vector();  // data is a vector of vectors
       public int getColumnCount() {
          return columnHeaders.size();
       public int getRowCount() {
          if (data.size() == 0) {
              return 0;
          Vector columnData = (Vector)data.elementAt(0);
          return columnData.size();
       public Object getValueAt(int row, int column) {
          Vector columnData = (Vector)data.elementAt(column);
          return columnData.elementAt(row);
       // the method I call for dynamically adding a new empty column
       public void addNewEmptyColumn(String value) {
           columnHeaders.add(value);
           fireTableStructureChanged();
    }Here is how I use the table model with my table
    import javax.swing.*;
    public class Demo extends JFrame{
        private JTable table;
        public Demo() {
            super("test");
            table = new JTable(new MyTableModel());
            getContentPane().add(table);
            pack();
            show();
        public void addColumn(String value) {
            MyTableModel model = (MyTableModel)table.getModel();
            model.addNewEmptyColumn(value);
        public static void main(String[] args) {
            Demo demo = new Demo();
            // here I am trying to add columns...
            demo.addColumn("one");
            demo.addColumn("two");
    }I try to add columns, but nothing happens!!!
    What am I doing wrong?
    I would appreciate if someone who take himself/herslef to be a JTable expert could give me his/her e-mail and this way I won't bother the rest of the world with my stupid JTable questions...
    Sincerely
    Nir

    I have another question.
    What if I want to render the table headers in a certain way.
    I would like to use:
    TableColumn's setHeaderRenderer(TableCellRenderer headerRenderer).
    But in order to do it, I need to get a TableColumn.
    How do I get it from the model?
    I thought about subclassing JTable and overriding:
    public void tableChanged(TableModelEvent e)that function is called everytime I invoke fireTableStructureChanged().
    In that function, I am assuming that a column has been added, however, when I query for JTable's getColumnCount(), I keep getting 0!

  • Why data are not getting poulated in dynamically added tab in a tab navigator???

    Hi All,
    I am facing a very strange problem and need you expert opinion on this. Ok so the problem goes like this:
    In my application i have a tab navigator where i have 2 fixed tabs say tab A and tab B. In tab B I have a data grid where All the user name are getting populated. Once the user clicks on any datagrid row i am dynamically adding a new tab based on username , so if in my datagrid u1,u2 and u3 are getting displayed then once you clik on u1 a new tab called u1 is getting displayed. Code for this goes like this:
    var vbox1: VBox= new VBox();
    box1.label=mydatagrid.selectedItem.uName;
    var sde:* = new searchDetails();
    vbox1.addChild(sde);
    myTabnavigator.addChild(vBox1);
    Application.application.searchdetails.displayall();
    I have created a component called searchDetails where i have designed the page wit various fields for this tab.This also has a method called displayall() which is populating the data in all fields using php an my sql where i have designed the page wit various fields for this tab.
    New tab is getting displayed perfectly. My problem is once the tab is getting displayed fields are not getting populated with data.
    Please let me know what wrong i am doing. I am really struggling

    Hmm.. you have to assign text to the labelfields on creation complete not before that, the fllow will be like this
    var vbox1: VBox= new VBox();
    var sde:* = new searchDetails();
    vbox1.addEventListener(creationcompleteevent,function);
    vbox1.addChild(sde);
    myTabnavigator.addChild(vBox1);
    function(e:event):void{
    box1.label = "text";

  • Reading the Data from dynamically added rows of a table...

    Hi,
                  I am using adobe interactive form (WD ABAP) in which i am adding the table rows dynamically (using Jscript code).  I have to fech these data into an internal table. But I can read only the first row data..
                  Also While adding rows dynamically the same data is repeating for the consecutive rows..
                  I have found many similar posts in sdn, but i cannot get the solution. They have mentioned about adding in WDDOINIT method. Can anyone explain me what should be done,..?
    1) How to solve repeatative data while adding rows..?
    2) How to read dynamically added row data during runtime into internal table..?
    Thanks,
    Surya.

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Dynamic adding of components (doesn't work when programmatically)

    Hi, I don't understand, why this doesn't work. I'll explain it on this example:
    import java.util.concurrent.ScheduledThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    public class NewFXMain extends Application {
        Group root;
        public static void main(String[] args) {
            Application.launch(NewFXMain.class, args);
        @Override
        public void start(Stage primaryStage) {
            primaryStage.setTitle("Hello World");
            root = new Group();
            Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
            Button btn = new Button();
            btn.setLayoutX(100);
            btn.setLayoutY(80);
            btn.setText("Add button now");
            btn.setOnAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                    addButton();
            root.getChildren().add(btn);  
            primaryStage.setScene(scene);
            primaryStage.setVisible(true);
            System.err.println("Number of buttons before: "+root.getChildren().size());
            ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
            executor.schedule(new MyTask(), 5, TimeUnit.SECONDS);
        private void addButton() {
            System.err.println("Button adding");
            root.getChildren().add(new Button("YEAH"));
            System.err.println("Number of buttons after: "+root.getChildren().size());
        class MyTask implements Runnable {
            public void run() {
                addButton();
    }There are two ways how a new button can be added. Either by clicking on existing button or programmatically by the program itself after 5 seconds.
    If you add it by button, there is no problem. The error print is:
    Number of buttons before: 1
    Button adding
    Number of buttons after: 2
    But if you just wait, then the error print is:
    Number of buttons before: 1
    Button adding
    and no button is added. In fact, the error printing after the adding isn't performed either.
    I'd like to ask if there is some solution for this because I'd love to do some changes by schedulers. Thx
    Edited by: 876949 on 14.8.2011 9:09
    Edited by: 876949 on 14.8.2011 9:11

    No, these are not error messages, they are just for purpose of example. Here it doesn't matter whether err or out... (yes, 'out' would be better ;)
    But thanx, it's working. By the way, I am creating scheduler for task lists. They are supposed to be printed dynamically in specific time (or periodically). For example: at 5 o'clock I need to print 5 items of some list and every 3 hours I need to print 3 items of another list etc. - so it's quite dynamic with regard to component adding (No, I don't want to use some sort of ListView, I want interactive printing: one item on screen at a moment). I'll try to work your solution into my code.
    Edit: So either it's not possible to use this for the purpose of my app or it will be really cumbersome. Maybe it would be easier to draw some rectangles with mouse listeners...
    Edit: So I finally got around it. In the end, I won't use dynamic adding as intended. It's working and that's important.
    Edited by: 876949 on 14.8.2011 12:48
    Edited by: 876949 on 15.8.2011 5:21

  • Unable to get realtime position of animated child symbol's div from parent node (Stage)

    hi,
    for a data viz project, i've created an animated child symbol which changes its position on realtime basis. however, for some calculation purposes, i'm not able to keep track of the  realtime position of the div through stage as it is only showing me fixed value (starting position of the child div).... can anyone help? or is there a way to make global variable which can store position value in child symbol and i can access those values on the main stage???

    Try these in compositionReady. Adapt the scope of your element.
    var symTop = sym.$('Rectangle').css('top');
    var symLeft = sym.$('Rectangle').css('left');
    Then use the variable value where needed.
    or
    var position = sym.$("Rectangle").position();
    console.log( "x or left: " + position.left + ", y or top: " + position.top );
    var x = sym.$("Rectangle").position().left;
    var y = sym.$("Rectangle").position().top;
    console.log("x=",x,"y=",y);
    var coord = sym.$("Rectangle").position();
    sym.$("test_Text").html("x:" + coord.left + "<br>y:" + coord.top);

  • Dynamically adding to PDF after applying Extended Reader Rights

    All,
         I've created a PDF with a digital signature in Acrobat X Pro and applied the extended Reader rights. What I am trying (and failing) to do now is add new pages to the PDF via a Java library (BFO) on a server. When a user eventually brings up the PDF in Reader, they receive a warning about how the extended rights have been revoked since the PDF has been modified. Is there any way to maintain the rights while building the PDFs? Or is the only way to dynamically build a PDF with a digital signature that can be user-signed in Reader through the LiveCycle/ADEP services?

    You have to prepare the PDF BEFORE you add the extended Rights.  Once it's been rights enabled, you can't modify it w/o breaking the rights.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Mon, 14 Nov 2011 14:32:38 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Dynamically adding to PDF after applying Extended Reader Rights
    Dynamically adding to PDF after applying Extended Reader Rights
    created by j.ross.e<http://forums.adobe.com/people/j.ross.e> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4025497#4025497

  • Passing values to form bean string array from dynamic added textboxes

    Hi,
    I am unable to pass values to form bean string array from a jsp in which I have incorporated dynamically adding of textboxes in javascript.
    I have given add/delete row option in the jsp. If there is single row, this is working fine. But after adding a row, I am not able to either do any validations on added textboxes or pass the values to the String array form bean variable.
    code snippet:
    var cell6 = row.insertCell(4);
    var element5 = document.createElement("input");
    element5.type = "text";
    element5.className = "formtext1";
    element5.size = "5";
    element5.value = "00.00";
    element5.name= "qty"; // this is a string array of the form bean.
    element5.onchange=function() {checkNumeric(this);};
    cell6.appendChild(element5);
    <html:text styleClass="formtext1" property="qty" value="" size="5" styleId="qty" onchange="checkNumeric(this)"/></td>
    form bean declaration
    private String[] qty; Please help.
    Edited by: j2eefresher on Jan 12, 2010 11:23 PM

    Shivanand,
    There's no need to post that much code when you could create a very short test case that demonstrates only the problem you are having.
    You're using &NAME. notation on something that isn't a page or application item. You can't reference PL/SQL variables that way (or any other way) outside the PL/SQL scope. For your situation, you could create a page item named P55_DOCID and assign it a value in the PL/SQL process (:P55_DOCID := DOCID;), then reference &P55_DOCID. in HTML areas like the success message.
    Scott

  • Get and hide all child symbols

    I'd like to target all child symbol instances of my mT symbol and hide them.
    Something like this (except this doesn't work):
    childsymbols_d1 = sym.getSymbol("holder").getSymbol("d1").getSymbol("mT").getChildSymbols();
    for(var i=0; i<childsymbols_d1.length; i++){
              childsymbols_d1[i].hide();
    I don't want to use the timeline because I have a lot of child symbols, and would like to do this operation on several other symbols.

    i tried this and it works.
    I grouped the symbols in mT into a div called rect.
    sym.getSymbol("holder").getSymbol("d1").getSymbol("mT").$('rect').children().hide();

  • TweenMax a  Child symbol

    Hello everybody,
    this is my last try, then I will return to a brave tweening Designer.
    I asked a few times ago, but unforunately no solution at the end:
    I placed a symol on stage with a trigger at the first frame:
    sym.stop();
    var eins = sym.createChildSymbol("eins", "Stage");
    eins.getSymbolElement().css({
              'position': 'absolute',
              'left': 100,
              'top': 0
    Now I know (thank you BigMucho) that I can move the symbol with te following code:
    var eins = sym.createChildSymbol("eins", "Stage");
    var moveEins = eins.getSymbolElement();
    TweenMax.set(moveEins, {position:'absolute', left:100, top:0});
    TweenMax.to(moveEins, 2, {y:120, scale:1, opacity:1, delay:0, ease:Expo.easeOut});
    Whith this code I placed the symbol from the library and move it in one step.
    But I want to move the symbol (eins) which is already placed on the stage (with a trigger),
    whith a button afterwards.
    For better anderstanding:
    http://go-motion.net//upload/examples/04/test.zip
    Maybe there is someone, who can imagine what I want.
    Greetings form germany
    Oliver

    Hi, Oliver-
    Here's your project that has animations done using jQuery animate().  I know this isn't quite what you're looking for, but your TweenMax library isn't loaded in your project.  For more information on how to get this included, check out this forum post:
    http://forums.adobe.com/message/5092621#5092621
    If you're dynamically loading your symbol element, you're going to need to save the reference somewhere and then refer to it later.  You can at least see what I did using your project files here:
    https://creative.adobe.com/share/edac5fb5-7f14-448c-9f3f-b13fbc774ad5
    As you can see, what I did was to save a variable with the symbol instance reference, and then when I wanted to use it later, loaded the variable into the current scope, then grabbed the DOM by using getSymbolElement().
    Hopefully this points you in the right direction.
    Thanks,
    -Elaine

  • Add null rows in WDDOINIT  for fetching data from dynamically added rows..

    Hi,,
    I have to fetch data from a dynamically added rows of a table.
    I have followed / gone through many forums but they ddnot mention how to add null rows in the initialization method..
    I am using WD Abap..
    Can anyone help how to bind null rows in WDDOINIT method..?
    Thanks,
    Surya

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Inconsistent results for adding child node in a JTree

    I have a JTree where I add child nodes when a user clicks on the node or handle. When the user clicks on the node, through implementing TreeSelectionListener interface, I add a node, the tree expands, and I see the newly added node. However, when the user clicks on the handle, through implementing the TreeExpansionListener, the tree does not expand and I do not see the newly added node. The problem is repeatable by compiling the code below.
    Why is there this difference? Aren't all the methods implemented through the TreeSelectionListener and TreeExpansionListener in the SWT thread?
    public class TestFrame extends JFrame implements TreeSelectionListener, TreeExpansionListener {
         public TestFrame() {
              String[] alphabets = {
                        "a", "b", "c", "d", "e", "f", "g",
                        "h", "i", "j", "k", "l", "m", "n",
                        "o", "p", "q", "r", "s", "t", "u",
                        "v", "w", "x", "y", "z"
              DefaultMutableTreeNode top = new DefaultMutableTreeNode("CEDICT");
              for(int i=0; i < alphabets.length; i++) {
                   DefaultMutableTreeNode node =
                        new DefaultMutableTreeNode(alphabets) {
                        public boolean isLeaf() { return false; }
                   top.add(node);
              JTree tree = new JTree(top);
              tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
              tree.addTreeSelectionListener(this);
              tree.addTreeExpansionListener(this);
              tree.setShowsRootHandles(true);
              JScrollPane treePane = new JScrollPane(tree);
              treePane.setHorizontalScrollBarPolicy(
                        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              treePane.setVerticalScrollBarPolicy(
                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
              treePane.setSize(new Dimension(200,400));
              treePane.setPreferredSize(new Dimension(200,400));
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(treePane, BorderLayout.CENTER);
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              int inset = 50;
    setBounds(inset, inset,
    screenSize.width - inset*2,
    screenSize.height - inset*2);
              setLocationRelativeTo(null);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              pack();
              show();
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        JFrame.setDefaultLookAndFeelDecorated(true);
                        TestFrame frame = new TestFrame();
         public void valueChanged(TreeSelectionEvent e) {
              JTree tree = (JTree)e.getSource();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
         public void treeCollapsed(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child
         public void treeExpanded(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child

    I couldn't figure out why inserting a node in the valueChanged(...) method works. In all three methods no listeners are notified about the change, so you would think all three would fail.
    For a JTree using the DefaultTreeModel the nodesWereInserted(...) method needs to be called. For example, if I change your last three methods to this
    public void valueChanged(TreeSelectionEvent e) {
       insertNode((JTree) e.getSource(),
                  (MutableTreeNode) e.getPath().getLastPathComponent());
    public void treeCollapsed(TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void treeExpanded(final TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void insertNode(JTree tree, MutableTreeNode parent) {
        Date date = new Date();
        MutableTreeNode child = new DefaultMutableTreeNode(date.toString());
        int index = parent.getChildCount();
        parent.insert(child,index);
        ((DefaultTreeModel) tree.getModel())
                .nodesWereInserted(parent,new int[]{index});
    }then it works as you desire. You can (and should) of course use the DefaultTreeModel's own insert method.
    DefaultTreeModel#insertNodeInto(MutableTreeNode,MutableTreeNode, int)

Maybe you are looking for

  • Get Job_Id after Scheduling BI Publisher Report

    Hi We are running the BI Publisher reports from Unix shell scripts. Please find below one sample code of the shell script ## Start Script wsdl_url="......." job_name="TEST" user_id="TST" pwd="TST1" java Scheduler $1 $2 $wsdl_url $job_name $user_id $p

  • Tab as export delimiter

    Is it possible to make the tab character the export delimiter for SQL Developer? If so, how? Thanks, Tracey I found it under: Preferences>Database>Worksheet Parameters>General Export Parameters: Column Delimiter Custom Export Delimiter [,] I just dow

  • Material types like ROG, HALB etc. (are hidded) in MM01

    Hi, I am not able to see material types like ROG, HALB etc. (are hidded). Only descreption is displayed. What needs to be done so that I can also able to see the material types in MM01 Regards, Shetty

  • Satellite a215-s7428

    I have error messages, see attached. Computer won't boot up everytime I power on. Also can't start up my Firefox. Please help! Thanks Attachments: toshiba error message.doc ‏34 KB

  • Installation Issue with Secure Enterprise Search 11.2.2.2

    Hi, I'm facing an issue with Oracle SES 11.2.2.2. I have installed this on 11.1.1.6 middleware softwares and weblogic 10.3.6 and the installation is successful. The admin UI opens up in the browser. (http://localhost:13102/search/admin/index.jsp) How