myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Behrang Saeedzadeh" <>
Subject Re: commandLink problems - once again - this time with selectOneMenu!
Date Wed, 20 Dec 2006 23:00:09 GMT

> JSF ensure you that never a bean value is set to something invalid. That
> is why, before calling the setters, the full form goes throught
> validation. And for me, it seems natural that if i put a component in a
> form is telling 'select between X, Y and Z', the framework does never
> call bean.setSelectedItem('A'), as A is not in the list. Now i agree in
> your case you need to prevent double trip to database. Then put list in
> another scope than request one.

That would make the items remain in memory far longer than they are
actually needed to be. I was hoping to avoid the session.

> Btw, i see you are working in two steps action "init" -> show form ->
> "action select". If you handle your list initialisation differently, you
> can remove the 'init' step, which is typical to struts imho.

Could you please explain a little more?

> Huh, wait a moment, you want to
> keep serializable data between render and action? Great, thats the job
> of <t:saveState/> if am not wrong! Of course because those values
> transit by client, you can not trust them anymore, but if, as you said,
> you want to do validation in action...

Yeah. I tried t:saveState. It worked great for me. Thanks for the tip :-)


"Science is a differential equation. Religion is a boundary condition"
- Alan Turing

Behrang Saeedzadeh

View raw message