Great! Thanks for this. Very helpful!

This does give a lot of ideas, indeed. If my understanding is correct,
this would indeed provide a very elegant solution to what we're trying
to do.

One precision:


> you have to decide what is clearly "business logic" vs "ui logic". the
> business logic should go into a separate
> service/controller/whatchamaggicit. the ui logic is best embedded in
> wicket components because each component is a full implementation of
> MVC already. 

This is actually something I'm kinda struggling with.

In our model, the "biz logic" is the query. So, for instance, if I have
two radios and a group of checkboxes:

( ) Any colour
( ) Choose colours
      [ ] Blue
      [ ] Red
      ...

If "Any colour" is chosen, then this produces one kind of query (where
choosing colours is irrelevant). In that case, the checkboxes must be
disabled. However, if "Choose colours" is chosen, colours become
relevant, so the checkboxes are activated.

So, is this "biz" or "ui" logic?

Or, worded differently, does this go into the controller or directly
into the wicket component?


> it would be a good idea if you can initialize some state off the
> pageparameters, be that business state or ui state or both. that way
> you can retain bookmarkability. 

Just to confirm:

We would not be _required_ to use PageParameters. Having a lightweight
bean would allow us to "save" the state of the bean in the model, and
therefore to the PageMap, right?

But, using PageParameters would give us the option of making pages
bookmarkable, right?


In either case, this approach is still valid, so it seems.


Another question:

Say we do want to keep our pages bookmarkable, but we don't want to have
to encode everything in the URL. Say also we don't want to use a db on
the backend. Would it be appropriate to save the beans to the wicket
session?

If so:

  1. What is an elegant way of doing this? Just a Map(id, object)
     that is accessed by the controller?

  2. Is there anything to watch out for? (Such as the map growing to
     an incredible size, for example)



> 
> i think a lot of users underestimate the power of IModel when you
> implement it directly.

<snip>


> now all you have to do is
> 
> LoadableDetachableModel person=new LoadalbeDetachableModel(id);
> new CheckBox(this, "cb", new PersonCheckBoxModel(person)); 
> 
> and everything magically works, hope it gives you some ideas.

Very interesting!

I'll have to give this a try.


Thanks again!
Dave





-------------------------------------------------------------------------
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to