0

What's the difference between the Primefaces commandlink and jsf commandlink?

When I simply change p:commandLink to h:commandLink in something like

<p:commandLink action="#{actionBean.action(var)}"
value="#{valueBean.getValue(var.attribute)}"
styleClass="#{var.type}" />

error is prompted by Eclipse at action="#{actionBean.action(var)}" and value="#{valueBean.getValue(var.attribute)}"

Method must have signature "String method(), String method(String), String method(String, String), String method(String, String, String), String method(String, String, String, String), String method(String, String, String, String, String), String method(String, String, String, String, String, String), String method(String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), String method(String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String)" but has signature "String method(boolean)"

actionBean.action(var) returns a page to redirect like "index";

Even with the errors prompted by Eclipse, the h:commandLink version works perfect when running. Really confused about it. Many thanks.

ethanjyx
  • 1,970
  • 7
  • 28
  • 50
  • 1
    `` is a native JSF component that will render a simple `` while `` is a PrimeFaces component that adds ajax funcionality to this button. Of course, this is a rough explanation, maybe you want a more technical detailed one. – Luiggi Mendoza Jun 27 '13 at 14:59
  • If that's your purpose, then please edit the question showing your reasons otherwise it could be closed for not doing a further revision instead of just wanting other person do it for you. – Luiggi Mendoza Jun 27 '13 at 15:02
  • Well I'm still researching on this topic and just want to see whether anyone has done it before.. – ethanjyx Jun 27 '13 at 15:06
  • Why are you searching about this? What's your motivation? Just to satisfy your curiosity? – Luiggi Mendoza Jun 27 '13 at 15:08
  • primefaces doc suggests that _CommandLink is used just like the standard h:commandLink, difference is form is submitted with ajax by default._ they seem the same but the default submitting way. – erencan Jun 27 '13 at 15:08
  • @LuiggiMendoza I'm developing an app and confused about them – ethanjyx Jun 27 '13 at 15:09
  • Why are you confused, what is your problem? Are you wondering on which one to use? Please add these details in your question. Note that we don't have a crystal ball to foresee what are you working on and how it goes. – Luiggi Mendoza Jun 27 '13 at 15:12
  • Can you please post a [SSCCE](http://sscce.org) that shows where the problem arise? – Luiggi Mendoza Jun 27 '13 at 15:22
  • Looks like you have to disable ajax functionality by adding `ajax="false"` when using ``. – Luiggi Mendoza Jun 27 '13 at 15:33
  • Could you explain in detail? Thanks! – ethanjyx Jun 27 '13 at 15:39
  • Without ajax="false" it's working up to my expectation... – ethanjyx Jun 27 '13 at 15:40
  • If you ignore eclipse error message, does your code run OK? – Sazzadur Rahaman Jun 27 '13 at 15:43
  • The problem is that you can't perform a forward nor a redirect inside an ajax action, probably that's the motive for you to get those errors. Have you tried adding `ajax="false"` when using `` and verify if the error messages still appear? – Luiggi Mendoza Jun 27 '13 at 15:48

1 Answers1

0

Its an Eclipse Issue. Not your problem with code. You can disable it by setting Method expression signature incompatibility to warning or ignore in Eclipse! Here you will find details.

Community
  • 1
  • 1
Sazzadur Rahaman
  • 6,938
  • 1
  • 30
  • 52