JSF 2.0 How to display a different h:panelGroup each time an item is selected from a selectOneMenu

前端 未结 4 2103
天涯浪人
天涯浪人 2021-01-07 06:40

I have a selectOneMenu that displays some different stuff categories:


        

        
4条回答
  •  既然无缘
    2021-01-07 07:15


    I am very near the solution, but something is wrong. Ive done every thing as you said: 1st and 2nd problem are solved. The problem is that the panel carInfo does not get rendered when i pick the category.

    Is there something wrong with the method in the managed bean? For some reason it does not get called. This is how my code currently looks like Managed bean

     public void carSelectedEvent(ValueChangeEvent e) {
        String tmp = (String) e.getNewValue();
        System.out.println("CALLED!!!!!");
        if (selectedCategory.trim().equals("automobili")) {
            carCategorySelected = true;
        } else if (e.getNewValue().toString().contains("NEKRETNINE")) {
    
        }
    }
    

    JSF page Select

    
            
            
        
    

    JSF panel that needs to be displayed

    
    ...
    

    When i navigate to the page everithing seems ok but i notice this message in the console:

    INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed. sourceId=null[severity=(ERROR 2), summary=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.), detail=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.)]

提交回复
热议问题