-
15. Re: booking demo on jBoss site
marius.oancea Oct 28, 2005 8:11 AM (in response to rdennett)Some peoples proposed to add a @Create annotated method where you call the findHotels() but I tried and I got strange errors (e.g. Duplicate id_0). The error seems random. Even worst, sometime it's working.
Any other solution? -
16. Re: booking demo on jBoss site
gavin.king Oct 28, 2005 8:21 AM (in response to rdennett)How to eliminate the Find button in Booking example? To show hotel list by GET request directly, with @DataModel variable initialization.
The DVD Store example in CVS shows how to do this. -
17. Re: booking demo on jBoss site
alextemnokhod Oct 28, 2005 8:24 AM (in response to rdennett)I tried @Create method in HotelBookingAction class, but it isn't invoked when accessing #{hotels} variable and this variable remains uninitialized...
Generally, is it possible to trigger invocation of find() or other action method when user directly access jsf page (by typing URL in the browser, via GET request)? -
18. Re: booking demo on jBoss site
gavin.king Oct 28, 2005 8:35 AM (in response to rdennett)yes, look at the dvd store demo!
-
19. Re: booking demo on jBoss site
marius.oancea Oct 28, 2005 9:01 AM (in response to rdennett)You mean by using
<h:commandLink action="#{showorders.findOrders}" value="My Orders"/>
?
But this is also a kind of Search button. What to do if i have to present a table right after login? -
20. Re: booking demo on jBoss site
norman.richards Oct 28, 2005 9:21 AM (in response to rdennett)The DVD Store doesn't do this. I've yet to find a satisfactory way of doing this in Seam. Right now you can use @Create to populate an object, but it doesn't work will with @Out/@DataModel. You have to go back to #{bean.value}. I'm still searching for a reasonable way of doing this.
-
21. Re: booking demo on jBoss site
gavin.king Oct 28, 2005 9:31 AM (in response to rdennett)Hum, yes, I guess the interceptor stack is not called from the @Create method.
So we should try to figure out some way to allow a create method to be intercepted (icky).
I'll add that to JIRA. -
22. Re: booking demo on jBoss site
gavin.king Oct 28, 2005 9:42 AM (in response to rdennett)Actually I'm not so sure about that. EJB @Create methods still get intercepted, I suppose.
-
23. Re: booking demo on jBoss site
norman.richards Oct 28, 2005 10:00 AM (in response to rdennett)Yes, but how is the instance going to be created without an action call? You have to set up a fake property and access "#{mybean.nothingToSeeHere}" on your page. Then mybean will be created and properties will be outjected.
You also have the problem of not being able to talk conversationally to a component when you do that. As I recall (it's been a couple weeks since I've tried to work on this problem) because there is no action, the conversation is discarded at the end the request so you can't really work with a table model effectively. I'd have to play with it for a few minutes to remember the exact issues. But the net result was that it didn't work well. -
24. Re: booking demo on jBoss site
gavin.king Oct 28, 2005 10:56 AM (in response to rdennett)Basically the only problem I see here is that you are trying to outject a value without calling an action listener method.
As long as you have @Intercept(ALWAYS), there should be no problem doing this in a @Create method.
So this boils down to a problem of causing a component to be instantiated. Various options exist, including:
<% foo.noop(); %>
<% Component.getInstance("foo", true); %>
But it might make sense for us to create a custom tag like:
<seam:instantiate name="foo"/>
You could easily write such a custom tag yourself, all it needs to do is call Component.getInstance(name, true);
This should completely solve the problem, I suppose.
Another possibility would be for us to have the notion fof a Seam event listener that is called when a GET request occurs for a particular URL. JSF does not have this notion. Perhaps Seam could. -
25. Re: booking demo on jBoss site
norman.richards Oct 28, 2005 12:33 PM (in response to rdennett)I have been promoting the latter idea, which is to have some sort of implicit action invocation on a GET. But, the more I think about it, being able to reference components from your view (perhaps seam:require instead of seam:instantiate?) seems to enable more interesting functionality.
-
26. Re: booking demo on jBoss site
marius.oancea Oct 28, 2005 12:44 PM (in response to rdennett)Yes, are going in the direction of Micro~$1 and Sofia framework. I think is not a bad ideea to have such a tag.
<seam:require>serv1</seam:require>
<seam:require>serv2</seam:require>
...