You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2006/12/08 05:39:24 UTC
submit value by commandLink
Inside a form, there is an inputText and a commandLink. When a user clicks the commandLink, can the value in the inputText be submitted at the same time? The reason to use commandLink instead of commandButton is that commandLink can have params.
Thanks.
Dave
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.
Re: submit value by commandLink
Posted by David Chandler <da...@learnjsf.com>.
On 12/8/06, Dave <ja...@yahoo.com> wrote:
> But no modelUpdate phase is went through, and the backing bean binding value
> is not changed. If commandLink submit values like commandButton does, there
> should be a
> modelUpdate phase to update values. Thanks,
What happens if you simply change the word commandLink to
commandButton in your <h:commandLink tag>? Don't change anything else
in the tag. Does the model get updated then?
/dmc
Re: submit value by commandLink
Posted by Jeff Bischoff <jb...@klkurz.com>.
Simon Kitching wrote:
> BTW, immediate defaults to false for commandButton. I *think* it
> defaults to true for commandLink.
>
Actually, Simon, commandLink defaults to false also. :)
They both inherit the property and the default setting from
javax.faces.component.UICommand.
From Sun's Javadoc [1]:
"The default value for this property must be false."
From the current impl [2]:
private static final boolean DEFAULT_IMMEDIATE = false;
[1]
http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/component/UICommand.html#isImmediate()
[2]
http://svn.apache.org/repos/asf/myfaces/core/trunk/api/src/main/java/javax/faces/component/UICommand.java
TinyURL versions:
[1] http://tinyurl.com/yz38ec
[2] http://tinyurl.com/yf3pnl
Regards,
Jeff Bischoff
Kenneth L Kurz & Associates, Inc.
Re: submit value by commandLink
Posted by Simon Kitching <si...@rhe.co.nz>.
Simon Kitching wrote:
> Dave wrote:
>> But no modelUpdate phase is went through, and the backing bean binding
>> value is not changed. If commandLink submit values like commandButton
>> does, there should be a
>> modelUpdate phase to update values. Thanks,
>
>
> Setting the immediate flag (together with a non-null action) means that
> you do NOT want the data in the form pushed into the model. If you do
> want the data pushed into the model, then don't set immediate. This is
> the same regardless of whether you use commandLink or commandButton.
>
> http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works
BTW, immediate defaults to false for commandButton. I *think* it
defaults to true for commandLink.
Re: submit value by commandLink
Posted by Simon Kitching <si...@rhe.co.nz>.
Dave wrote:
> But no modelUpdate phase is went through, and the backing bean binding
> value is not changed. If commandLink submit values like commandButton
> does, there should be a
> modelUpdate phase to update values. Thanks,
Setting the immediate flag (together with a non-null action) means that
you do NOT want the data in the form pushed into the model. If you do
want the data pushed into the model, then don't set immediate. This is
the same regardless of whether you use commandLink or commandButton.
http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works
Re: submit value by commandLink
Posted by Dave <ja...@yahoo.com>.
But no modelUpdate phase is went through, and the backing bean binding value is not changed. If commandLink submit values like commandButton does, there should be a
modelUpdate phase to update values. Thanks,
David Chandler <da...@learnjsf.com> wrote:
CommandLink does submit all values in the enclosing form just like commandButton unless you're using immediate=true and specifying the outcome in the action attribute like this:
<h:commandLink value="Edit"
action="success"
immediate="true" />
/dmc
--
David Chandler
Development Coach
learnjsf.com
On 12/7/06, Dave <ja...@yahoo.com> wrote: Inside a form, there is an inputText and a commandLink. When a user clicks the commandLink, can the value in the inputText be submitted at the same time? The reason to use commandLink instead of commandButton is that commandLink can have params.
Thanks.
Dave
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.
---------------------------------
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.
Re: submit value by commandLink
Posted by David Chandler <da...@learnjsf.com>.
CommandLink does submit all values in the enclosing form just like
commandButton unless you're using immediate=true and specifying the outcome
in the action attribute like this:
<h:commandLink value="Edit"
action="success"
immediate="true" />
/dmc
--
David Chandler
Development Coach
learnjsf.com
On 12/7/06, Dave <ja...@yahoo.com> wrote:
>
> Inside a form, there is an inputText and a commandLink. When a user clicks
> the commandLink, can the value in the inputText be submitted at the same
> time? The reason to use commandLink instead of commandButton is that
> commandLink can have params.
>
> Thanks.
> Dave
>
> ------------------------------
> Access over 1 million songs - Yahoo! Music Unlimited.<http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/>
>
>