0

Error on Listbox Repopulate - Failed to mount: this.parent._initDrag is not a function

asked 2013-01-18 18:16:30 +0800

kryselmire gravatar image kryselmire
19 2

Interesting issue. When I try to reload data into a listbox (poll the server for fresh data, then reset the ListModel) I get an error on one listbox, but not another. Here is the scenario:
I have a project that uses spans that act as views. If a user clicks a button on the West border of a borderlayout, the visible properties of the spans in the center are changed effectively changing what the user sees. When that view is changed, a service call requests data from our webservices, then repopulates the listboxes in the view.

the problem:
On the initial load, everything looks good. If I change to a second view, then return to the first I get an error: 'Failed to mount: this.parent._initDrag is not a function'

My troubleshooting attempts found two different listboxes that are populated as a result of the same service call. One produces the error, the other doesn't, and I can not see a difference as the number of columns do not seem to matter. Versions 6.0.1, 6.5.0, and 6.5.1 all have the same results. This is all running on a Tomcat 6 app server.


Here is the one that produces the error:

	<listbox id="summaryListBox" rows="1">
		<listhead>
			<listheader label="Unbilled" width="20%" />
			<listheader label="Due"  width="20%" />
			<listheader label="Due Date"  width="20%" />
			<listheader label="Balance"  width="20%" />
			<listheader label="Limit"  width="20%" />
		</listhead>
		<template name="model">
			<listitem value="${each}">
				<listcell label="${each.unbilledBal.value}" />
				<listcell label="${each.balDue.value}" />
				<listcell label="${each.dueDate.value}" />
				<listcell label="${each.balance.value}" />
				<listcell label="${each.limit.value}" />
			</listitem>
		</template>
	</listbox>
	

	public void getSummaryList(CardSummary cs){		
	    	if(!cs.equals(null)){	
			ListModelList<CardSummary> cardSummary = new ListModelList<CardSummary>();
			cardSummary.add(cs);

			summaryListBox.setModel(cardSummary);
			summaryListBox2.setModel(cardSummary);
			//getAmountDue();		
		}else{
			summaryListBox.setEmptyMessage("No Cards Associated With This Account");
		}
	}


This one does not have the error:
	public void loadUnbilled(List<Webstmdetp> unbilled){
		System.out.println("in loadunbilled");
		ListModelList<Webstmdetp> ub = new ListModelList<Webstmdetp>(unbilled);
		System.out.println("after the ListmodelList");
		unbilledListbox.setModel(ub);
		System.out.println("Model loaded");
	}
	

<listbox id="unbilledListbox" rows="4">	
	<listhead>
		<listheader label="Date" width="20%" />
		<listheader label="Description" width="60%" />
		<listheader label="Amt" width="20%" />	
	</listhead>
	<template name="model">
		<listitem value="${each}">
			<listcell label="${each.ddmonth.value}/${each.ddday.value}" />
			<listcell label="${each.dddesc.value}" />
			<listcell label="${each.ddamount.value}" />
		</listitem>
	</template>
</listbox>

I would include more on the code, but our webservices are not outward facing, and without the services included I do not encounter the error, which would make the point moot.

My best guess at this point is that I'm populating the listboxes incorrectly, but I'm totally not seeing anything that should be done other than what I'm doing, and the one that works makes me think otherwise. *shrug*

If anyone out there sees something that I'm missing, I would really appreciate it.

Thanks!

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-01-31 16:46:47 +0800

kryselmire gravatar image kryselmire
19 2

updated 2013-02-01 05:26:01 +0800

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

EUREKA!!

The issue is not with the listbox populating itself, but instead with the layout it is held withing. This has been added to the ZK Bug Tracker: ZK-1604

For those of you that manage to stumble onto the same issue I did, Here is the cause:

This error is due to the following pattern of containers/objects. [code]

<borderlayout>
    <center>
        <columnlayout>
            <columnchildren>
                <listbox model="@load(vm.dataset)">
                    ....
                </listbox>
            </columnchildren>
        </columnlayout>
    </center>
</borderlayout>

[/code] The initial load does not cause any problems. But once the data is refreshed, a window appears on the UI with the above error.

If the columnlayout is removed as so: [code]

<borderlayout>
    <center>
        <listbox model="@load(vm.dataset)">
            ....
        </listbox>
    </center>
</borderlayout>

[/code] the error does not appear on data reload.

link publish delete flag offensive edit
Your answer
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: 2013-01-18 18:16:30 +0800

Seen: 45 times

Last updated: Feb 01 '13

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