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 rv is the refreshing view. Some of the methods might be
> protected, so you will need to subclass the view, but you have to do
> it anyway, as you need to implement populateItem);
>
> after you call rv.add(item) you can call item.getMarkupId();
>
> Creating DOM in javascript is simple:
>
> var div = document.createElement("div");
> refreshingViewContiner.appendChild(div);
> div.id = <id>
One more thing Matej - last line above you meant div.setAttribute('id',
<id>) right? Or is there some js foo I should know about?
-Matej
Just as I was thinking Wicket was not so perfect for Ajax...
It works! Thanks Matej :) I really did need that guidance on
constructing and adding new item to RefreshingView. And of course now I get
why ListView would not have worked.
On 6/24/07, Peter Thomas <[EMAIL PROTECTED]> wrote:
> > 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 item, I have to call
> > > > getMarkupId() on the item then I get the exception "This component
> is
> > not
> > > > (yet) coupled to a page" Help!
> > >
> > > Are you sure it's going to be a problem to update the whole
> > > Repeater? Because if not, your whole work of dynamic DOM
> > > appending might turn out to be premature optimisation.
> >
> > Agreed, I'm now curious to see how far I can get, and I may not
> actually use
> > a javascript heavy approach in the end. Also I've created a decent
> size app
> > using only ListView (including a custom datatable with pagination) and
> am
> > curious to know what the other repeaters ( e.g. RefreshingView) have
> to
> > offer.
> >
> > Also searching Nabble I see that someone else had some success, not
> sure if
> > this is the same approach:
> >
> http://www.nabble.com/treetable-with-table-markup-tf3557655.html#a9974461
> >
> > > Maybe you can override getMarkupId() for your item components
> > > to return e.g. "myId" + domainObject.getdId ()" or something
> > > such.
> > >
> > > (Btw, now that we're on it, all-numeric ids that repeaters
> > > produce by default are invalid HTML. Maybe I should file a
> > > Jira issue about that.)
> > >
> > > - Timo
> > >
> > > --
> > > Timo Rantalaiho
> > > Reaktor Innovations Oy <URL: http://www.ri.fi/ >
> > >
> > >
> >
> -------------------------------------------------------------------------
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
> -------------------------------------------------------------------------
>
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user