I was wondering if there is a way to create Swing like Actions for components in a JSF application. The main reason for me is the requirement to create dynamic actions for a page depending on the access level of the currently logged in user or the workplace the request is coming from. The backing bean would create a list of actions accordingly, and within the JSF template one or more loops could assign the actions multiple times to e.g. menu items on the top and buttons on the bottom for responsive layouts. The labels, icons and titles would be assigned to the action by the bean and adopted by the JSF component.
I know about the different web framework design patterns, and like stated here the component based pattern "makes it possible to program JSF applications as if you’re programming a Swing application". But e.g. the JSF component CommandButton or the Primefaces component MenuItem are expecting a method expression as action and actionListener parameter values instead of a actionBean where also label, icon and title are coming from.
Aucun commentaire:
Enregistrer un commentaire