Package com.exedosoft.plat.ui

Examples of com.exedosoft.plat.ui.DOFormModel


    }else {
      datarowSize = 3;
    }
    //��ȡ��ʾͼ��ť
    List  list = gm.getAllGridFormLinks();
    DOFormModel fm ;
    for ( int i = 0 ; i < list.size(); i++ ){
      fm = (DOFormModel) list.get(i);
      if ( fm.getL10n().equals("startusing")){
        data.put("fm", fm);
        break ;
      }else{
        data.put("fm", "");
      }
View Full Code Here


public class DOInputDate extends DOBaseForm {

  @Override
  public String getHtmlCode(DOIModel aModel) {

    DOFormModel fm = (DOFormModel) aModel;
    StringBuffer buffer = new StringBuffer();

    buffer.append("<input  type='date' name='").append(fm.getColName())
        .append("' id='").append(fm.getFullColID()).append("'");
    buffer.append(getDecoration(fm));

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

    String theValue = fm.getValue();

    if (theValue != null) {

      buffer.append(" value='").append(theValue).append("'");
    }
    if (isReadOnly(fm)) {
      buffer.append(" readonly='readonly' ");

    }
    buffer.append(" size=\"").append(getInputSize(fm)).append("\"/>");
    if (fm.isNotNull()) {
      buffer.append("&nbsp;<font color='red'>*</font>");
    }
    if (fm.getNote() != null && !"".equals(fm.getNote())) {
      if (fm.getStyle() != null && !"".equals(fm.getStyle())) {
        buffer.append("&nbsp;&nbsp;&nbsp;<span style=\"").append(
            fm.getStyle()).append("\">").append(fm.getNote())
            .append("</span>");
      } else {
        buffer.append(fm.getNote());
      }
    }

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

    String linkPaneName = "#";
    List topForms = gm.getTopOutGridFormLinks();
    DOPaneModel browseModel = DOPaneModel.getPaneModelByName("pm_"
        + gm.getCategory().getName() + "_browse");
   
    DOFormModel lastModel = (DOFormModel)cols.get(cols.size() - 1);
    if("查看".equals(lastModel.getL10n())){
      if(lastModel.getLinkPaneModel()!=null){
        linkPaneName = lastModel.getLinkPaneModel().getName();
      }
    }
    List lastLinkForms = lastModel.getLinkForms();
    if(lastLinkForms!=null){
      for(Iterator it = lastLinkForms.iterator(); it.hasNext();){
        DOFormModel aFm = (DOFormModel)it.next();
        if("查看".equals(aFm.getL10n()) || "Browse".equals(aFm.getL10n()) ){
          if(aFm.getLinkPaneModel()!=null){
            linkPaneName = aFm.getLinkPaneModel().getName();
            break;
          }
        }
       
      }
    }
   
   
    if (linkPaneName.equals("#") && browseModel != null) {
      linkPaneName = browseModel.getName();
    }

    if (linkPaneName.equals("#")) {
      if (topForms != null && topForms.size() > 0) {
        DOFormModel aFm = (DOFormModel) topForms.get(0);
        if (aFm.getLinkPaneModel() != null) {
          linkPaneName = aFm.getLinkPaneModel().getName();
        }
      }
    }
   
    try{
      if(gm.getService().getBo().getMainPaneModel()!=null){
        linkPaneName = gm.getService().getBo().getMainPaneModel().getName();
       
      }
    }catch(Exception e){
     
    }
   
    // /////////////Mobile显示的列
    // ////下一步可以用户定义列
    // //DOGlobals.getInstance()
    // .getSessoinContext().getFormInstance().getValue(
    // "cols")
    List showCols = new ArrayList();
    List controCols = new ArrayList();
    if (cols.size() > 3) {
      splitCols(showCols, controCols, (DOFormModel)cols.get(0));
      splitCols(showCols, controCols, (DOFormModel)cols.get(1));
      splitCols(showCols, controCols, (DOFormModel)cols.get(cols.size() - 1));
      /////如果最后一列是控制列,则再显示一列
      if(controCols.size() >0 ){
        splitCols(showCols, controCols, (DOFormModel)cols.get(2));
      }
    } else {
      for(Iterator it = cols.iterator(); it.hasNext();){
        DOFormModel aFm = (DOFormModel)it.next();
        splitCols(showCols, controCols, aFm);
      }
    }
   
    List bottomForms =  gm.getBottomOutGridFormLinks();
    for(Iterator it = topForms.iterator(); it.hasNext();){
      DOFormModel aFm = (DOFormModel)it.next();
      if(!aFm.getController().getName().toLowerCase().contains("selected")){
        bottomForms.add(aFm);
      }
    }

    Map<String, Object> data = new HashMap<String, Object>();
View Full Code Here

        List<DOFormModel> listFm = gridModel
            .getStatisticOutGridFormLinks();
        if (listFm != null && listFm.size() > 0) {
          for (Iterator<DOFormModel> it = listFm.iterator(); it
              .hasNext();) {
            DOFormModel aFm = it.next();
            aFm.setData(statistics);
            sb.append("&nbsp;&nbsp;&nbsp;&nbsp;")
                .append(aFm.getL10n()).append(":")
                .append(aFm.getValue())
                .append("&nbsp;&nbsp;&nbsp;&nbsp;");
          }
        }
        data.put("statistics_details", sb.toString());
View Full Code Here

        // /保存面板

        List<DOFormModel> fms = gm.getAllGridFormLinks();
        Map<DOFormModel,BOInstance> map = new HashMap<DOFormModel,BOInstance>();
        for (Iterator<DOFormModel> it = fms.iterator(); it.hasNext();) {
          DOFormModel aFm = it.next();
          // ///保存FormModel
          BOInstance biForm = boForm.getInstance(aFm.getObjUid());
          biForm.putValue("objuid", null);
          biForm.putValue("gridModelUid", newBiGrid.getUid());
         
          DOService fmInsert = boForm.getDInsertService();
         
          if("en".equals(DOGlobals.getValue("lang.local"))){
            fmInsert = DOService.getService("DO_UI_FormModel_Insert_EN");
          }
         
          BOInstance newBiForm = fmInsert.invokeUpdate(biForm);
         
          map.put(aFm, newBiForm);
          // //保存FormModel
          for(Iterator<DOFormTarget> itTargetGrid = aFm.getTargetGridModels().iterator();itTargetGrid.hasNext(); ){
            DOFormTarget aFt = itTargetGrid.next();
            BOInstance biFt = boFormTarget.getInstance(aFt.getObjUid());
            biFt.putValue("objuid", null);
            biFt.putValue("formUid", newBiForm.getUid());
            boFormTarget.getDInsertService().invokeUpdate(biFt);           
          }
        }

        /////linkForms 需要单独处理
        for (Iterator<DOFormModel> it = fms.iterator(); it.hasNext();) {
          DOFormModel aFm = it.next();
          BOInstance newBiForm = map.get(aFm);
          // //FormModel linkForms
          for(Iterator<DOFormModel> itLinkForms = aFm.getLinkForms().iterator(); itLinkForms.hasNext();){
            DOFormModel linkForm = itLinkForms.next();
            BOInstance newLinkBiForm = new BOInstance();
            if(map.get(linkForm)!=null){
              newLinkBiForm = map.get(linkForm);
            }else{
              newLinkBiForm = boForm.getInstance(linkForm.getObjUid());
            }
            // 
            Map<String,String> paras = new HashMap<String,String>();
            paras.put("formuid", newBiForm.getUid());
            paras.put("linkformuid", newLinkBiForm.getUid());
View Full Code Here

      DOBO boForm = DOBO.getDOBOByName("do_ui_formmodel");
      DOBO boFormTarget = DOBO.getDOBOByName("DO_UI_FormTargets");
      DOBO boFormLink = DOBO.getDOBOByName("DO_UI_FormLinks");
      for(int i = 0; i < checks.length ; i++){
        BOInstance biForm = boForm.getInstance(checks[i]);
        DOFormModel aFm = DOFormModel.getFormModelByID(biForm.getUid());
       
        biForm.putValue("objuid", null);
        biForm.putValue("gridModelUid", gridModelUid);
        BOInstance newBiForm = copyService.invokeUpdate(biForm);
        // //保存FormModel
        for(Iterator<DOFormTarget> itTargetGrid = aFm.getTargetGridModels().iterator();itTargetGrid.hasNext(); ){
          DOFormTarget aFt = itTargetGrid.next();
          BOInstance biFt = boFormTarget.getInstance(aFt.getObjUid());
          biFt.putValue("objuid", null);
          biFt.putValue("formUid", newBiForm.getUid());
          boFormTarget.getDInsertService().invokeUpdate(biFt);           
        }

          // //FormModel linkForms
        for(Iterator<DOFormModel> itLinkForms = aFm.getLinkForms().iterator(); itLinkForms.hasNext();){
            DOFormModel linkForm = itLinkForms.next();
            Map<String,String> paras = new HashMap<String,String>();
            paras.put("formuid", newBiForm.getUid());
            paras.put("linkformuid", linkForm.getObjUid());
            boFormLink.getDInsertService().invokeUpdate(paras);
        }
       
       
      }
View Full Code Here

    super();
  }

  public String getHtmlCode(DOIModel iModel) {

    DOFormModel property = (DOFormModel) iModel;

    StringBuffer buffer = new StringBuffer();
   
    buffer.append("<fieldset data-role='controlgroup'>\n");
    buffer.append("<legend>")
    .append(property.getL10n())
    .append("</legend>\n");


    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(" disable ");
        // }
        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();
        buffer.append("<input name=\"").append(
            property.getFullColName());

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

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

        if (DOStaticList.isChecked(half[0], property.getValue())) {
          buffer.append(" checked ");
        }
        // if (isReadOnly(property)) {
        // buffer.append(" disable ");
        // }
View Full Code Here

    /**
     * 处理表头
     */
    for (Iterator itCol = properties.iterator(); itCol.hasNext();) {
      DOFormModel link = (DOFormModel) itCol.next();
      buffer.append(link.getL10n());
      buffer.append("\t");
    }
    buffer.append("\n");

    /**
     * 处理内容
     */
    for (Iterator it = list.iterator(); it.hasNext();) {
      BOInstance ins = (BOInstance) it.next();

      for (Iterator itCol = properties.iterator(); itCol.hasNext();) {
        DOFormModel link = (DOFormModel) itCol.next();
        link.setData(ins);
        String value = link.getHtmlValue();
        value = value == "&nbsp;" ? "" : value;
        if(!"&nbsp;".equals(value)){
          value = value + " ";
        }
        buffer.append(value);
View Full Code Here

    List properties = gridModel.getNormalGridFormLinks();
    /**
     * 处理表头
     */
    for (Iterator itCol = properties.iterator(); itCol.hasNext();) {
      DOFormModel link = (DOFormModel) itCol.next();
      buffer.append(link.getL10n());
      buffer.append("\t");
    }
    buffer.append("\n");

   
    //BOInstance formInstance = DOGlobals.getInstance().getSessoinContext().getFormInstance();
   
    String[] selects =  DOGlobals.getInstance().getServletContext().getRequest().getParameterValues("checkinstance");
   
   
    List lSelects = Arrays.asList(selects);
   
   
    /**
     * 处理内容
     */
    for (Iterator it = list.iterator(); it.hasNext();) {
      BOInstance ins = (BOInstance) it.next();
      if(!lSelects.contains(ins.getUid())){
        continue;
      }
      for (Iterator itCol = properties.iterator(); itCol.hasNext();) {
        DOFormModel link = (DOFormModel) itCol.next();
        link.setData(ins);
        String value = link.getHtmlValue();
        value = value == "&nbsp;" ? "" : value;
        buffer.append(value);
        buffer.append("\t");
      }
      buffer.append("\n");
View Full Code Here

public class DOInputRadio extends DOStaticList {

  public String getHtmlCode(DOIModel iModel) {

    DOFormModel property = (DOFormModel) iModel;

    List list = StringUtil.getStaticList(property.getInputConfig());
      return formSelectStr(property,list);
  }
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.