Esempio n. 1
0
  public void renderControl(ScServletData data, JwHtmlBuffer buf) {
    ScTableState state = getState(data);

    buf.open("table");
    if (state.hasHtmlClass()) buf.printAttribute("class", state.getHtmlClass());
    else {
      buf.printAttribute("border", state.getBorder());
      buf.printAttribute("cellpadding", state.getCellPadding());
      buf.printAttribute("cellspacing", state.getCellSpacing());
    }
    if (state.isWidthPercent()) buf.printAttribute("width", state.getWidth() + "%");
    else buf.printAttribute("width", state.getWidth());
    if (state.isHeightPercent()) buf.printAttribute("height", state.getHeight() + "%");
    else buf.printAttribute("height", state.getHeight());
    buf.close();

    for (ScTableRow row : _rows) row.render(data, buf);

    buf.end("table");
  }
  // ##################################################
  // # render
  // ##################################################//
  public void renderControl(ScServletData data, JwHtmlBuffer buf) {
    JwGeographicCoordinate c = null;
    if (getModel() != null) {
      if (getModel() instanceof JwGeographicCoordinate) c = (JwGeographicCoordinate) getModel();
      else c = (JwGeographicCoordinate) getValueAdaptor().getValue(getModel());
    }

    if (c != null) {
      _degrees.setValue((double) c.getDegrees().intValue());
      _minutes.setValue((double) c.getMinutes().intValue());
      _seconds.setValue(c.getSeconds().doubleValue());
      _direction.setSelectedValue(c.getDirection());
    }

    _degrees.render(data, buf);
    buf.print(JwConstantsIF.SYMBOL_DEGREE);
    buf.printNonBreakingSpace();

    _minutes.render(data, buf);
    buf.printLiteral("'");
    buf.printNonBreakingSpace();

    _seconds.render(data, buf);
    buf.print("\"");
    buf.printNonBreakingSpace();

    _direction.render(data, buf);
  }