0

How to get a GenericForwardComposer instance

asked 2010-08-11 04:24:36 +0800

aldian gravatar image aldian
33 1

updated 2010-08-11 04:25:49 +0800

hi guys,,
can u help me to find the way of getting a Composer instance..

because i wan to use the attributes or functions which is defined in the composer..

for Example i have the instance of a Window
that Window apply class AldianComposer

can i get the AldianComposer's instance that is used by the Window.

in this case i just can access the instance of the Window..

anyone can help me? i need it very much..

Thx before for helping..

Regards,,

Aldian Bagya

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2010-08-11 12:09:08 +0800

twiegand gravatar image twiegand
1807 3

Aldian,

Please have a look here. This should give you a good start.

Regards,

Todd

link publish delete flag offensive edit

answered 2010-08-12 02:06:02 +0800

aldian gravatar image aldian
33 1

Dear Todd,,

i guess,, at there, it's not mentioned how we can get the instance..
thx anw...

Regards,

Aldian Bagya

link publish delete flag offensive edit

answered 2010-08-12 03:14:04 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

In the GenericForwardComposer is only ONE methode that you can access.

You can override it in your own Controller:

  public class BranchListCtrl extends GenericForwardComposer implements Serializable {

	protected Window windowBranchList; // autowired


	@Override
	public void doAfterCompose(Component window) throws Exception {
		super.doAfterCompose(window);

		/**
		 * 1. Set an 'alias' for this composer name to access it in the
		 * zul-file.<br>
		 * 2. Set the parameter 'recurse' to 'false' to avoid problems with
		 * managing more than one zul-file in one page. Otherwise it would be
		 * overridden and can ends in curious error messages.
		 */
		self.setAttribute("controller", this, false);

               . . .
       }

       .  .  .
  }

best
Stephan

link publish delete flag offensive edit

answered 2010-08-12 04:50:37 +0800

aldian gravatar image aldian
33 1

dear Stephan,,

can i get the instance of the BranchListCtrl ?
let say i have the window instance that apply BranchListCtrl .

thx

Regards,

Aldian Bagya

link publish delete flag offensive edit

answered 2010-08-12 06:21:31 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi aldian,
Once you set your controller using the way stephan pointed out

self.setAttribute("controller", this, false);

you can retrieve the controller using your window instance with

BranchListCtrl  ctrl = (BranchListCtrl ) window.getAttribute("controller");

link publish delete flag offensive edit

answered 2010-08-12 07:50:10 +0800

aldian gravatar image aldian
33 1

oooh i see,,
thx for helping :)


Regards,

Aldian Bagya

link publish delete flag offensive edit

answered 2010-08-12 20:33:56 +0800

shenjie gravatar image shenjie
47 2

I think you can use "use" attribute instead of "apply" to define the controller.

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: 2010-08-11 04:24:36 +0800

Seen: 483 times

Last updated: Aug 12 '10

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