0

fulfill url with parameters

asked 2011-05-10 07:43:31 +0800

ggrimoldi gravatar image ggrimoldi
74 1

I'm trying to use a grid with rows having a <detail> item.
I have a fulfill attibute on it:

fulfill="onOpen=/xyz/mypage.zul"

I need to pass to "mypage.zul" an attribute (a master code to filter items on the underlying page).
How can I pass it?
I don't like to get it by "a parent sequence" from "mypage.zul" itself.

Can anyone help me?

Any hint will be appreciate.

Thanks

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2011-05-12 01:43:54 +0800

ggrimoldi gravatar image ggrimoldi
74 1

I solved myself in this way.
The grid is bound with a data bean.
I get the bean for the current row and pass it to detail page.
This is a fragment for the page where grid is:

<row>
	<detail open="false" fulfill="onOpen">
		<zscript>
			Row current_row = self.parent;
			int index = current_row.getParent().getChildren().indexOf(current_row);
			Object row_data = current_row.getGrid().getModel().get(index);
		</zscript>
		<include src="/xyz/mypage.zul" rowSelected="${row_data}"/>
	</detail>
			  
	.....  other row items here ......

</row>

In mypage.zul I get the data bean in this way:

<zk>
   <zscript>
       Object data = Executions.getCurrent().getAttribute("rowSelected");
   </zscript>
</zk>


In this way the page "mypage.zul" is encapsulated, because don't need to reference any component from the calling one.

Bye

link publish delete flag offensive edit

answered 2011-05-12 10:33:43 +0800

TonyQ gravatar image TonyQ
642
https://www.masterbranch....

updated 2011-05-12 20:58:33 +0800

There's a another approach to use onFulfill event to get the model your need from Detail.

		<row>
			<detail fulfill="onOpen" >
                <attribute name="onFulfill" ><![CDATA[
/*		Row current_row = self.parent;
		int index = current_row.getParent().getChildren().indexOf(current_row);
		Object row_data = current_row.getGrid().getModel().get(index);
	*/
		HashMap map = new HashMap();
		map.put("rowSelected","Mydata");
		Executions.createComponents("test2.zul",self,map);
		]]></attribute>
			</detail>
		</row>

test2.zul

<div>asdasd ${arg.rowSelected}</div>

And if you want to get the arguments in included page's zscript ,
another way is to use arg ( implict object ).

like

<div>asdasd ${arg.rowSelected}
 <zscript>
 	System.out.println(arg.get("rowSelected"));
 </zscript>
</div>

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: 2011-05-10 07:43:31 +0800

Seen: 382 times

Last updated: May 12 '11

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