Pure Java

UI Components for JSF
Post Reply
victoreadward
Posts: 2
Joined: 29 Sep 2010, 16:56

29 Sep 2010, 19:01

Hi,

I have trying to instantiate components using only java. For example: I have added a menubar into a page just puting:

Code: Select all

<p:menubar binding="#{MenuBar.menuBar}" /> 
It is working. Nevertheless, I need to know if is possible to use this practice to build windows. In case, How can I assign action to menuitens, for example? Or use listeners too.

waiting...

Thanks

Vitor Eduardo

callahan
Posts: 768
Joined: 27 May 2010, 22:52

29 Sep 2010, 21:33

Hi,

You can set the actions programmatically using MethodExpressions. Thers is some sample code here that should get you started: http://primefaces.prime.com.tr/forum/vi ... f=3&t=4353

User avatar
tefron
Posts: 94
Joined: 15 Sep 2010, 23:54
Location: Canada
Contact:

29 Sep 2010, 21:35

Hi
In the good old JSF you would use:

Code: Select all

        methodBinding = FacesContext.getCurrentInstance().getApplication().createMethodBinding(actionListenerString, args);
to create method binding.

Maybe JSF2 or prime faces has a better way, but I think this should still work.

Yours,

Tamir
PrimeFaces: primefaces-8.0
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Sep 2010, 22:41

For Menus, whole menu can be built with Java using menumodel option, demo;

http://www.primefaces.org/showcase/ui/menu.jsf

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests