Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-07-12 Thread Ballist1c
Absolute Genius thanks for covering this!!! you guys have saved me alot of time :) Matej Knopp-2 wrote: As far as I know id is a property of DOMElement, so there should be no need to call setAttribute. -Matej On 6/24/07, Peter Thomas [EMAIL PROTECTED] wrote: On 6/24/07, Peter

[Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Peter Thomas
Hi, I'm trying to create a kind of expression builder UI, so I was thinking of a ListView and there is this add button on the page that will add an item to the List. I am able to do this over Ajax, and I am aware that to refresh a ListView over Ajax, you have to target a container of the

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Matej Knopp
You can create the DOM element using custom javascript (it's very simple, basic DOM manipulation) invoked from ajaxRequestTarget.prependJavascript(). Be sure that the id attribute of new DOM element is same as new list item id. Then just render the newly created item (target.addComponent) which

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Timo Rantalaiho
On Sun, 24 Jun 2007, Peter Thomas wrote: I haven't used repeaters that much, but would newItem() be the right way to create a new Item? Anyway, I am now stuck because to ensure that the id of the DOM element is same as the newly created item, I have to call getMarkupId() on the item then I

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Peter Thomas
On 6/24/07, Matej Knopp [EMAIL PROTECTED] wrote: You can create the DOM element using custom javascript (it's very simple, basic DOM manipulation) invoked from ajaxRequestTarget.prependJavascript(). Be sure that the id attribute of new DOM element is same as new list item id. Then just render

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Timo Rantalaiho
On Sun, 24 Jun 2007, Timo Rantalaiho wrote: Maybe you can override getMarkupId() for your item components to return e.g. myId + domainObject.getdId() or something myId- + domainObject.getId() surely. - Timmo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Peter Thomas
On 6/24/07, Timo Rantalaiho [EMAIL PROTECTED] wrote: On Sun, 24 Jun 2007, Peter Thomas wrote: I haven't used repeaters that much, but would newItem() be the right way to create a new Item? Anyway, I am now stuck because to ensure that the id of the DOM element is same as the newly created

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Matej Knopp
There's nothing javascript heavy on this :) You add new item like this: String id = rv.newChildId(); Item item = rv.newItem(id, index, model); rv.populateItem(item); rv.add(item); (where rv is the refreshing view. Some of the methods might be protected, so you will need to subclass the view, but

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Peter Thomas
On 6/24/07, Matej Knopp [EMAIL PROTECTED] wrote: There's nothing javascript heavy on this :) You add new item like this: String id = rv.newChildId(); Item item = rv.newItem(id, index, model); rv.populateItem(item); rv.add(item); (where rv is the refreshing view. Some of the methods might be

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Matej Knopp
As far as I know id is a property of DOMElement, so there should be no need to call setAttribute. -Matej On 6/24/07, Peter Thomas [EMAIL PROTECTED] wrote: On 6/24/07, Peter Thomas [EMAIL PROTECTED] wrote: On 6/24/07, Matej Knopp [EMAIL PROTECTED] wrote: There's nothing javascript heavy

Re: [Wicket-user] Adding item to ListView over Ajax - refresh only newest row

2007-06-24 Thread Peter Thomas
On 6/24/07, Peter Thomas [EMAIL PROTECTED] wrote: On 6/24/07, Matej Knopp [EMAIL PROTECTED] wrote: There's nothing javascript heavy on this :) You add new item like this: String id = rv.newChildId(); Item item = rv.newItem(id, index, model); rv.populateItem(item); rv.add(item); (where