Re: Help with creating an AJAX-enabled component - EditableLink and EditableLabel

2013-01-08 Thread Ondrej Zizka
I've looked at it, and the communication there revolves around JSON sent 
for the component to show tags.

I haven't found how to send the HTML of the element.

Maybe I understand the concept wrong.
FWIK, Wicket has a small lib on client side which replaces HTML of 
elements which are added to target.

Is that true? And is this rendering of HTML done automatically?
Was this mechanism changed significantly in Wicket 6?

And how about the jQuery  Wicket integration.
I've read briefly in What's new in Wicket 6 that it has built-in jQuery.
Does that mean that I can use jQuery (as in the example you gave) and 
not care about including it?


Sorry if I ask what was posted somewhere, I'm watching few frameworks 
(of which Wicket is my favorite ;) and lost track a bit...



Also: Is the best way to use Panel as a base class?


Thanks,
Ondra



On 01/05/2013 09:24 AM, Martin Grigorov wrote:

Hi,

Recently I had to make an EditableLabel that does most of the work on the
client side, i.e. it notifies the server with Ajax call only when the value
is changed.
I used
https://github.com/caphun/jquery.inlineedit/blob/master/jquery.inlineedit.js (I
simplified it for our needs) for that.
The Wicket component just uses a custom implementation of
AbstractDefaultAjaxBehavior. I pass the behavior's callbackUrl to the
JavaScript plugin options  and then in JS's save method I used it to make
the Ajax call with the new value of the label.

I cannot share this code with you.
But you can take a look at
https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/autocomplete-tagit-parent/autocomplete-tagit/src/main/java/org/wicketstuff/tagit/TagItAjaxBehavior.java.
It does something similar.


On Fri, Jan 4, 2013 at 6:34 PM, Ondrej Zizka ozi...@redhat.com wrote:


Hi all,

I am creating an editable label and link which better suits my needs than
existing EditableLabel.
Anyone willing toguide me a bit?

Basically, what I needto know, is how to properly ajaxify it.Precisely, to
allow events to be sent to the server, and to re-renderusing the new model
state.
I have seen examples but want to use the best practice and not sure which
one is best :)
Targetting Wicket 6.

Here's my first HTML prototype: 
https://gist.github.com/**4453776https://gist.github.com/4453776
I plan to remove the jQuery dep, externalize CSS style, and create two
components - EditableLabel and EditableLink.

Thanks,
Ondra


--**--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org







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



Re: Help with creating an AJAX-enabled component - EditableLink and EditableLabel

2013-01-08 Thread Ondrej Zizka
Ok, I stared at the code for a little longer and realized that I can use 
the same principle - simply send the value to server, and return back 
the new model value (most likely the same value).


Still, any comments below welcome :)
And, what would change if I wanted this also for Wicket 1.5? So far, I 
the only difference I see is manual addition of jQuery and slightly 
different response.render* calls.


Thanks,
Ondra



On 01/09/2013 06:23 AM, Ondrej Zizka wrote:
I've looked at it, and the communication there revolves around JSON 
sent for the component to show tags.

I haven't found how to send the HTML of the element.

Maybe I understand the concept wrong.
FWIK, Wicket has a small lib on client side which replaces HTML of 
elements which are added to target.

Is that true? And is this rendering of HTML done automatically?
Was this mechanism changed significantly in Wicket 6?

And how about the jQuery  Wicket integration.
I've read briefly in What's new in Wicket 6 that it has built-in jQuery.
Does that mean that I can use jQuery (as in the example you gave) and 
not care about including it?


Sorry if I ask what was posted somewhere, I'm watching few frameworks 
(of which Wicket is my favorite ;) and lost track a bit...



Also: Is the best way to use Panel as a base class?


Thanks,
Ondra



On 01/05/2013 09:24 AM, Martin Grigorov wrote:

Hi,

Recently I had to make an EditableLabel that does most of the work on 
the
client side, i.e. it notifies the server with Ajax call only when the 
value

is changed.
I used
https://github.com/caphun/jquery.inlineedit/blob/master/jquery.inlineedit.js 
(I

simplified it for our needs) for that.
The Wicket component just uses a custom implementation of
AbstractDefaultAjaxBehavior. I pass the behavior's callbackUrl to the
JavaScript plugin options  and then in JS's save method I used it to 
make

the Ajax call with the new value of the label.

I cannot share this code with you.
But you can take a look at
https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/autocomplete-tagit-parent/autocomplete-tagit/src/main/java/org/wicketstuff/tagit/TagItAjaxBehavior.java. 


It does something similar.


On Fri, Jan 4, 2013 at 6:34 PM, Ondrej Zizka ozi...@redhat.com wrote:


Hi all,

I am creating an editable label and link which better suits my needs 
than

existing EditableLabel.
Anyone willing toguide me a bit?

Basically, what I needto know, is how to properly ajaxify 
it.Precisely, to
allow events to be sent to the server, and to re-renderusing the new 
model

state.
I have seen examples but want to use the best practice and not sure 
which

one is best :)
Targetting Wicket 6.

Here's my first HTML prototype: 
https://gist.github.com/**4453776https://gist.github.com/4453776

I plan to remove the jQuery dep, externalize CSS style, and create two
components - EditableLabel and EditableLink.

Thanks,
Ondra


--**--**- 

To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org

For additional commands, e-mail: users-h...@wicket.apache.org







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




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



Re: Help with creating an AJAX-enabled component - EditableLink and EditableLabel

2013-01-05 Thread Martin Grigorov
Hi,

Recently I had to make an EditableLabel that does most of the work on the
client side, i.e. it notifies the server with Ajax call only when the value
is changed.
I used
https://github.com/caphun/jquery.inlineedit/blob/master/jquery.inlineedit.js (I
simplified it for our needs) for that.
The Wicket component just uses a custom implementation of
AbstractDefaultAjaxBehavior. I pass the behavior's callbackUrl to the
JavaScript plugin options  and then in JS's save method I used it to make
the Ajax call with the new value of the label.

I cannot share this code with you.
But you can take a look at
https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/autocomplete-tagit-parent/autocomplete-tagit/src/main/java/org/wicketstuff/tagit/TagItAjaxBehavior.java.
It does something similar.


On Fri, Jan 4, 2013 at 6:34 PM, Ondrej Zizka ozi...@redhat.com wrote:

 Hi all,

 I am creating an editable label and link which better suits my needs than
 existing EditableLabel.
 Anyone willing toguide me a bit?

 Basically, what I needto know, is how to properly ajaxify it.Precisely, to
 allow events to be sent to the server, and to re-renderusing the new model
 state.
 I have seen examples but want to use the best practice and not sure which
 one is best :)
 Targetting Wicket 6.

 Here's my first HTML prototype: 
 https://gist.github.com/**4453776https://gist.github.com/4453776
 I plan to remove the jQuery dep, externalize CSS style, and create two
 components - EditableLabel and EditableLink.

 Thanks,
 Ondra


 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/