0

There is a tag <tr:goButton> in trinidad for which description is as below:

The goButton creates a push button that navigates directly to another location instead of delivering an action. It can be used in place of commandButton where a server-side action is not needed.

Do we've similar one in JSF 2.0 Mojarra? If not, how can we implement this?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
MyFist
  • 413
  • 7
  • 19
  • I've answered too fast, are you using the hotkey function from tr:goButton? If yes, there is no equivalent in Mojarra, you will need a components library or custom code I think. – Alexandre Lavoie Nov 16 '12 at 06:05

2 Answers2

0

To create a simple <a href=""></a> tag, you could use <h:outputLink />.

Alexandre Lavoie
  • 8,711
  • 3
  • 31
  • 72
  • Hi Alex, I'm not going to use hotkey function. I was just thinking if I append `faces-redirect="true"` to the `outcome` coming from `` then it works similar to . Is that correct? – MyFist Nov 16 '12 at 07:04
  • It will result as the browser will go to the page you want (in top URL) but it will to a forward on server side. You are using navigation rules I think? – Alexandre Lavoie Nov 16 '12 at 07:23
0

The <h:button> does exactly that.

<h:button value="Go to next page" outcome="nextpage" />

Where nextpage is just the (implicit) navigation outcome. In this case, it expects a nextpage.xhtml.

For an overview of all available JSF 2 tags, please consult the VDL documentation.

See also:


Unrelated to the concrete question, "Mojarra" is Oracle's reference JSF 2.0 implementation. It's therefore a bit strange to explicitly ask if a tag is available in "JSF 2.0 Mojarra". It's sufficient to ask if a tag is available in "JSF 2.0". Every JSF 2.0 compliant implementation should namely have exactly the same set of tags/components. MyFaces is another one and it has also just a <h:button>.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555