Questions tagged [commandlink]

JSF tag to create a POST link.

The <h:commandLink> is a JSF UI component which generates a HTML <a> element which submits its parent <form method="post"> using JavaScript.

208 questions
367
votes
13 answers

commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated

Sometimes, when using , or , the action, actionListener or listener method associated with the tag are simply not being invoked. Or, the bean properties are not updated with submitted UIInput values. What are…
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
104
votes
4 answers

How can I pass selected row to commandLink inside dataTable or ui:repeat?

I'm using Primefaces in a JSF 2 application. I have a , and instead of selecting rows, I want the user to be able to directly execute various actions on individual rows. For that, I have several s in the last column. My…
Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
26
votes
2 answers

h:commandButton/h:commandLink does not work on first click, works only on second click

We have an ajax navigation menu which updates a dynamic include. The include files have each their own forms.
Skyler Hays
  • 279
  • 1
  • 5
  • 14
22
votes
8 answers

p:commandLink fails to open page in new window/tab

I'm trying to create a link to open a new page in a different window/tab and display some msg from backing bean but fail to do it, wonder know why? here is my xhtml file:
heng heng
  • 693
  • 3
  • 13
  • 25
16
votes
4 answers

h:commandbutton vs h:commandlink

We are using JSF-2.1.7 and in all our form post requests. I am trying to justify whether to use or . The appearance of (href ) can be controlled using style and jQuery. Which is recommended…
user684434
  • 1,165
  • 2
  • 19
  • 39
9
votes
3 answers

commandLink does not invoke action listener, but commandButton works fine

I want to invoke one method through a link from Facelets: My Facelets code is like:
Arka Bhaduri
  • 91
  • 1
  • 2
8
votes
2 answers

Clicking h:commandLink causes Uncaught ReferenceError: mojarra is not defined

I am aware of this post and I double checked all the possibilities there. I'm using JSF 2.0 with Mojarra implementation on Glassfish 3. I'm trying to use two simple tags to change the application language. This is the .xhtml…
Ionut
  • 2,788
  • 6
  • 29
  • 46
8
votes
2 answers

"This link is deactivated, because it is not embedded in a JSF form."

When I use the following command link: And the following navigation rule in faces-config.xml: /home.xhtml
Aram Gevorgyan
  • 2,175
  • 7
  • 37
  • 57
7
votes
1 answer
7
votes
1 answer

Use just for JS execution without form submit

How can I make without submit? Just for JS execution. For I can do it this way: What is the analog for ?
Gregory
  • 413
  • 5
  • 16
6
votes
1 answer

h:commandButton not working inside h:dataTable

I am trying to execute an action through commandButton inside a dataTable, but the action is not invoked when the commandButton is placed inside the datatable as shown below
Rajat Gupta
  • 25,853
  • 63
  • 179
  • 294
6
votes
4 answers

show icon with p:commandLink

How to show an icon with commandLink: The outputText (Add) is not visible. What is the…
Dave
  • 759
  • 2
  • 9
  • 31
6
votes
2 answers

Why does a commandLink within a facet within a composite component renders an error?

When I create a composite component with a facet in it and place a command link within that facet, I get an error message: This link is disabled as it is not nested within a JSF form. A commandButton does not behave in the same way, so I am inclined…
Leo Mekenkamp
  • 217
  • 2
  • 7
6
votes
2 answers

Applying style to because I basically need

Does anyone know how to put the same styles from the commandbutton to all commandlinks? I want that all links appear like this (overriding links styles and using the button styles): A normal button: A hovered button: A pressed button: My current…
John Alexander Betts
  • 4,718
  • 8
  • 47
  • 72
5
votes
3 answers

JSF Ajax Link performs partial ajax render before the link action

I have the following in a JSF page: The rendering works perfectly, though it renders the component before…
Sheldon Irwin
  • 121
  • 1
  • 5
1
2 3
13 14