How to hide a table context button?

Last updated 9 months ago

In a #table, some times you need to hide a button if the user or item is not supose to have that action, fired by the button

‚Äč

Orange edit button hidden
for(TaskServiceQuery task:taskS.queryHistoryTask()) { TestPage.Table_1 t = new TestPage.Table_1(); t.setNum_processo(task.getProcessInstanceId()); t.setProcesso(task.getProcessDefinitionId()); t.setEtapa(Core.isNotNull(task.getName())?task.getName():task.getTaskDefinitionKey()); t.setDt_inicio_etapa(Core.ToChar(task.getStartTime(), "yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss")); t.setEstado(this.getStatusTask(task));
if(!t.getEstado().equalsIgnoreCase("terminado")) { t.hiddenButton(view.btn_ver_etapa,view.btn_ver_processo,...); } data.add(t); }

Where you can put one or many buttons to be hidden.

t.hiddenButton(view.btn_xxx,...);