0

I am trying to achieve the following, though with a button.

<h:outputLink value="/admin/category/read">
    Cancel
    <f:param name="cat" value="" />
    <f:param name="subcat" value="" />
</h:outputLink>

I have tried using h:button, though the outcome property does not work since /admin/category/read is not a specified navigation-case.

How to use a button as link, without having to use a navigation-case or server side method?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Menno
  • 12,175
  • 14
  • 56
  • 88

1 Answers1

0

No, there's no solution using JSF attributes, at least not if you really don't have a navigation case for the h:button.

If possible, I'd advise to use CSS styling as already mentioned in the comments.

But h:button just creates a plain HTML link with onclick="window.location.href=URL". So if you really want, you can build the URL yourself and just use a plain HTML input button like this:

<input type="button" value="Cancel"
       onclick="window.location.href='/admin/category/read?cat=&subcat='; return false;" />

Related:

Community
  • 1
  • 1
Elias Dorneles
  • 22,556
  • 11
  • 85
  • 107