Hi there, 

Well it seems that the tree is not working again...
Here is the code: 
Inside the Tree I am overriding the newNodeComponentMethod() like this:

//Java Code

@Override
        protected Component newNodeComponent(String id, IModel model) {
                Component nodeComp = null;
                int level = ((DefaultMutableTreeNode) 
model.getObject()).getLevel();
                if (level == 1) {

                        nodeComp = new ExchangeNodePanel(id, model,
LimitViewerCheckBoxTree.this);
                        

                }
                if (level == 2) {

                        nodeComp = new LimitViewerCheckBoxIconPanel(id, model,
                                        LimitViewerCheckBoxTree.this, 
this.limitViewerForm) {
                                private static final long serialVersionUID = 1L;

                                protected void onNodeCheckUpdated(TreeNode node,
                                                LimitViewerCheckBoxTree tree, 
AjaxRequestTarget target) {
                                        super.onNodeCheckUpdated(node, tree, 
target);
                                        
LimitViewerCheckBoxTree.this.onNodeCheckUpdated(node, tree,
                                                        target);
                                }
                        };
                }
                if (level == 3) {
                        try {
                                nodeComp = new InstrumentLimitViewerPanel(id, 
this.limitViewerForm);
                        } catch (Exception e) {
                                e.printStackTrace();
                        }
                }
                return nodeComp;
        }

and then then the ExchangeNodePanel code is given below:


//Java code
public class ExchangeNodePanel extends LabelIconPanel {

        private static Logger logger =
Logger.getLogger(ExchangeNodePanel.class.getName());
        
        public ExchangeNodePanel(String id, IModel model,LimitViewerCheckBoxTree
tree) {
                super(id, model, tree);

        }
        
        @Override
        protected Component newContentComponent(String componentId, 
                        BaseTree tree, IModel model){
                {

                return new Label("exchangeName");
                        
                };
}

However the value of the label is not displayed and it is always empty. But
when I define the ExchangeNodePanel class as shown below it works:

public class ExchangeNodePanel extends LabelIconPanel {

        private static Logger logger =
Logger.getLogger(ExchangeNodePanel.class.getName());
        
        public ExchangeNodePanel(String id, IModel model,LimitViewerCheckBoxTree
tree) {
                super(id, model, tree);

        }
protected void addComponents(final IModel model, final BaseTree tree) {
        Component exchangeName = newContentComponent("exchangeName", tree, 
model);
        add(exchangeName);
}
}

Any idea why this is happening.

Thanks in advance,
vishy
-- 
View this message in context: 
http://www.nabble.com/Dynamically-Making-changes-to-Tree-Node-tp18765641p18814983.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to