Cant call oncoeres the code:mplete in menuModel

UI Components for JSF
Post Reply
User avatar
kwintesencja
Posts: 316
Joined: 08 Feb 2010, 20:33
Location: Brazil

09 Aug 2011, 13:49

Hi everyone,

Im trying to call the oncomplete javascript of a menu build dinamically without sucess, here is the code:

.xhtml

Code: Select all

<p:breadCrumb id="breadCrumb" model="#{historyStackController.historyModel}"/>
mbean

Code: Select all

 historyModel = new DefaultMenuModel();  
           MenuItem homeItem = new MenuItem();  
           homeItem.setAjax(false);
           homeItem.setValue("home");
           homeItem.setOncomplete("alert('home')");
           homeItem.setActionExpression(this.createMethodExpression("home", String.class,new Class[]{}));
           historyModel.addMenuItem(homeItem);
the alert is never called although the action to home is, my purpose is to call a remoteCommand action when clicking in menuItem.


Thanks in advance.
Att,

--

Rafael Mauricio Pestano


Primefaces 5.x + JavaEE7(Glassfish 4.x and Wildfly 8)
Conventions Framework
Blog
@realpestano

User avatar
kwintesencja
Posts: 316
Joined: 08 Feb 2010, 20:33
Location: Brazil

09 Aug 2011, 14:01

ok if i set ajax=true then it works but i cant redirect, and also pass "?faces-redirect=true" to the return of the action doesn't work, im out of ideas

Code: Select all

item.setActionExpression(this.createMethodExpression(historyStackItem.getManagedBean().getBeanHomePage()+"?faces-redirect=true", String.class,new Class[]{}));
Att,

--

Rafael Mauricio Pestano


Primefaces 5.x + JavaEE7(Glassfish 4.x and Wildfly 8)
Conventions Framework
Blog
@realpestano

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests