myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <de...@oma.be>
Subject Re: Why does JSF submit through JavaScript?
Date Thu, 22 Feb 2007 11:31:23 GMT
Well that's the problem, if you don't want to use javascript and want to
submit a form, all you can do is use a button.
Replacing your link with buttons might be odd, but with a bit o css, you
can remove all borders and margin around the button, make it inline
paragraph and have it look like a link :)

En l'instant précis du 02/22/07 11:02, Veit Guna s'exprimait en ces termes:
> Hi.
>
> 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?
>
> regards,
> Veit
>
>
> 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 <veerukrishnan@hotmail.com> 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
>>>>
>>>>
>>>>         


Mime
View raw message