myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Veit Guna <>
Subject Re: Why does JSF submit through JavaScript?
Date Thu, 22 Feb 2007 10:02:42 GMT

Normally, you want to execute some view logic when pressing a link - not
only to post forms. Since the JS-free outputLink doesn't have an action
attribute, this can't be used for a replacement for commandLink.
Replacing all links with buttons seems odd to me...

No other solutions?


Simon Kitching schrieb:
> Replacing all commandLinks with commandButtons seems the best solution
> to me. After all, if you were using some other tech like CGI or PHP or
> whatever you still couldn't submit a form using an <a> tag without
> javascript. It's just not possible with HTML.
> The h:commandLink tag is really an optional feature over and above
> normal html, which is why javascript is needed to implement it on the
> client side.
> Note that this only applies where the link *submits a form*. Ordinary
> links can be output using h:outputLink - but they won't submit the form.
> lightbulb432 wrote:
>> I see, so what do developers of JSF applications generally do -
>> replace all
>> commandLinks with commandButtons, or only users with JavaScript
>> enabled to
>> access their site? What strategy do some of you use with regards to users
>> out there who don't enable JavaScript (which isn't as small a number as I
>> would've thought)
>> craigmcc wrote:
>>> On 12/21/06, lightbulb432 <> wrote:
>>>> Why does JSF always use JavaScript to submit a form rather than through
>>>> the
>>>> regular method of form submission?
>>> That only happens for a commandLink component (i.e. a hyperlink that
>>> is to
>>> submit a form).  If you use a commandButton component, no JavaScript is
>>> needed.
>>> Is your entire JSF web application useless for clients that have
>>> JavaScript
>>>> turned off?
>>> Only for hyperlinks.  If you can describe a way to have a hyperlink
>>> submit
>>> a
>>> form, without Javascript being enabled, we would love to hear it.
>>> Craig

View raw message