I try to describe my use case.
 
I am trying to do a generic, DataView based table edit component (or a set of components). The table has max one row in edit mode at a time. First time there are no rows in edit mode. Every row has buttons to edit, copy and delete. When user clicks edit, table is shown with the selected row in edit mode with no edit/copy/delete buttons, but ok/cancel buttons instead. All buttons in other rows are disabled. When user clicks ok or cancel, action is processed and all rows are back to normal state. Copy is similar to edit but the selected row is shown two times, normal and edit mode. Delete is normal mode with ok/cancel buttons.
 
And of course, using the component has to be generic and easy, and edit cells has to be able to contain any kind of complex editors with ajax stuff.
 
When using Panels, user of the component has to create separate html files for the edit row and the view row. It is little bit hard to design layout when html is cluttered in many files. If each cell is a Panel, then the table layout can be designed but there will be two html files for each cell.
 
Another way is to create the view and the editor in each cell and use setVisible() to hide the other one. This way the layout design is easier, but use of the component is not so straigthforward and also there will be a lot of unnecessary components created. For a table with 10 columns and 40 rows it will make 400 components with their models.
 
Well, I think I will take a different route. A separate component for the editor and view. View loops the rows and edit row component will have onload-_javascript_ to move it into right position in the table.
 
/arto

 
2005/10/8, Juergen Donnerstag <[EMAIL PROTECTED]>:
My first thoughts are that it is not easy to implement, but prior to
thinking it through I'd realy like to understand the use case. To my
understanding the main reason is to reduce the number of <panel>.html
files and may be to reduce the number of instantiated Panel components
in case there is only one of a few visible. But how much does that
matter? How much does it improve spead, memory usage, usability? If
memory usage does matter (IMO it doesn't in this case), I was thinking
about a kind of component reference which lazy loads / instantiates
the real component. But in any case, it is worth a RFE.

Juergen

On 10/8/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> I don't know how difficult that (panels in same markup) is. You're not
> the first to ask though. Juergen, if you're reading with us, what do
> you think of this RFE? Do you think it is doable or is it going to be
> a lot of work? I can see it can be convenient for several cases.
>
> Eelco
>
>
> On 10/8/05, Arto Arffman <[EMAIL PROTECTED]> wrote:
> > If I understand it right, Panels are the easiest way to include conditional
> > blocks of html into a page. Well, I hate to make a html template for each
> > Panel separately. It would be nice if you could define the template inside
> > the page's template, like this:
> >
> > <html>
> > some  normal stuff
> > <span wicket:id="somePanel">
> >
> >    <wicket:panel name="viewSomething>
> >        <span wicket:id="something">Something comes here</span>
> >    </wicket:panel>
> >
> >    <wicket:panel name="editSomething>
> >        <input type="text" wicket:id="something">
> >    </wicket:panel>
> > </span>
> >
> > And then you would create your panel like this:
> > Panel p = new Panel("somePanel", "viewSomething");
> > p.add(new Label("something", mymodel));
> > or
> >
> > Panel p = new Panel("somePanel", "editSomething");
> > p.add(new TextField("something", mymodel));
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to