0

I'm wonking on a jsf application, i want to use commandLink to execute ana action on my managed bean, where there is a server call, but i dont want to reload the page, i've tried with a commandButton and the attribut update it works? How can i make this with commandLink ?

I resolved the problem by using the commadLink of primefaces 3.2 :)

Potinos
  • 371
  • 3
  • 5
  • 15

1 Answers1

0

Just return null or void from the action method.

<h:commandLink value="submit" action="#{bean.submit}">
    <f:ajax />
</h:commandLink>

with

public void submit() {
    // ...
}

You can also use the <f:ajax listener> attribute instead.

<h:commandLink value="submit">
    <f:ajax listener="#{bean.submit}" />
</h:commandLink>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555