0

how to get composer reference from a component?

asked 2009-06-29 10:02:01 +0800

sanhaq gravatar image sanhaq
264 1 6

updated 2009-06-29 10:28:31 +0800

Can anybody tell me how can i get the velue of 'aaply' attribute of a Window?
e.g.

<window apply="com.Test">
<button label="butt" id="b"/>
</window>
public class Test extends GenericForwardComposer{
}
public void onClick$b(Event e) {
//here how can i get the value of 'apply' attribute of the Window?
}

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-06-29 11:04:10 +0800

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

updated 2009-06-29 11:04:26 +0800

@sanhaq,

public void onClick$b(Event e) {
e.getTarget()
}

If you would concentrate of your logic than have a look here .
Search for the helper class BaseCtrl.java and study the code and the thread.

Stephan

PS: help to prevent the global warming by writing cool software.

link publish delete flag offensive edit

answered 2009-06-30 04:48:15 +0800

sanhaq gravatar image sanhaq
264 1 6

updated 2009-06-30 04:48:52 +0800

thanks.
But actually i want only the value of apply attribute of Window.
That means here "com.Test".So can i get this from this onClick$b() method?

link publish delete flag offensive edit

answered 2009-07-08 03:12:08 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

@sanhaq,

Isn't that "this"? The com.Test object.

link publish delete flag offensive edit

answered 2015-06-05 14:44:21 +0800

FlorianSchaetz gravatar image FlorianSchaetz flag of Germany
31 6

updated 2015-06-08 09:41:28 +0800

Having the same problem, because I need the composer of a child component (where it's not "this"). Solved it for the moment with putting the composer in an attribute of the component, so that component.getAttribute("composer") will return the original composer (or, to be more exact, the list of composers). But probably there is a much better way, just haven't found it yet...

Edit: Ok, Components.getComposer() seems to be a better way, but I am still curious why it only returns one Composer, because more than one can be applied to any Component...

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: 2009-06-29 10:02:01 +0800

Seen: 995 times

Last updated: Jun 08 '15

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