-
1. Re: Very very Newbie question about datamodel
js8523 Dec 27, 2005 4:06 PM (in response to shinerella)Try using
<h:outputText value="#{g.code}" />
instead, i've had a strange problem with trying to directly use#{g.code}
before.
James
-
2. Re: Very very Newbie question about datamodel
gavin.king Dec 28, 2005 10:01 AM (in response to shinerella)Right, you cannot use #{foo} in a JSP page. You have to use <h:outputText/>.
The examples which show a naked #{foo} only work in facelets.
One of the many reasons why JSP is bad and should be deprecated :)
But the original poster says she is using facelets, so this is not the problem, I guess. -
3. Re: Very very Newbie question about datamodel
gavin.king Dec 28, 2005 10:03 AM (in response to shinerella)By the way, the code looks basically correct.
It might be a good idea to try with the current CVS version of Seam. -
4. Re: Very very Newbie question about datamodel
marobashi Dec 28, 2005 10:22 AM (in response to shinerella)Shinerella, I did a good amount of debugging like this on my own app... trying to figure out why things don't work.
Is it that your table is being rendered but the data fields don't show up, or is your table not rendered at all?
One thing I did in debugging is to put a lot of log.info statements in some critical areas... maybe put one after your "groups=session.createCriteria..." that says:
log.info(groups.size() + " groups returned by criteria query.");
(You'd have to define the logger, of course, but the example app shows this I believe.)
That'll at least tell you whether you actually have groups in your list... -
5. Re: Very very Newbie question about datamodel
shinerella Dec 28, 2005 10:52 AM (in response to shinerella)ok, this is the thing gavin.King, SORRY i wrote jsp because I was very used to it, but im using facelets now, should have wrote xhtml page instead.
Indeed, today Im trying the new version of seams and the error log is :
12:42:21,984 WARN [VariableResolverImpl] Variable 'caroGroups' could not be resolved.
12:42:22,265 WARN [VariableResolverImpl] Variable 'groups' could not be resolved.
thank u both for your answers!! I already tried the <h:outputText> tag, but I did not have the expected results yet, im trying other things out, if i find my error I will post it back :) -
6. Re: Very very Newbie question about datamodel
shinerella Dec 28, 2005 1:32 PM (in response to shinerella)Marobashi
* Into my groups this is what I have in running Time:
(setting a breakpoint on the following return statement and inspecting what "groups" contents after the session.createCriteria)
groups = ArrayList
- elementData=Object[10]
- CAROTypeGroup
+ code="NAME001"
+ subTypes=PersistenceSet(id 602)
+ description="description 1"
+ id="id001"
- CAROTypeGroup
+ code="NAME002"
+ subTypes=PersistenceSet(id 603)
+ description="description 2"
+ id="id002"
... etc
So As u can see... I have a list of caroTypegroup, and those objects have atributtes like "code", "description", etc...
What I think is may be that somehow the variables are no longer in Scope so that's why them cannot be resolved... but why?
I already changed the "Begin" of the conversation to the Method findCaroGroups() where I set the value to groups ... but anyway... not good results yet -
7. Re: Very very Newbie question about datamodel
shinerella Dec 28, 2005 2:12 PM (in response to shinerella)And finally my problem solution is:
The@Factory anotation is needed, this is not found in the old doc, i guess..@Begin @Factory("groups") public String findCaroGroups() { groups = session.createCriteria(caroTypeGroup.class).list(); return "success"; }
thanks ivan :) -
8. Re: Very very Newbie question about datamodel
marobashi Dec 28, 2005 2:31 PM (in response to shinerella)Shinerella, what are you seeing as output?
1) Table headings and empty boxes where the data should be.
2) Table headings but no rows
3) No table at all
If 3, do you have any other output on the page, and are you seeing that? (Like a <h1>Here are your CAROGroups:</h1> before the dataTable snippet you sent...)
Also, the example HotelBookingAction doesn't use @DataModelSelection... just @DataModel and @DataModelSelectionIndex. I attempted to duplicate what you're doing in a working application that I have, by adding a @DataModelSelection tag and associated object. My table showed up ok, but when I attempted to click any of my subsequent conversation methods (or even cancel, to end the conversation) I received an error.
This very well could be due to my own stupidity somewhere in my code, but when I removed @DataModelSelection and the defined object, my application started working again.
Again, this doesn't seem to explain why your data isn't showing up... but I'd be curious to see what happens if you remove that DataModelSelection tag.
You'd have to change your setCaroGroup to:public String setCaroGroup() { group = groups.get(groupsIndex); return "success"; }
-
9. Re: Very very Newbie question about datamodel
marobashi Dec 28, 2005 4:43 PM (in response to shinerella)Why is the factory annotation required on the DataModel here but not when filling the hotels DataModel in the booking example? Is it because of a difference in the application deployment context, how the find() method is initially invoked, or something else?
... batting 1000 today... if these problems were pinatas, I'd be going home with no candy.
Any feedback would be welcome.
Thanks,
Eric -
10. Re: Very very Newbie question about datamodel
gavin.king Dec 28, 2005 7:38 PM (in response to shinerella)@DataModelSelection is working perfectly for me in the demo apps in CVS. It may not have been working in the 1.0 beta 1 release.
See, for example, BookingListAction in the booking demo.
The reason why @Factory is sometimes needed, and sometimes not is that.
(1) Sometimes we are processing a faces postback (ie a action listener invocation), so the action listener prepares the data in the DataModel.
(2) Sometimes we are processing non-faces HTTP GET request, and so no action listener has been invoked and we need to prepare the data during the RENDER_RESPONSE phase.
In case (1), all you need is an action listener marked @Begin. In case (2) you need an @Factory @Begin method.
Hope that is clear. -
11. Re: Very very Newbie question about datamodel
marobashi Dec 29, 2005 8:28 AM (in response to shinerella)Thank you very much for the response. I appreciate your willingness to take time out to help a struggling newb along.
-
12. Re: Very very Newbie question about datamodel
shinerella Dec 30, 2005 1:28 PM (in response to shinerella):) thanks !!!!