0

i am new to JSF and primefaces.. i wrote a small code... i am getting what i want to do with "h:commandbutton" but samething is not working with "p:commandbutton". is there any difference between the functionality of these two things.

<h:commandButton value= "enter" actionListener= "#{newJSFManagedBean.show()}"/><br/>
<p:commandButton value= "enter" actionListener= "#{newJSFManagedBean.show()}"/><br/>

i have tried alot of things, but newjsfmanagedbean.show() havenot been called from p:commandbutton but h:commandbutton is working fine. what is the reason :-( ?

hina abbasi
  • 445
  • 1
  • 4
  • 14

3 Answers3

1

*hey it worked :-) * thanxmates

<p:commandButton process="@this" value= "enter"  ajax="false" actionListener= "#{newJSFManagedBean.show}" /><br/>
hina abbasi
  • 445
  • 1
  • 4
  • 14
0

You should add process="@this" to p:commandButton to get its action invoked. If you want to process any other components add process="@this,id1,id2" like this.

Hope this helps

Srikanth Ganji
  • 1,127
  • 1
  • 13
  • 29
0

You didn't share your show() function but I can guess that it looks like below :

public void show(ActionEvent event) {
    // some stuff here
}

Well, just delete your brackets in your EL language if you want to use it with primefaces :

<p:commandButton value= "enter" actionListener= "#{newJSFManagedBean.show}"/>

Otherwise it looks for a show method which does not have any parameters.

Maozturk
  • 339
  • 1
  • 5
  • 20