1
am facing a small challenge where I need to create a Dashboard dynamically from a drop down.
It is functional but there is a button in each Panel that the rendering of it depends on the existence of another panel.
Logic:
If Panelcity exists Panelled cannot render the button.
In my Bean I did as follows:
CommandButton excluirBtn = new CommandButton();
excluirBtn.setIcon("fa fa-trash");
excluirBtn.setTitle("Remover");
excluirBtn.setActionExpression(methodExpression);
excluirBtn.processUpdates(FacesContext.getCurrentInstance());
excluirBtn.setUpdate("dashboard");
excluirBtn.setRendered(!hasComponentOnDashbaord("panel_3")); //<-Linha que impede renderização do componente se o painel existir.
It works correctly when creating but it does not check after it has been rendered if Panel has been deleted.
How to Do It Dynamically by the Bean ?
Thought and create a boleano attribute to inform whether or not the panelCidade should be displayed and deny it to render the button ?
– Mayllon Baumer