1

Issue Implemeting Interesting Macro Component ?

asked 2012-08-24 11:02:29 +0800

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

updated 2012-08-24 11:06:53 +0800

Hi Please help me to resolve this issue.

The Scenario is something like this:-
1- I have created a Macro Component Containing Two ListBox(Left and Right) with a button->my_macro_component.zul- ---Done

<zk>
	 <hlayout
		style="padding-left: 40px;padding-top:20px;padding-bottom:20px;"
		hflex="1" vflex="1">
		<separator ></separator>

		<listbox id="leftListbox" height="250px" width="250px"
			onDrop="move(event.dragged)" droppable="true" oddRowSclass="non-odd"
			model="${arg.model}">
			<listhead>
				<listheader label="Default Columns" ></listheader>
			</listhead>
			<template name="model" var="each">
				<listitem draggable="true" droppable="true"
					onDrop="move(event.dragged)">
					<listcell label="${each}" ></listcell>
				</listitem>
			</template>
		</listbox>

		<separator orient="vertical" spacing="20px" ></separator>

		<listbox id="rightListbox" height="250px" width="250px"
			onDrop="move(event.dragged)" droppable="true"
			oddRowSclass="non-odd">
			<listhead>
				<listheader label="Selected Columns" ></listheader>
			</listhead>
		</listbox>

	</hlayout>

	<button onClick="@command('updatelist')" type="button" label="Save"  id="myButton"></button>

	<zscript><![CDATA[
	void move(Component dragged) {
		if (self instanceof Listitem) {
			self.parent.insertBefore(dragged, self);
		} else {
			self.appendChild(dragged);
		}
	}
]]></zscript>
</zk>

 

2-I Added this macro Component to another zul file[my_listBox.zul] :-Done


<?component name="refreshListbox" macroURI="/my_macro_component.zul" inline="true"?>
<zk>

	<window apply="org.zkoss.bind.BindComposer"
		viewModel="@id('vm') @init('org.test.TestVM')" width="100%"
		height="100%">

		<button onClick="@command('showModelPopUp')" label="ShowMacro"></button>
		
		<listbox model="@load(vm.model)" emptyMessage="Empty List"
			itemRenderer="@load(vm.itemRenderer)">

			<listhead children="@load(vm.headerList)">
				<template name="children" var="headerName">
					<listheader label="@load(headerName)"></listheader>
				</template>
			</listhead>


		</listbox>
		<window title="MacroComponent" id="queryWindow" height="80%"
			width="54%" mode="modal" position="center" closable="true"
			visible="@load(vm.showModelWindow)" popup="true">

			<refreshListbox model="@load(vm.headerList)" height="100%"
				width="100%">
			</refreshListbox>

		</window>
	</window>
</zk>

3-When User will click on this button ShowMacro I opened a Model Window and Shoe Two ListBox in which one list box have data which is coming from ModelViewClass.:-Done

Now Issue is that
4-I want When User will click on the Save button of Macro Component , then ListBox of [my_listBox.zul] file will refresh and data populate again I do not understand How can I achieve this.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2012-08-27 07:09:34 +0800

psingh gravatar image psingh flag of India
963 8

Please have a look at below link:
http://www.zkoss.org/forum/listComment/18433-ZK-6-Composite-component-getter-not-working-in-view-model

May be it helps you!!

link publish delete flag offensive edit

answered 2012-08-24 16:09:06 +0800

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

updated 2012-08-24 16:09:24 +0800

AnyOne Know How can resolve this issue

link publish delete flag offensive edit

answered 2012-08-26 18:05:58 +0800

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

Hi I tried lots of thing but did not get any solution yet please have a look and tell me the solution.

link publish delete flag offensive edit

answered 2012-08-27 12:30:16 +0800

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

Hi PSingh
Thanks for ur reply but it will not resolve my issue please have a look on my code and then let e know any solution.
thanks

link publish delete flag offensive edit

answered 2012-08-28 10:35:56 +0800

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

Thanks At last I am able to Finish ReorderListBox Functionality.

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-08-24 11:02:29 +0800

Seen: 168 times

Last updated: Aug 28 '12

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