what you want is a lot closer to how gwt works then to how wicket works:a
widget that manages its own domstate on the client, and when a change occurs
notifies the server.

this is how a wicket ajaxified widget would work:

all your render logic would be in your component (serverside), that can
embed the listview or another repeater. when a link is clicked the data is
submitted via ajax, and you repaint the entire component (partial page
render) via wicket-ajax support. this is how wicket-ajax works. the big
advantage of this approach is that you can take pretty much any server-side
component and "ajaxify" it without the component knowing. it still renders
as usual, but that render output is captured and swapped on the client. like
it or not, it is what it is.

now what you want is to skip the whole wicket-partial-page update. what you
want is to write your own javascript which will handle the dom state of your
widget, and to have a simple callback to the server to keep the state in
sync. this is pretty easy to do, but not what wicket-ajax support was
designed to do. you can use any third party js ajax lib to do this. in
wicket-examples we have an example of ajax callbacks using prototype.

i dont know what parts of wicket you do not think are "javascript friendly",
but i think you just misunderstand how wicket-ajax works. the entire
wicket-ajax api is built using open wicket api, so there is really nothing
stopping you from rolling something of your own that works a lot closer to
how you want it. it is not wicket's job to generate javascript or provide
you with javascript util libs to make dom manip easier, that is what third
party js libs are for.

makes sense?

-igor


On 4/12/07, Alexei Sokolov <[EMAIL PROTECTED]> wrote:

Hello guys,

I have a question about designing ajax/javascript widgets using wicket.
Here is my problem:

I have a form, which I submit using ajax submit button and I have a list
view like this:

<ul>
  <li wicket:id="item">blah</li>
</ul>


What I want to do is:
- add a new <li> element to the list (but don't change other DOM nodes in
the document)
- call a javascript function to apply some visual effects to the item

I want a similar method for removing items from the list, updating items,
etc.

How do I design such widget?

Thank you,
Alex


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to