Wayne
Wayne

Reputation: 149

Can I replace h:commandLink with h:link

I'm creating a mobi-site using jsf. I got right to the end and found that more primitive phone browsers can't handle the javascript that commandLink creates. Is it possible to circumvent this with h:link or do you have any other suggestion as to how to get around this?

Upvotes: 1

Views: 714

Answers (1)

BalusC
BalusC

Reputation: 1108642

The <h:commandLink> generates a HTML <a> element with JS code in onclick to submit a POST form.

If your functional requirement is to submit a form with some data, then better use <h:commandButton>, it doesn't generate JS code.

If your functional requirement is to navigate to other page, then you should definitely use <h:link>, or <h:outputLink>, or just plain HTML <a>.

Upvotes: 1

Related Questions