Rahul Rajagopal wrote:Hi Wouter ,
I am sorry, you cannot pass parameters like that , it's wrong.
It's wrong in the sense that
JSF is a Model/View/Controller architecture, and the View has no business having any logic on it that doesn't directly impact the view. Otherwise the lines between Model, View and Controller get muddied and you lose its advantages - including knowing where to look when it comes time to maintain it.
JSF1 didn't permit parameterized EL at all. JSF2 relaxes some of those limitations, but that doesn't mean they should be abused any more than the fact that there are are at least 2 different ways to code loops on a JSF View means that
you should use looping to do things that a dataTable was meant to do.
Very specifically, you can't call methods - with or without parameters - from a JSF view. You can reference properties, but properties, by definition don't take parameters because they are data references (subscripts and sub-properties don't count as parameters). In JSF1, action methods couldn't take properties, either.
In JSF 2, like I said, there are more options, but a View can't go calling methods right and left. Discounting any AJAX stuff going on, a View just sits there until you fire off an action. And unless you bind listeners, only one action can fire per request.
So yes, it's wrong, and not just because EL isn't co-operating.