Sebastian,
thanks for taking the time - as I mentioned in earlier posts:
what I try to achieve is to relate the click event in a menubutton to
the server which in turn has mirror objects to the widget objects on the
client side.
As was suggested this works well where I have individual eventhandlers
directly attached to an object.
What I tried with the particular example was following the fact that
there is a single eventhandler in the demo (ToolBar_3.html). This is to
my liking and I want to use that handler to let the server know which
menu button was clicked.
My thinking is to send the objectname because that is what identifies
also the mirror object on the server and - like you say - JS should be
able to return identifiers (names) for it's objects (as string).
My simple question is:
can JS return the identifier (name) of an object as string (and how)?
A more complex question might be:
If not - is there another way to have a single eventhandler handle
multiple eventtargets - other than setting a rule that each object has
to handle its events by its own handler?
I use Delphi a lot and and eventhandlers in Delphi are called like this:
xyEvent(Sender: TObject)
so you can create one handler for each object but you may as easily have
one - say 'onClick' handler for 50 or so buttons...
(this might explain where I'm coming from :) )
Thanks again - Ralf
Sebastian Werner wrote:
Ralf Wenske schrieb:
In general I try to keep codesize small - in this particular example
it might not matter as much. So a solution for this particular
situation would be to use as many QxCommands as I have buttons?
As all these Commands might then call one single function in turn
(sending the event to the server) I would still like to find a more
effective solution.
Being able to identify the triggering component would allow this.
Sebastian, given your suggestion would I be right to assume that the
answer to my initial question is No - I cannot identify the
QxmenuButton in an eventhandler? Could you confirm please so I can
concentrate on a different solution.
Sure, you should be able to identify your button. The question is what
you exactly need. The label, the instance of what? Please tell me.
(I am working on a framework and I feel that this simple*
functionality might be required quite often: processing certaint
events in central functions which can do their job if they know who
called).
You can even do this without any QxCommand instance. For example you can
simply attach a method to each button with the event "execute". The
event object then contains as e.getTarget() the button which was pressed.
Hope this helps.
Sebastian
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel