fixes bug#0010358
obs: commit novos arquivos dev: Frederico qua: Renato git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@80230 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
e482a550e0
commit
56c6c9a577
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Radiogroup;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.PerfilFuncion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author rodrigo
|
||||
*/
|
||||
public class RenderPermisoSelecao implements ListitemRenderer {
|
||||
|
||||
public static final String RADIO_READ_ONLY = "radReadOnly";
|
||||
public static final String RADIO_WRITE = "radWrite";
|
||||
public static final String BOTAO_ADICIONAR_PERMISSAO = "btnAdicionarPermissao";
|
||||
|
||||
private EventListener listenerGenerico;
|
||||
|
||||
public RenderPermisoSelecao(EventListener listenerGenerico) {
|
||||
super();
|
||||
this.listenerGenerico = listenerGenerico;
|
||||
}
|
||||
|
||||
public RenderPermisoSelecao() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
PerfilFuncion permiso = (PerfilFuncion) o;
|
||||
|
||||
Radiogroup rdGroupPermissao = new Radiogroup();
|
||||
|
||||
Radio radReadOnly = new Radio();
|
||||
radReadOnly.setName("radReadOnly");
|
||||
// radReadOnly.setId(RADIO_READ_ONLY +" - "+ permiso.getFuncionSistema().getFuncionsistemaId());
|
||||
radReadOnly.setLabel(Labels.getLabel("editarPerfilController.lhSoloEscritura.label"));
|
||||
|
||||
Radio radWrite = new Radio();
|
||||
radWrite.setName("radWrite");
|
||||
//radReadOnly.setId(RADIO_WRITE +" - "+ permiso.getFuncionSistema().getFuncionsistemaId());
|
||||
radWrite.setLabel(Labels.getLabel("editarPerfilController.lhGrabacion.label"));
|
||||
|
||||
Listcell lc = new Listcell(permiso.getFuncionSistema().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
boolean indLectura = permiso.getIndLectura() == null ? true : permiso.getIndLectura();
|
||||
if (indLectura) {
|
||||
radReadOnly.setChecked(Boolean.TRUE);
|
||||
}
|
||||
if (!indLectura) {
|
||||
radWrite.setChecked(Boolean.TRUE);
|
||||
}
|
||||
radReadOnly.setAttribute("tipo", "radReadOnly");
|
||||
radReadOnly.setAttribute("data", o);
|
||||
radReadOnly.addEventListener("onCheck",listenerGenerico);
|
||||
radWrite.setAttribute("tipo", "radWrite");
|
||||
radWrite.setAttribute("data", o);
|
||||
radWrite.addEventListener("onCheck",listenerGenerico);
|
||||
rdGroupPermissao.appendChild(radReadOnly);
|
||||
rdGroupPermissao.appendChild(radWrite);
|
||||
lc.appendChild(rdGroupPermissao);
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
lc = new Listcell();
|
||||
Button btnAdicionarPermissao = new Button("");
|
||||
btnAdicionarPermissao.setAttribute("data", o);
|
||||
btnAdicionarPermissao.setAttribute("tipo", "btnAdicionarPermissao");
|
||||
btnAdicionarPermissao.addEventListener("onClick",listenerGenerico);
|
||||
btnAdicionarPermissao.setImage("/gui/img/add.png");
|
||||
lc.appendChild(btnAdicionarPermissao);
|
||||
|
||||
lc.setParent(lstm);
|
||||
|
||||
|
||||
lstm.setAttribute("data", permiso);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Checkbox;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.PerfilFuncion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Bruno Neves
|
||||
*/
|
||||
public class RenderPermisoSelecionados implements ListitemRenderer {
|
||||
|
||||
private EventListener listenerGenerico;
|
||||
|
||||
public RenderPermisoSelecionados(EventListener listenerGenerico) {
|
||||
super();
|
||||
this.listenerGenerico = listenerGenerico;
|
||||
}
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
PerfilFuncion permiso = (PerfilFuncion) o;
|
||||
|
||||
Checkbox chkRead = new Checkbox();
|
||||
chkRead.setDisabled(Boolean.TRUE);
|
||||
Checkbox chkWrite = new Checkbox();
|
||||
chkWrite.setDisabled(Boolean.TRUE);
|
||||
|
||||
|
||||
Listcell lc = new Listcell(permiso.getFuncionSistema().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
boolean indLectura = permiso.getIndLectura() == null ? true : permiso.getIndLectura();
|
||||
if (indLectura) {
|
||||
chkRead.setChecked(Boolean.TRUE);
|
||||
}
|
||||
lc.appendChild(chkRead);
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
if (!indLectura) {
|
||||
chkWrite.setChecked(Boolean.TRUE);
|
||||
}
|
||||
lc.appendChild(chkWrite);
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
Button btnRemoverPermissao = new Button();
|
||||
btnRemoverPermissao.setAttribute("data", o);
|
||||
btnRemoverPermissao.addEventListener("onClick",listenerGenerico);
|
||||
btnRemoverPermissao.setImage("/gui/img/remove.png");
|
||||
lc.appendChild(btnRemoverPermissao);
|
||||
|
||||
lc.setParent(lstm);
|
||||
|
||||
|
||||
lstm.setAttribute("data", permiso);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue