primefaces - JSF. How to disable page components by bean method -
I want to disable some menu items on my web page:
& lt; P: menuitem value = "edit" update = ": formation: visibleDialPlayAdit" icon = "UI-icon-document" incomplete = ... disabled = "# {bean.sys (1)}" /> and in my backup bean:
ask public boolean (int id) {ask for the database for the privilege "id" and if the returned user is correct Yes, the privilege "id" is returned and false) Of course I want to check it only once - during rendering the page In this example, regardless of the outcome of the "Ask" menu, is always enabled. I know that I can set the Boolean variable xmls code (# {bean.ask1}), but I want a universal solution Can you help
Get in a bean with a private variable and ask with set methods.
ask private boolean = true; Public Boolean issk () {ask again; } Public Zero SetAsak (Ask Boolean) {this.ask = ask; } Now whatever position you want to enable or disable menu items, set or reset the variable set properly in a different method in Bean.
if (condition = true) {setAsk (wrong); }
Comments
Post a Comment