You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by saschisch87 <al...@msit.at> on 2012/08/06 14:58:01 UTC

Paste Behaviour

Hi, I´m trying to accomplish the following Behaviour. 

I have a tree of Textareas. each one of them is modifiable. When you click
into one of them you can open a modal window where you can choose from
predefined textblocks. on confirmation of the selected block it should be
pasted where the cursor was in the last selected window. 

I´ve tried to do some javascript to accomplish that and it works like: 
(Pseudocode) take text from
document.forms[formName].elements[insertName].value

and put it into
document.forms[formName].elements[inputName];

The problem is that I can´t figure out how to execute the js on an event or
even avoid js and get the info directly in wicket.

Any Suggestions?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Paste-Behaviour-tp4651016.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Paste Behaviour

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
Hi,

How about:

Attach a ajax onclick behavior to your TextAreas. This behavior opens 
the modalwindow and registers an "onclose" callback. In the callback:
-update the model of the text area according to which textblock the user 
chose
-add the TextArea to the ajax request for a refresh.

On 06/08/2012 8:58 AM, saschisch87 wrote:
> Hi, I´m trying to accomplish the following Behaviour.
>
> I have a tree of Textareas. each one of them is modifiable. When you click
> into one of them you can open a modal window where you can choose from
> predefined textblocks. on confirmation of the selected block it should be
> pasted where the cursor was in the last selected window.
>
> I´ve tried to do some javascript to accomplish that and it works like:
> (Pseudocode) take text from
> document.forms[formName].elements[insertName].value
>
> and put it into
> document.forms[formName].elements[inputName];
>
> The problem is that I can´t figure out how to execute the js on an event or
> even avoid js and get the info directly in wicket.
>
> Any Suggestions?
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Paste-Behaviour-tp4651016.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org