Fórumok

h:button and h:link

PortletFaces Community Member, módosítva 12 év-val korábban

h:button and h:link

Regular Member Bejegyzések: 199 Csatlakozás dátuma: 2012.04.03. Legújabb bejegyzések
I'm having problems using these elements, but I don't know if it has anything to do with the bridge.
I'm using version 2.0.1 of the bridge in Liferay. When I use these elements, the generated html is:
"onclick="window.location.href='null';", i.e. the button or link doesn't work.

Could this be a problem with the bridge or should I search elsewhere?
thumbnail
Johann Kneringer, módosítva 12 év-val korábban

RE: h:button and h:link

Junior Member Bejegyzések: 42 Csatlakozás dátuma: 2011.11.10. Legújabb bejegyzések
If you want to navigate to a certain view, you have to use the "action" with an outcome...

You have to use h:commandButton or h:commandLink

If you have 2 views, mypage1.xhtml & mypage2.xhtml, and you want to navigate from view 1 to 2, you have to make a h:commandButton on view1. Write in the action of the commandbutton "mypage2".

If this wont work, you have to define certain navigation rules in your faces-config.xml....


Check the demo-portlets for further information
PortletFaces Community Member, módosítva 12 év-val korábban

RE: h:button and h:link

Regular Member Bejegyzések: 199 Csatlakozás dátuma: 2012.04.03. Legújabb bejegyzések
As I understand it, h:button and h:link were introduced in JSF 2 to support navigation using HTTP GET, as opposed to using HTTP POST when e.g. h:commandButton is used. Of course I can use h:commandButton but it seems unnecessary to use POST when there's no form data to process.
PortletFaces Community Member, módosítva 12 év-val korábban

RE: h:button and h:link

Regular Member Bejegyzések: 199 Csatlakozás dátuma: 2012.04.03. Legújabb bejegyzések
Bumping this thread.
Has any one successfully used h:button or h:link in a portlet?
thumbnail
Neil Griffin, módosítva 9 év-val korábban

RE: h:button and h:link

Liferay Legend Bejegyzések: 2655 Csatlakozás dátuma: 2005.07.27. Legújabb bejegyzések
Please refer to alloy:button and alloy:link in the Liferay Faces Showcase.
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: h:button and h:link

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
PortletFaces Community Member:
When I use these elements, the generated html is:"onclick="window.location.href='null';", i.e. the button or link doesn't work.


Okay, no one has asked the obvious, so I will. What exactly are you trying to use with the tags? Can you share the full use of the tag? I mean, not to be condescending or anything, but if you just add a <h:link /> tag with no attributes and no children, well then the generated html would be nonsense (even though you really can't do a link in this way, it's just an example to show how you might get bad generated code because the tag itself doesn't have enough to make sense).