Hi,
you should be able to add a dynamic extra attribute:
protected MarkupContainer newLinkComponent(String id, IModel<T> model)
{
return new AjaxLink<Void>(id)
{
@Override
public boolean isEnabled()
{
return StyledLinkLabel.this.isClickable();
}
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes
attributes)
{
super.updateAjaxAttributes(attributes);
attributes.getDynamicExtraParameters().add("function(attrs) { return
{ 'modifiers' : modifiers(attrs.event) }; }");
}
@Override
public void onClick(AjaxRequestTarget target)
{
String modifier =
getRequest().getRequestParameters().getParameterValue("modifiers").toOptionalString();
}
};
}
I didn't try it, but I think all you have to do is to provide a
#modifiers(event) to encode all pressed modifier keys.
Have fun
Sven
On 17.01.2017 18:30, Maxim Solodovnik wrote:
I have started implementing this :)
Used this [1] as an example
I have one proposal:
To add method updateAjaxAttributes to StyledLinkLabel (to reduce amount of
copy/paste :)), I can create PR, it seems to be trivial :)
And one question:
To have ctrl/shift I need original MouseEvent, how can I get it? (found no
way to debug these dynamic JS functions :( )
Thanks in advance
[1] https://issues.apache.org/jira/browse/WICKET-5306
On Thu, Dec 22, 2016 at 2:14 PM, Maxim Solodovnik <solomax...@gmail.com>
wrote:
Sounds doable :)
I was hoping this is already implemented, so I can use it :)
Will implement myself :)
On Thu, Dec 22, 2016 at 2:06 PM, Sven Meier <s...@meiers.net> wrote:
Hi Maxim,
you'd have to transport information about the currently pressed keys to
the server (via AjaxRequestAttributes dynamic extra parameters).
There it is just a matter of managing selection state and visually
marking the components accordingly.
Sounds complicated?
Sven
On 22.12.2016 05:44, Maxim Solodovnik wrote:
Hello All,
Maybe someone has any working examples of multi-node selection
in DefaultNestedTree using Crtl/Shift keys?
Thanks in advance
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org