Hi Ned,
thanks for your reply. I agree with your point of view. Today, however,
we got bitten because the designer wanted to change all buttons by
hiding them with jquery, and adding an anchor right after it in the
dom-tree, so he could style them the way he wanted it (not possible with
buttons he tells me).
You can see his lovely button on this page:
http://sd.tornado.no/domorder/search/query/testdomain
The way he then triggered the submit buttons is with the following
Jquery code:
$('.btn.submit').click(function(){
$(this).prev().click();
});
This works most of the times, but sometimes, when the wicket ajax stuff
includes references to 'this', the approach doesn't work, and wicket
tells me that the ajax request was stopped 'because of precondition'.
That's when he started bitching about the Wicket way of inlining
JavaScript, so I thought I'd be nice to hear some opinions :))
-- Edvin
Ned Collyer skrev:
Hi Edvin,
I am an advocate of JQuery :). I even won their icon design contest, and
I've been using it for years! I think it should be used in all projects
that require effects or cool DOM manipulation.
I love the "unobtrusive way" and xhtml strict!
That being said, when it comes to wicket AJAX - just use the wicket ajax and
be done with it. No point mucking with something thats already excellent.
It works and its easy. Why reimplement that bit - and potentially open up
bugs that you need to go debug.
For effects and DOM manipulation, you can use JQuery by adding header
contributors. It is cleaner.. and in many instances easier to debug. It
makes development quick and painless.
If it wasn't wicket - id suggest using JQuery for ajax.
Edvin Syse wrote:
Hi,
I have a webdesigner who keeps harassing me with the way Wicket does
JavaScript, attaching behaviour to onclick events etc. instead of doing
it "the jquery way" of picking up the components and attaching the
events afterwards, thus keeping all the nasty bits away from the actual
markup.
Ofcourse the code looks a lot cleaner "the jquery way", and he tells me
that debugging and working with the code is also much easier. Personally
I don't know enough about html/javascript to decide what's the better
approach, but I just wanted to know if there are any plans to rework
this in Wicket, or if the current approach is just as good?
-- Edvin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]