コード例 #1
0
  /** loads a form from an xml file and registeres it with the controller. */
  public Component createComponent(RequestContext context) throws JspException {
    try {

      Document doc = parseDocument(context, getXmlUri());

      // find the bean model
      Object bean = null;
      if (model != null) bean = context.getModelReference(model);

      // create the component
      FormComponent fc = createFormComponent(context, id, doc, bean);
      fc.setBookmarkable(bookmarkable);
      fc.setFinishButton(finishButton);

      registerWithWizard(fc);
      return fc;

    } catch (MalformedURLException e) {
      logger.error(null, e);
      throw new JspException(e);
    }
  }
コード例 #2
0
 /** @see com.tonbeller.wcf.tags.ComponentTag#createComponent() */
 public Component createComponent(RequestContext context) throws JspException {
   CategoryModel cm;
   if (model != null) cm = (CategoryModel) context.getModelReference(getModel());
   else cm = new TestCategoryModel();
   return new CategoryEditor(getId(), null, cm);
 }