1

how to get all parameters in DefaultCommand

asked 2018-08-16 16:41:15 +0800

sesong11 gravatar image sesong11
17 3
 @DefaultCommand
 public void defaultCommand(@ContextParam(ContextType.EXECUTION) Execution exc, 
         @ContextParam(ContextType.COMMAND_NAME) String eventName) {
    binder.postCommand("real"+eventName,exc.getParameterMap()); 
}

But it doesn't work as my expectation. Please help

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-17 03:30:14 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...
@DefaultCommand
public void foo(@ContextParam(ContextType.BIND_CONTEXT) BindContextImpl bindContext)  {
    Clients.showNotification(String.valueOf(bindContext.getCommandArgs()));   
}

You need to use the BindContextImpl because in the BindContext you can only query 1.
That method will return your map with all your parameters.

Chill.

link publish delete flag offensive edit

Comments

Thanks It work. I see getCommandArgs and getBindingArgs are return the same value, which one should I use? why?

sesong11 ( 2018-08-17 10:12:29 +0800 )edit

If it's a command, i should use commandargs. I think that there is a possibility that Bindings will have more items then command in some cases

chillworld ( 2018-08-17 11:04:35 +0800 )edit
Your answer
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
2 followers

RSS

Stats

Asked: 2018-08-16 16:41:15 +0800

Seen: 8 times

Last updated: Aug 17 '18

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