This content has been marked as final.
Show 6 replies
-
1. Re: How to call a seam component method from a simple URL
swd847 Mar 16, 2009 8:41 AM (in response to kenclark)Use a page actions, configured through pages.xml
-
2. Re: How to call a seam component method from a simple URL
nordmeyer Jun 25, 2009 9:36 AM (in response to kenclark)I have a similar requirement.
Can you give an example?
Thanks,
Thomas -
3. Re: How to call a seam component method from a simple URL
swd847 Jun 25, 2009 9:46 AM (in response to kenclark)in pages.xml
<page view-id="/myview.xhtml" action="#{myComponent.myAction}" />
-
4. Re: How to call a seam component method from a simple URL
nordmeyer Jun 25, 2009 9:54 AM (in response to kenclark)Wow fast!
Mhm, and how would the URL look like?
Background is, that I want to call my app from outside passing a parameter.
CU,
Thomas -
5. Re: How to call a seam component method from a simple URL
kukeltje.ronald.jbpm.org Jun 25, 2009 10:41 AM (in response to kenclark)the URL would look like you want it to look like. The param is passed on as a generic request param, nothing special and you can retrieve that in your action.
You can find all this out by reading the docs, looking at examples, searching the forum etc...
-
6. Re: How to call a seam component method from a simple URL
nordmeyer Jun 29, 2009 4:11 PM (in response to kenclark)Thanks.
Although its not too difficult, I will describe how I solved my problem.
Thats how I did it:
(1) Implement action method to be called by URL (Component named "Suche"):
'
public void jumpIn() {
FacesContext context = FacesContext.getCurrentInstance();
searchText.setObject(context.getExternalContext().getRequestParameterMap().get("searchtext"));
Events.instance().raiseEvent(MewacatEvents.DATA_UPDATED_HEADING);
}
'
(2) configure in pages.xml as Ronald explained:
`
<page view-id="/pages/suche/jumpin.xhtml" action="#{Suche.jumpIn()}" login-required="true" >
<navigation>
<redirect view-id="/pages/suche/suche.xhtml"/>
</navigation>
</page>
`
(3) Call by URL
`
http://myhost.com:8060/mewacat/pages/suche/jumpin.seam?searchtext=molle
`