JSF2.0 - Composite component with optional method expression

前端 未结 5 1925
没有蜡笔的小新
没有蜡笔的小新 2021-01-02 16:12

I\'m implementing a composite component and I found a issue which I didn\'t find a solution.

I specified its attributes that can or not be passed by the page author,

5条回答
  •  萌比男神i
    2021-01-02 16:48

    Had the same exact error and needed to have an optional action method on my component too.

    So I have tried adding a default parameter on the composite attribute with the method-signature, pointing to a method on the corresponding FacesComponent class and it works great!

    Component:

    
        
        
        
    
    
    
        

    FacesComponent class:

    @FacesComponent("myButton")
    public class MyButton extends UINamingContainer {
    
        public MyButton () {
        }
    
        public String dummyAction() {
           return "";
        }
    
    }
    

提交回复
热议问题