-
1. Re: How to get a bookmarkable link
marcioendo.marcioendo.gmail.com Feb 16, 2009 12:36 PM (in response to tony.herstell1)Try adding to your 'Entry Page' pages.xml:
<param name="eventId" value="#{newsItemController.eventId}" /> <action execute="#{newsItemController.enter}" />
Of course you need the proper getter and setter for the eventId property in the newsItemController class.
-
2. Re: How to get a bookmarkable link
tony.herstell1 Feb 17, 2009 8:47 AM (in response to tony.herstell1)<page view-id="/pages/events/showEvent.xhtml" login-required="false" conversation-required="true"> <description>Reason: Show an Event (#{event.description}:#{event.id})</description> <param name="eventId" value="#{newsItemController.eventId}" /> <action execute="#{newsItemController.enter}" /> </page>
I added this but the eventId is null in the enter routine.
I am confused how it gets from the link to the code.
Please advise...
-
3. Re: How to get a bookmarkable link
marcioendo.marcioendo.gmail.com Feb 17, 2009 12:20 PM (in response to tony.herstell1)How are you accessing the URL?
Make sure you append the eventId at the end of the URL, something like:
http://www.selwynequestriancentre.co.nz/site/pages/events/showEvent.seam?eventId=9
-
4. Re: How to get a bookmarkable link
tony.herstell1 Feb 17, 2009 9:09 PM (in response to tony.herstell1)I am accessing the page like this:
<s:link value="#{messages.more_info}" action="#{newsItemController.enter()}" propagation="none" converter="javax.faces.Long"> <f:param name="eventId" value="1"/> </s:link>
-
5. Re: How to get a bookmarkable link
marcioendo.marcioendo.gmail.com Feb 18, 2009 3:27 AM (in response to tony.herstell1)
I am accessing the page like this:<s:link value="#{messages.more_info}" action="#{newsItemController.enter()}" propagation="none" converter="javax.faces.Long"> <f:param name="eventId" value="1"/> </s:link>
That's the thing, working with bookmarkable URLs means you have to change the way you manage your conversations.
You should probably:
- Remove the conversation-required from the pages.xml (there will be no long-running conversation if you access the URL from a bookmark);
- Change your <s:link> to something like:
<s:link value="#{messages.more_info}" view="/pages/events/showEvent.xhtml" propagation="none"> <f:param name="eventId" value="1"/> </s:link>
As the action is already defined in pages.xml.
- Change your @Begin annotation to @Begin(join = true), as the method will be called on each page request.
-
6. Re: How to get a bookmarkable link
tony.herstell1 Feb 18, 2009 3:41 AM (in response to tony.herstell1)Thank you.
I was trying very hard not to have XML all over again (I have done Spring and J2EE!)... ( I think Contectual Components (web beans) is heading back towards XML again :( )
I was trying very very hard to keep everything in the code (annotations) and el where possible.
It just seems wrong, to me, to put the action in the pages.xml; but you lot are the experts...
I have three entry points in the controller (all with @Begin and just adding ONE action in the pages.xml seems wrong and I don't even know if it will work:
It seem that this:
- Change your @Begin annotation to @Begin(join = true), as the method will be called on each page request.
will not work as.. the same method will be called on each page request!
-
7. Re: How to get a bookmarkable link
kukeltje.ronald.jbpm.org Feb 18, 2009 4:48 AM (in response to tony.herstell1)I use the pages.xml file rarely, only when I realy need it. so speaking of xml hell would be exaggerating (for me)
Regarding your issue of keeping things in one place: https://jira.jboss.org/jira/browse/JBSEAM-510
-
8. Re: How to get a bookmarkable link
marcioendo.marcioendo.gmail.com Feb 18, 2009 2:12 PM (in response to tony.herstell1)
I was trying very hard not to have XML all over again (I have done Spring and J2EE!)... ( I think Contectual Components (web beans) is heading back towards XML again :( )
I was trying very very hard to keep everything in the code (annotations) and el where possible.I understand what you mean. I also try to avoid XML whenever possible. What works for me, sorts of a compromise, is to stay away from the general pages.xml and use fine-grained xxx.page.xml for each view.xhtml. Though it might sound as a contradiction, as the number of .xml files increase, I actually find it more manageable: you have to manage the .xhtml anyways, so...
Ronald's suggestion in this case would be great.
It just seems wrong, to me, to put the action in the pages.xml; but you lot are the experts...That is what I meant by, to have bookmarkable URLs, you need to change how you manage your conversations.
You actually don't need to put the action in pages.xml, but then you need to refactor your newsItemController component. If you really need or want bookmarkable URLs, I'd suggest you use the EntityHome in a seam-gen sorts of way.
will not work as.. the same method will be called on each page request!You are right, my mistake. I usually start a conversation with:
<begin-conversation join="true" />
in a xxx.page.xml, so I was thinking of that.
Anyways, hope I was of any help.
-
9. Re: How to get a bookmarkable link
tony.herstell1 Feb 18, 2009 9:05 PM (in response to tony.herstell1)
Anyways, hope I was of any help.You were a great help.
With the seamsters all busy on Web Beans (Contextual Components) its up to us to answers each others questions for a while! (I assume the seamsters will fold back in Web Beans into the core of seam at some point and then be
back
). -
10. Re: How to get a bookmarkable link
tony.herstell1 Feb 18, 2009 9:07 PM (in response to tony.herstell1)I have all these to figure out yet!
http://www.seamframework.org/Community/EasyQuestionAboutLength
http://www.seamframework.org/Community/AndMovingForwardToJBossAS50GA
http://www.seamframework.org/Community/SeamEmailIn211GAEvenWorse
http://www.seamframework.org/Community/AynchMailSenderFailsButNormalDoesnt
http://www.seamframework.org/Community/SeamMailProblemNPE
http://www.seamframework.org/Community/MoreThanOneFactoryInAController
:)