You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ur...@bluemail.ch on 2005/10/25 01:28:52 UTC

command button for link

What is the correct usage of command button for a link?

<h:commandButton action="/regpart.jsf" value="#{agency.lwbackword}" />

does not work.


Re: command button for link

Posted by ur...@bluemail.ch.
Thank You, I have recognized that it works through faces-config.xml. 
Your solution is more elegant. 
I have coded an additional bean method

class RegBean { 

...

String regpart() {

   return "regpart";

}

Then I could code in JSF

<h:commandButton action="#{Reg.regpart}" value="#{agency.lwbackword}" />

>-- Original-Nachricht --
>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>Date: Tue, 25 Oct 2005 15:15:39 +0200
>From: Marius Kreis <ma...@nulldevice.org>
>To: MyFaces Discussion <us...@myfaces.apache.org>
>Subject: Re: command button for link
>
>
>The parameter action="somewhere" is referring to an <from-outcome> 
>defined in your faces-config.xml, therefore you can't directly address 
>your regpart.jsf.
>A navigation rule like
>
>	<navigation-rule>
>  		<from-view-id>*</from-view-id>
>		<navigation-case>
>			<from-outcome>regpart</from-outcome>
>			<to-view-id>/regpart.jsf</to-view-id>
>			<redirect />
>		</navigation-case>
>	</navigation-rule>
>
>with an commandButton like
>
><h:commandButton action="regpart" value="your text"/>
>
>should work.
>
>urswagner@bluemail.ch wrote:
>> What is the correct usage of command button for a link?
>> 
>> <h:commandButton action="/regpart.jsf" value="#{agency.lwbackword}" />
>> 
>> does not work.
>> 
>> 
>


Re: command button for link

Posted by Marius Kreis <ma...@nulldevice.org>.
The parameter action="somewhere" is referring to an <from-outcome> 
defined in your faces-config.xml, therefore you can't directly address 
your regpart.jsf.
A navigation rule like

	<navigation-rule>
  		<from-view-id>*</from-view-id>
		<navigation-case>
			<from-outcome>regpart</from-outcome>
			<to-view-id>/regpart.jsf</to-view-id>
			<redirect />
		</navigation-case>
	</navigation-rule>

with an commandButton like

<h:commandButton action="regpart" value="your text"/>

should work.

urswagner@bluemail.ch wrote:
> What is the correct usage of command button for a link?
> 
> <h:commandButton action="/regpart.jsf" value="#{agency.lwbackword}" />
> 
> does not work.
> 
>