开发者

Primefaces adding Button issue - Beginner

开发者 https://www.devze.com 2023-03-25 00:55 出处:网络
I am trying to add a button using primefaces to a JFS page, and upon clicking it a method from a Java class should be called:

I am trying to add a button using primefaces to a JFS page, and upon clicking it a method from a Java class should be called:

<p:commandButton type="submit" 
                 value="Test - Print Message" 
                 action="#{DataForm.Preference}" />

I get the primefaces button (the nice GUI), but when I click on the button the code开发者_运维知识库 from the java class DataForm.Preference is not executed.

I have used the attribute action in my code, and I don't think primefaces recognizes it, how should I call the method Preference from my DataForm class?


I don't think "preference" is your method Name. Seems like its a property. Why is your value static? What's the point of then using an action method?

0

精彩评论

暂无评论...
验证码 换一张
取 消