Error rich:panelMenu example showcase doesn't render

浪子不回头ぞ 提交于 2019-12-12 01:35:22

问题


Hi i can't replicate the example in the richfaces 4.3.0.Final showcase: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=panelMenu&skin=blueSky Specifically in the rich:panelMenu component, when i run the code the panelMenu doesn't responde,and the panelMenuItem doesn't show, I change the code like this:

<rich:panelMenu style="width:200px" itemMode="ajax" groupMode="ajax">

to

<rich:panelMenu style="width:200px" mode="ajax">

and the panelMenuItems show and working, but this part doesn't work:

<a4j:outputPanel ajaxRendered="true">
      <rich:panel rendered="#{not empty panelMenuBean.current}">
                <h:outputText value="#{panelMenuBean.current} selected" id="current" />
      </rich:panel>
 </a4j:outputPanel>

Why? tnks.


回答1:


I've just tested with the exact same code from the showcase (I simply copied the whole h:form), and it worked alright.

You just have to create a backing bean called PanelMenuBean with the current String property and the updateCurrent listener method (receiving an ItemChangeEvent for the itemChangeListener attribute, according to the VDL docs for panelMenu):

@ManagedBean
public class PanelMenuBean {

    private String current;

    public void updateCurrent(ItemChangeEvent evt) {
        current = evt.getNewItemName();
    }

    // getter and setter ...
}


来源:https://stackoverflow.com/questions/15075683/error-richpanelmenu-example-showcase-doesnt-render

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!