Package com.exedosoft.plat.ui

Examples of com.exedosoft.plat.ui.DOFormModel




  public String getHtmlCode(DOIModel iModel) {
   
    DOFormModel property = (DOFormModel)iModel; 
   
    return getDynaListForm(property);
  }
View Full Code Here


//    buffer.append("</script>");
  }
 
  public static void main(String[] args){
   
    DOFormModel fm = DOFormModel.getFormModelByID("040d2192dcbb4d4dbe8af6808b392399");
   
    boolean isDyn = false;
    if (fm.getLinkForms() != null && !fm.getLinkForms().isEmpty()
        && fm.getInputConfig() != null) {
      isDyn = true;
    }
    System.out.println("Fm.LinkForms::::" + isDyn);
  }
View Full Code Here

    // TODO Auto-generated constructor stub
  }

  public String getHtmlCode(DOIModel aModel) {

    DOFormModel property = (DOFormModel) aModel;

    StringBuffer buffer = new StringBuffer();
    String areaConfig = property.getInputConfig();
    int cols = 50;
    int rows = 5;
    if (areaConfig != null && !areaConfig.equals("")) {
      String[] configs = areaConfig.split(";");
      if (configs != null && configs.length == 2) {
        if (Integer.parseInt(configs[0]) != 0) {
          cols = Integer.parseInt(configs[0]);
        }
        if (Integer.parseInt(configs[1]) != 0) {
          rows = Integer.parseInt(configs[1]);
        }
      }
    }

    buffer.append("<textarea  name='").append(property.getColName()).append("' id='").append(
        property.getFullColID()).append("'");
    // buffer .append("\" dojoType=\"");
    // if (property.getExedojoType() != null
    // && !"".equals(property.getExedojoType().trim())) {
    // buffer.append(property.getExedojoType()).append("\"");
    // } else {
    // buffer.append("ValidationTextBox\"");
    // }

    buffer.append(" title='").append(property.getL10n().trim()).append("'");

    buffer.append(this.appendValidateConfig(property));

    if (isReadOnly(property)) {
      buffer.append(" readonly='readonly' ");

    }

    buffer.append(" cols=").append("\"").append(cols).append("\" rows=")
        .append("\"").append(rows).append("\">");
    if (property.getValue() != null) {
      buffer.append(property.getValue());
    }
    buffer.append("</textarea>");

    if (property.isNotNull()) {
      buffer.append("&nbsp;<font color='red'>*</font>");
    }

    return buffer.toString();
  }
View Full Code Here

import com.exedosoft.plat.util.StringUtil;

public class DOValueDateTime implements DOIView {

  public String getHtmlCode(DOIModel aModel) {
    DOFormModel fm = (DOFormModel)aModel;
 
    if(fm.getValue()!=null && fm.getRelationProperty()!=null){
      return StringUtil.getDateStr(fm.getData().getDateValue(fm.getRelationProperty()), "yyyy-MM-dd HH:mm");
    }
    else{
      return "&nbsp;";
    }
  }
View Full Code Here

public class DOValueSimplePlain implements DOIView {

  public String getHtmlCode(DOIModel aModel) {

    DOFormModel fm = (DOFormModel) aModel;
    if (fm.getValue() != null) {
     
      return fm.getValue();
    } else {
      return "";
    }
  }
View Full Code Here

    super();
  }

  public String getHtmlCode(DOIModel iModel) {
   
    DOFormModel property = (DOFormModel)iModel;     

    StringBuffer buffer = new StringBuffer();
    buffer.append("<input name=\"").append(property.getFullColName());
    if (property.getInputConfig() != null
        && !"".equals(property.getInputConfig())) {
      String configValue = property.getInputConfig().substring(0,
          property.getInputConfig().indexOf(","));
      buffer.append("\" value=\"").append(configValue);
    } else {
      buffer.append("\" value=\"").append("1");
    }
   
    buffer.append("\"  type=\"checkbox\"");
   
    buffer.append(getDecoration(property));

   
    // /////////////判断是否缺省选中
    boolean isDefaultChecked = false;
    if (property.getInputConfig() != null
        && property.getInputConfig().indexOf("@") != -1) {
      String configValue = property.getInputConfig().substring(0,
          property.getInputConfig().indexOf(","));
      String defaultCheck = property.getInputConfig().substring(
          property.getInputConfig().indexOf("@") + 1);
      if (configValue.equalsIgnoreCase(defaultCheck)) {
        isDefaultChecked = true;
      }
    }

    if (property.getValue() != null || isDefaultChecked) {
      buffer.append(" checked ");
    }
    if (isReadOnly(property)) {
      buffer.append(" DISABLED  ");
    }
    if (property.getDoClickJs() != null
        && !"".equals(property.getDoClickJs().trim())) {
      buffer.append(" onclick='").append(
          property.getEscapeDOClickJs()).append("'");
    }
   
    buffer.append("/>");
    return buffer.toString();
  }
View Full Code Here

public class DOValueSimpleNew implements DOIView {

  public String getHtmlCode(DOIModel aModel) {
    // newrecord
    DOFormModel fm = (DOFormModel) aModel;
    if (fm.getValue() != null) {
      if (fm.getData().getValue("newrecord") == null) {
       
        StringBuffer buffer = new StringBuffer(fm.getValue());
        buffer.append("<img src='").append(DOGlobals.PRE_FULL_FOLDER)
        .append("images/").append("newrecord.gif").append(
            "'/>");
       
        return buffer.toString();

      } else {
        return fm.getValue();
      }
    } else {
      return "&nbsp;";
    }
  }
View Full Code Here

public class DOValueSimpleWithColor implements DOIView {
 

  public String getHtmlCode(DOIModel aModel) {

    DOFormModel fm = (DOFormModel) aModel;
    String value = fm.getValue();
   

    if (value != null && !value.trim().equals("")) {
      if(fm.getInputConfig()!=null&&!"".equals(fm.getInputConfig()))
      {
        //return "<span style='"+fm.getStyle()+"'>"+value+"<";;
        StringBuffer sb=new StringBuffer();
        List list = StringUtil.getStaticList(fm.getInputConfig());
        String color="";
       
        for(Iterator it = list.iterator();it.hasNext();){
          String[] one = (String[])it.next();
          if(one != null && one.length == 2) {
View Full Code Here

    super();
  }

  public String getHtmlCode(DOIModel iModel) {

    DOFormModel property = (DOFormModel) iModel;

    StringBuffer buffer = new StringBuffer();

    if (property.getLinkService() != null) {
      for (Iterator it = property.getLinkService().invokeSelect()
          .iterator(); it.hasNext();) {

        BOInstance instance = (BOInstance) it.next();

        buffer.append("<input name=\"").append(
            property.getFullColName());

        buffer.append("\" value=\"").append(instance.getUid());

        buffer.append("\"  type=\"checkbox\"");

        buffer.append(getDecoration(property));

        if (DOStaticList.isChecked(instance.getUid(),
            property.getValue())) {
          buffer.append(" checked ");
        }
        if (isReadOnly(property)) {
          buffer.append(" DISABLED  ");
        }
        buffer.append("/>");
        buffer.append(instance.getThisLink());
        // buffer.append(instance.getName());

      }
    } else if (property.getInputConfig() != null) {

      List list = StringUtil.getStaticList(property.getInputConfig());
      for (Iterator it = list.iterator(); it.hasNext();) {
        String[] half = (String[]) it.next();
        if (!half[1].contains("其他")) {
          buffer.append("<input name=\"").append(
              property.getFullColName());

          buffer.append("\" value=\"").append(half[0]);

          buffer.append("\"  type=\"checkbox\"");
          buffer.append(getDecoration(property));

          if (isReadOnly(property)) {
            buffer.append(" onclick='return false;'  ");
            buffer.append("  DISABLED ");

          }
          if (DOStaticList.isChecked(half[0], property.getValue())) {
            buffer.append(" checked ");
          }
          // if (isReadOnly(property)) {
          // buffer.append(" disable ");
          // }
          buffer.append("/>");
          buffer.append(half[1]);
        } else {
          buffer.append("<input name=\"").append(
              property.getFullColName());

          buffer.append("\" value=\"").append(half[0]);

          buffer.append("\"  type=\"checkbox\"");
          buffer.append(getDecoration(property));

          if (isReadOnly(property)) {
            buffer.append(" onclick='return false;'  ");
            buffer.append(" DISABLED ");

          }

          if (DOStaticList.isChecked(half[0], property.getValue())) {
            buffer.append(" checked ");
          }
          // if (isReadOnly(property)) {
          // buffer.append(" disable ");
          // }
          buffer.append("/>");
          buffer.append(half[1]);

          if (isReadOnly(property)) {
            if (DOStaticList
                .isChecked(half[0], property.getValue())) {
              String[] strs = property.getValue().split(";");
              buffer.append("<span style='text-decoration:underline'>"
                  + strs[strs.length - 1] + "</span>");
            }
          } else {

            buffer.append(
                "<input  style='border:#B3B3B3 1px solid;'   onclick=\"this.style.borderColor='#406B9B'\" onmouseover=\"this.style.borderColor='#99E300'\" onmouseout=\"this.style.borderColor='#A1BCA3'\"  type='text' name='")
                .append(property.getFullColName()).append("'");
            buffer.append(" title='").append("其他").append("'");
            if (DOStaticList
                .isChecked(half[0], property.getValue())) {
              String[] strs = property.getValue().split(";");
              buffer.append(" value='" + strs[strs.length - 1]
                  + "'");
            }
            buffer.append(" size=\"").append("13").append("\"/>");
          }
View Full Code Here

    int i = 1;
    for (Iterator<DOBOProperty> it = properties.iterator(); it.hasNext(); i = i + 5) {
      DOBOProperty p = it.next();
      if (!p.isKeyCol()) {
        DOFormModel fm = new DOFormModel();
        DOFormModel old = DOFormModel.getFormModelByProperty(p
            .getObjUid());
        if (old != null) {
          fm.setL10n(old.getL10n());
        } else {
          fm.setL10n(p.getL10n());
        }
        fm.setRelationProperty(p);
        fm.setGridModel(conditionGrid);
        fm.setOrderNum(Integer.valueOf(i));
        fm.setIsNull(DOFormModel.NULL_YES);
        if (p.isDateOrTimeType()) {
          fm.setController(formDateMy97);
        } else {
          fm.setController(formInputText);
        }

        if (p.isInt() || p.isLong()) {
          fm.setExedojoType("Integer");
        } else if (p.isNumberType()) {
          fm.setExedojoType("RealNumber");
        }
        DAOUtil.INSTANCE().store(fm);
      }
    }

    DOFormModel fm = new DOFormModel();
    if("en".equals(DOGlobals.getValue("lang.local"))){
      fm.setL10n("Search");

    }else{
      fm.setL10n("查询");
    }
    fm.setController(formPane);
    fm.setGridModel(conditionGrid);
    fm.setOrderNum(Integer.valueOf(i));
    fm.setLinkPaneModel(pmResult);
    fm.setIsOutGridAction(DOFormModel.OUTGRID_BOTTOM);
    DAOUtil.INSTANCE().store(fm);

    return pmCondition;
  }
View Full Code Here

TOP

Related Classes of com.exedosoft.plat.ui.DOFormModel

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.