0

NullPointerException on createComponents()

asked 2012-07-18 07:28:01 +0800

Eloytxo gravatar image Eloytxo
18

Hi all !

Im trying to open a new tab when doubleClicking a row in a listbox, and include a zul in the tabPanel contained in that tab.

When i Want to call the zul, I get a null exception, and dont know why.. any suggest??

 @Command
    public void onDoubleClicked(@BindingParam("tabPanel") Tabbox tabPanel) {

	this.tabBox = tabPanel;
	Map<String, Integer> arguments = new HashMap<String, Integer>();
	arguments.put("prim", 1);
	String le = selectedUser.getFull_name();
	Tab newTab = new Tab(le);
	newTab.setSelected(true);
	newTab.setClosable(true);
	newTab.setParent(tabPanel.getTabs());
	Tabpanel newTabpanel = new Tabpanel();
	Executions.createComponents("Alta.zul", newTabpanel, arguments);  // <----- This causes exception
	//newTabpanel.appendChild(new Label("New Tabpanel Text "));
	newTabpanel.setParent(tabBox.getTabpanels());

    }

...
Caused by: java.lang.NullPointerException
	at org.zkoss.bind.BindComposer.initViewModel(BindComposer.java:155) [zkbind-6.0.0.jar:6.0.0]
	... 56 more

09:17:37,545 GRAVE [org.zkoss] (http-localhost-127.0.0.1-8080-4) >>org.zkoss.zk.ui.UiException: null
>>java.lang.NullPointerException
...

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-09-25 01:09:47 +0800

paowang gravatar image paowang
140 6

Can you provide zul file or more code for reproducing?

link publish delete flag offensive edit

answered 2012-09-25 10:28:10 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

DId you Wire your Parent Component ID in case of you it is newTabpanel from its Id
Something like that ..

@Wire("someId")
Tabbox newTabpanel 

Are you doing like that?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-07-18 07:28:01 +0800

Seen: 183 times

Last updated: Sep 25 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More