You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Romanowski, Tim" <ti...@lmco.com> on 2006/05/05 21:43:21 UTC

All actions replaced by link to current page

I have a JSF page with a datatable and several
commandLinks/popups/commandButtons in it.  When I access the page,
everything is displayed fine, but ALL links in the datatable link to the
current page; that is, when I view the source code of the page on a
client, everywhere there is an action, it reads:
 "action="MyWebAppRoot/mysubdirectory/myJSFPage.faces"


I have a JSCookMenu at the top of the page, and the menu works fine
(that is, clicking on a menu item brings me to the expected new page).
This problem also occurs on other JSF pages, such as one that is simply
a login page with a form having a couple input textboxes and a submit
button...the submit action returns to the same page.

The following is an example:

<h:form>
	<h:panelGrid columns="2" border="0">
		<h:outputLabel value="Enter some text:" />
		<h:inputText id="someText"
value="#{myFormBean.someText}" size="25" />
	</h:panelGrid>
	<t:commandButton action="goToNewPage" value="Submit" />
</h:form>


Why are these actions (such as "goToNewPage") getting replaced with the
path to the current page (such as
"MyWebAppRoot/mysubdirectory/myJSFPage.faces")?
I'm using the myfaces-impl 1.1.4 snapshot and the tomahawk 1.1.3
snapshot from May 1st.  Does anyone have insight into what is going on?


T.R.




Re: All actions replaced by link to current page

Posted by Matthias Wessendorf <ma...@apache.org>.
> Why are these actions (such as "goToNewPage") getting replaced with the path
> to the current page (such as
> "MyWebAppRoot/mysubdirectory/myJSFPage.faces")?

Well, using UICommand (Button/Link) everything is post-back (going to
"full" JSF lifecycle). This means the request is "submitted" back to
the page. Depending on your action-outcome the new page is rendered.
Keep in mind, that those links (commandLink) are not bookmarkble.

Using h:outputlink, will cause a non-post-back request (just like
typing the URL in your browser's address bar). Non-post-back-requests
will not go through the complete phases of the JSF lifecylce (only 1
and 6 are invoked)

What you can do is to add a nice "debug phase listener" to you
application, and you'll see what's happening inside JSF ([1]) :-)

HTH,
Matthias

[1] http://tinyurl.com/gwfbx