-
1. Re: DataModelSelection not getting populated
gavin.king Feb 18, 2008 2:04 PM (in response to dam)That's just the normal behavior. <s:link view=... is intended to give nice, elegant URLs. <s:link action=... is intended as an alternative to a <h:commandLink/>, that handles
Open in new window
correctly.Personally, I don't really much like <s:link action=... anymore.
-
2. Re: DataModelSelection not getting populated
cpopetz Feb 18, 2008 2:37 PM (in response to dam)
Gavin King wrote on Feb 18, 2008 02:04 PM:
Personally, I don't really much like <s:link action=... anymore.Really? Could you elaborate? How do you recommend handling the situation where one wants a link that (a) executes something before rendering a new view and (b) supports open-in-new-window? I realize the target page can have a <page> action, but I occasionally need to trigger behavior based on where I am, i.e. the transition from page A to page B needs to do something, and page B doesn't really know about it, so I'd rather not stick it in its action, and putting a <navigation-case> to fire an event is kind of overkill in that case. (At that point, I've also just traded polluting B with knowledge of A for polluting B's <page> entry with knowledge of A.) Using s:link with action= also gives me the ability to choose the target view with some action logic based on the row of the data table I'm in, which is really nice.
I suppose one should argue that links in web pages shouldn't do something like this, because users don't expect links to trigger behavior. But I work with people that mock up web pages to do things like that all the time.
Thanks for any guidance you can give on this topic. Seam is a great framework, but it has a lot of ways to accomplish the same thing (which I enjoy, but then, I'm also a perl programmer), and I'm still trying to grasp its best practices.
-
3. Re: DataModelSelection not getting populated
dam Feb 18, 2008 2:40 PM (in response to dam)May I ask why you don't like them?
-
4. Re: DataModelSelection not getting populated
christian.bauer Feb 18, 2008 2:51 PM (in response to dam)The s:link action="foo" is evil because it encourages that you modify state on the server with a GET request. Such a request is supposed to be repeatable (bookmarkable), and POST/PUT/DELETE are correct requests for modifying resource state on the server.
The only situation in which I think s:link action="foo" might be OK is when
foo
actually is a simple outcome (not a Java method that modifies state) that is mapped to a redirect response (which triggers another, repeatable GET request) in pages.xml. -
5. Re: DataModelSelection not getting populated
gavin.king Feb 18, 2008 3:42 PM (in response to dam)
How do you recommend handling the situation where one wants a link that (a) executes something before rendering a new view and (b) supports open-in-new-window?Use a page action.
I realize the target page can have a <page> action, but I occasionally need to trigger behavior based on where I am, i.e. the transition from page A to page B needs to do something, and page B doesn't really know about it, so I'd rather not stick it in its actionThat sounds like really, really non-semantic use of HTTP. Don't do this.
Seam is a great framework, but it has a lot of ways to accomplish the same thing (which I enjoy, but then, I'm also a perl programmer)Yes, this is a fair criticism of Seam. I regret adding certain features, because of this.