-
1. Re: clickable dataTable: DataModelSelection or method parame
pmuir Nov 24, 2007 2:06 PM (in response to mschmidke)I prefer page parameters over both.
@DataModelSelection is a concept from very early Seam (pre 1.0), whilst page parameters came later, and later still parameterized EL. -
2. Re: clickable dataTable: DataModelSelection or method parame
mschmidke Nov 28, 2007 5:40 AM (in response to mschmidke)DataModelSelection - understood, thank you.
"pete.muir@jboss.org" wrote:
I prefer page parameters over both.
Page parameters is something I did not work with until now. I've read the documentation and try to understand. I am not sure if I understand the concepts behind it (and behind pages.xml at all).
I like Seam for it's effort to reduce xml (and it does a great job in this), so until now I did not understand why there comes a new file pages.xml into play.
I've used it one single time so far, because I needed a page action. That time, I did not understand why I should put something there (I even could have imagined a special page tag which does nothing but calling that action before rendering - with pages.xml, this is one more case of strange behind-the-scenes-magic which no follow up developer will understand on first look at sources).
With page parameters, there seem again to come a new kind of magic, parameters which jump into URLs where you cannot see at first sight where they come from.
Why would you prefer page parameters over EL parameters?
I still have the problem that I have two different, but similar tables on one page with similar action links. With EL parameters, I have one action method for both. Can I even do this with page parameters in an elegant way like this?
Marcus. -
3. Re: clickable dataTable: DataModelSelection or method parame
pmuir Nov 28, 2007 6:09 AM (in response to mschmidke)I prefer pages.xml as I find it cleaner and it produces bookmarkable links. We are considering making it possible to define in the facelets themselves.
Yes, take a look at the way seam-gen, seamdiscs or seampay works for using page parameters. -
4. Re: clickable dataTable: DataModelSelection or method parame
mschmidke Nov 28, 2007 6:40 AM (in response to mschmidke)"pete.muir@jboss.org" wrote:
Yes, take a look at the way seam-gen, seamdiscs or seampay works for using page parameters.
In the examples, I can see lots of<s:link action="disc"> <f:param name="discId" value="#{disc.id}" /> </s:link>
Am I right that, using the page parameter way, there is no automatic conversion? One more thing I liked about EL parameters was that Seam does some work for me (in it's DataModel implementation or so), so that my action code is fully object oriented (speaking in this example's words, my action would be able to work on disc objects, not on disc object's id).
Obviously, this way is not bookmarkable. But bookmarkability isn't necessary in every case.
Marcus. -
5. Re: clickable dataTable: DataModelSelection or method parame
damianharvey Nov 28, 2007 7:45 AM (in response to mschmidke)Two points that have got me recently around using the Extended EL for tables with navigation links:
1. Your list still needs to be annotated with @DataModel for the extended EL to pass the object. Otherwise it will be null.
2. In your pages.xml your navigation rule must have the from-action the same as it is specified in your page link eg.<navigation from-action="#{hotelBooking.selectHotel(hot)}">
Cheers,
Damian.