Exemplo n.º 1
0
  // public Listitem agregarDetail(IBeanAbstracto dto, Listbox lista, int
  // span,
  // String widthEstado, boolean aplicaEstado, boolean aplicaDetail,
  // String lblcaption, String... nobreColumnas) {
  //
  // Listitem detail = new Listitem();
  // Listhead columnas = new Listhead();
  // Groupbox gbox = new Groupbox();
  // Caption caption = new Caption(lblcaption);
  // gbox.appendChild(caption);
  //
  // Listcell cell1 = new Listcell();
  // Listcell cell2 = new Listcell();
  // cell2.setSpan(span);
  // if (aplicaDetail) {
  // Listheader deta = new Listheader();
  // deta.setWidth("20px");
  // deta.setAlign("center");
  // columnas.appendChild(deta);
  // }
  //
  // for (String nombreColumna : nobreColumnas) {
  // columnas.appendChild(new Listheader(nombreColumna));
  // }
  // if (aplicaEstado) {
  // if (widthEstado != "" && widthEstado != null) {
  // Listheader estado = new Listheader("Estado");
  // estado.setAlign(CENTER);
  // estado.setWidth(widthEstado);
  // columnas.appendChild(estado);
  // } else {
  // Listheader estado = new Listheader("Estado");
  // estado.setAlign(CENTER);
  // estado.setWidth("70px");
  // columnas.appendChild(estado);
  // }
  //
  // }
  // lista.appendChild(columnas);
  // gbox.appendChild(lista);
  // gbox.setStyle("overflow:auto");
  // cell2.appendChild(gbox);
  // detail.appendChild(cell1);
  // detail.appendChild(cell2);
  // detail.setVisible(false);
  //
  // return detail;
  // }
  //
  @SuppressWarnings("deprecation")
  public Listitem agregarDetail(
      IBeanAbstracto dto,
      Listbox lista,
      int span,
      String widthEstado,
      String lblCaption,
      boolean aplicaEstado,
      boolean aplicaDetail,
      String... nobreColumnas) {

    Listitem detail = new Listitem();
    Listhead columnas = new Listhead();
    Groupbox gbox = new Groupbox();
    Caption caption = new Caption();
    if (lblCaption != null) caption.setLabel(lblCaption);

    Listcell cell1 = new Listcell();
    Listcell cell2 = new Listcell();
    cell2.setSpan(span);
    if (aplicaDetail) {
      Listheader deta = new Listheader();
      deta.setWidth("30px");
      deta.setAlign("center");
      columnas.appendChild(deta);
    }

    for (String nombreColumna : nobreColumnas) {
      columnas.appendChild(new Listheader(nombreColumna));
    }
    if (aplicaEstado) {
      if (widthEstado != "" && widthEstado != null) {
        Listheader estado = new Listheader("Estado");
        estado.setAlign(CENTER);
        estado.setWidth(widthEstado);
        columnas.appendChild(estado);
      } else {
        Listheader estado = new Listheader("Estado");
        estado.setAlign(CENTER);
        estado.setWidth("70px");
        columnas.appendChild(estado);
      }
    }
    lista.setFixedLayout(true);
    lista.appendChild(columnas);
    gbox.appendChild(caption);
    gbox.appendChild(lista);
    gbox.setHflex("true");
    gbox.setContentStyle("overflow-x:auto");
    cell2.appendChild(gbox);
    detail.appendChild(cell1);
    detail.appendChild(cell2);
    detail.setVisible(false);

    return detail;
  }