Iterate over nested List property inside h:datatable

后端 未结 1 1585
别跟我提以往
别跟我提以往 2020-12-10 09:32
    
        
            
                

        
1条回答
  •  伪装坚强ぢ
    2020-12-10 10:07

    Just iterate over it using or the usual way. It's perfectly valid to nest multiple iterating components in each other. In case of , you only need to make sure that you put the nested iterating component inside a .

    E.g.

    
        
            #{entity.property}
        
        
            
                #{subentity.property}
            
        
    
    

    or

    
        
            #{entity.property}
        
        
            
                
                    #{subentity.property}
                
            
        
    
    

    You'll potentially only run into issues when you nest multiple components and use in it while using an older version of Mojarra.

    Only JSTL wouldn't work when nested inside a JSF iterating component for the reasons explained here JSTL in JSF2 Facelets... makes sense?


    Unrelated to the concrete problem, please don't abuse for pure text presentation. It generates a HTML element which is intented to label an input element by for attribute. However, you're doing that nowhere in the code. You should be using instead. By the way, I'm lately seeing this more often in code of starters. There must be somewhere a bad tutorial or resource which is abusing the this way instead of or even plain EL in template text. Which tutorial/resource was you using? Then I can contact the author about this severe misinstruction. See also Purpose of the h:outputLabel and its "for" attribute

    0 讨论(0)
提交回复
热议问题