Package org.olat.core.gui.components.table

Examples of org.olat.core.gui.components.table.TableDataModel


  public void render(Renderer renderer, StringOutput target, Component source, URLBuilder ubu, Translator translator,
      RenderResult renderResult, String[] args) {

    // Get the model object
    Choice choice = (Choice) source;
    TableDataModel tdm = choice.getTableDataModel();

    boolean iframePostEnabled = renderer.getGlobalSettings().getAjaxFlags().isIframePostEnabled();
    // form header
    String id = choice.getComponentName() + "_" + choice.hashCode();
    target.append("<form method=\"post\" name=\"").append(id).append("\" id=\"").append(id).append("\" action=\"");
    ubu.buildURI(target, null, null, iframePostEnabled? AJAXFlags.MODE_TOBGIFRAME : AJAXFlags.MODE_NORMAL);
    target.append("\"");
    if (iframePostEnabled) {
      ubu.appendTarget(target);
    }
    target.append("/>");

    target.append("<table class=\"b_choice\">");
    int rows = tdm.getRowCount();
    int cols = tdm.getColumnCount();

    for (int i = 0; i < rows; i++) {
      target.append("<tr>");
      for (int j = 0; j < cols; j++) {
        Object val = tdm.getValueAt(i, j);
        if (j == 0) { // column with on/off Boolean
          target.append("<td class=\"b_choice_checkrow\">");
          boolean selected = ((Boolean) val).booleanValue();
          String keyN = "c" + i;
          target.append("<input type=\"checkbox\" class=\"b_checkbox\"");
View Full Code Here


    }
   
    if(lstLoginsNotfound.size() > 0) {
      TableController tblCtrNotfound = new TableController(null, ureq, wControl, getTranslator(), this);
      tblCtrNotfound.addColumnDescriptor(new DefaultColumnDescriptor("table.col.login", 0, null, ureq.getLocale()));
      TableDataModel tblData = new LoginTableDataModel(lstLoginsNotfound);
      tblCtrNotfound.setTableDataModel(tblData);
     
      vc.put("table.users.notfound", tblCtrNotfound.getInitialComponent());
    }
   
View Full Code Here

  public PolicyController(UserRequest ureq, WindowControl wControl, Identity identity) {
    super(wControl);
    this.translator = new PackageTranslator(PACKAGE, ureq.getLocale());

    final List entries = ManagerFactory.getManager().getPoliciesOfIdentity(identity);
    TableDataModel tdm = new PolicyTableDataModel(entries);
   
    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    if (tableCtr != null) tableCtr.dispose();
    tableCtr = new TableController(tableConfig, ureq, getWindowControl(), translator, this);
    tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.secgroup", 0, null, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT));
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.table.TableDataModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.