Re: Block AjaxEditableMultiLineLabel Edit Mode when selecting text

2019-07-16 Thread Sven Meier

Hi Patrick,

overwrite AjaxEditableLabel#updateLabelAjaxAttributes() and use a 
precondition:


            @Override
            protected void 
updateLabelAjaxAttributes(AjaxRequestAttributes attributes)

            {
                attributes.getAjaxCallListeners().add(new 
AjaxCallListener() {

                    @Override
                    public CharSequence getPrecondition(Component 
component)

                    {
                        // only when no selection
                        return "return window.getSelection() == '';";
                    }
                });
            }

Have fun
Sven


On 16.07.19 16:50, Patrick Schwarzer wrote:


Dear Sir or Madam,

we are using AjaxEditableMultiLineLabel in our Wicket Application. 
Currently when an user selects text, the AjaxEditableMultiLineLabel 
changes to edit mode and selects the whole text. The user selection is 
lost.


We want to know, if it is possible to block the edit mode, when user 
selects text in the AjaxEditableMultiLineLabel?


When it is possible, can you explain, how this can be realized?

Kind regards

*PATRICK SCHWARZER*
SOFTWARE ENGINEER

*o***+49 89 32175 655

*TOMTEC Imaging Systems GmbH*
Edisonstrasse 6, 85716 Unterschleissheim, Germany, Managing Director:
Matthijs Groot Wassink, Dr. Thomas Piehler, HRB 235646 Amtsgericht 
Muenchen


** 





Block AjaxEditableMultiLineLabel Edit Mode when selecting text

2019-07-16 Thread Patrick Schwarzer
Dear Sir or Madam,

we are using AjaxEditableMultiLineLabel in our Wicket Application. Currently 
when an user selects text, the AjaxEditableMultiLineLabel changes to edit mode 
and selects the whole text. The user selection is lost.

We want to know, if it is possible to block the edit mode, when user selects 
text in the AjaxEditableMultiLineLabel?
When it is possible, can you explain, how this can be realized?

Kind regards


PATRICK SCHWARZER
SOFTWARE ENGINEER

o +49 89 32175 655

TOMTEC Imaging Systems GmbH
Edisonstrasse 6, 85716 Unterschleissheim, Germany, Managing Director:
Matthijs Groot Wassink, Dr. Thomas Piehler, HRB 235646 Amtsgericht Muenchen

[cid:image001.jpg@01D53BF6.54AE7290]