-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to pass the parameters to the command method? Can't find a way, blogs are silent about this.
Yeah, but the question is how to push parameters from ZUL.. Though I can't mark a method with @Param annotation, it shows an error.
Again just looking into zkbind.jar code, it seems you can put any named attribute in the ZUL command annotation, e.g.
<button label="Click" onClick="@command('click' arg1='value1')"/>
@Param is a PARAM annotation, so you need to place it near method parameter. The command method signature should look like the following:
@Command public void click(@Param("arg1") String arg1)
This is for the syntax. I didn't try it though.
I am curious: what do you want to achieve?
@Param is a PARAM annotation
Yeah, didn't notice hehe, it was obvious)
But the ZUL sample didn't help, it simply doesn't show any error in the log, but in the same time doesn't go into the method as well.
I have several identical buttons at different rows, and want to identify the command by specifying id of the row this button is placed at so that I can figure out on what row this action should be performed.
PS: where do you read that docs? I mean regarding ZUL markup.
I found the following related blog entry.
The interesting part:
I dunno why I didn't try this before, but this works:
onClick="@command('showGroupsDialog', label='aa', arg1='bb')
Hm.. looks like you can't resolve ${} placeholders inside the @command:
<button label="Add Group" sclass="add-group-button" onClick="@command('showGroupsDialog', mode='${arg.mode}')" />
Asked: 2011-12-19 10:26:07 +0800
Seen: 2,246 times
Last updated: Jul 27 '12