Yes you will have to add the component, if your HTML template named one.

Regards
Dipu




On 8/9/07, Johan Maasing <[EMAIL PROTECTED]> wrote:
>
> Thank you for your replies. Yes I can create an empty "dummy" model if
> I fail to talk to the back-end, it also sounds like good practice to
> put that handling in the model.
> The basic question was more if I have understood the requirement to
> always add a component if the HTML-template named one. If so, if there
> was some pattern that had evolved for handling alternate or
> error-flows when building the component graph.
>
>
> On 8/9/07, Dipu Seminlal <[EMAIL PROTECTED]> wrote:
> > Can't you return Collections.EMPTY_LIST.iterator() from the dataprovider
> > when an exception happens
> > and also set the visibility of the data view based on the size -
> > dataview.setVisible(yourdataprovider.size()>0)
> >
> > Regards
> > Dipu
> >
> >
> > On 8/9/07, Johan Maasing <[EMAIL PROTECTED]> wrote:
> > >
> > > I am rather new to wicket, coming from a Tapestry angle. Anyway, my
> > > question is rather basic.
> > > I gather that all components on a page must be rendered?
> > > Suppose I have a common dataview with a dataprovider on a page, basic
> > > CRUD-stuff. My page constructor looks like this:
> > >
> > > try {
> > >    ...query the database and build the provider and dataview
> > > } catch (SQLException e) {
> > >   feedback.error("Very bad things happened");
> > >   // What to do here??
> > > }
> > >
> > > What is the best practice for removing/disabling components in the
> > > catch clause? I can not create the dataview (called "dataview" in the
> > > HTML) since the backend has died but wicket needs a component there?
> > >
> > > Currently I do somehting like this
> > >
> > > } catch (Exception e) {
> > >   add(new Label("dataview", "").setVisible(false));
> > > }
> > >
> > > and that works fine but it seems a bit un-DRY to have to add dummy
> > > components for the error case. Is my understanding correct?
> > >
> > > Cheers,
> > > /Johan
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to