JSF uses JavaScript and form-submit for links as there is a natural
restriction built into browsers how long parameters appended to a link
can be.

This restriction lies somewhere between 1 and 2 kb, depending on the
browser. The view-state in a JSF based desktop-like app can get quite
large, much larger than this. The only workaround is to use JavaScript
for the links.

What you can do is to use <h:outputLink/> instead of <h:commandLink/>
- then you loose the state-saving of JSF on these requests, but you
don't have a need for JavaScript anymore.

regards,

Martin

On 2/22/07, Veit Guna <[EMAIL PROTECTED]> wrote:
:).

For form submit's - I'm on your side. But for simple links? Also I don't
think that searchengines will press buttons when they crawl a page
because usually buttons submit forms :)...



David Delbecq schrieb:
> 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 <[EMAIL PROTECTED]> 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
>>>>>
>>>>>
>>>>>
>
>



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to