예제 #1
0
    @Override
    public void execute(Event<UITabContainer> event) throws Exception {
      UITabContainer container = event.getSource();
      PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
      if (container == null) {
        return;
      }

      List<UIComponent> children = container.getChildren();
      for (UIComponent child : children) {
        if (child.isRendered() && child instanceof UIContainer) {
          UIContainer newTabContainer = container.addChild(UIContainer.class, null, null);
          newTabContainer.setTemplate(child.getTemplate());
          child.setRendered(false);
          newTabContainer.setRendered(true);
          newTabContainer.setId(String.valueOf(newTabContainer.hashCode()));
          pcontext.addUIComponentToUpdateByAjax(container);
          pcontext
              .getJavascriptManager()
              .require("SHARED/portal", "portal")
              .addScripts("portal.PortalComposer.toggleSaveButton();");
          return;
        }
      }
    }
 @Override
 public void renderChildren() throws Exception {
   List<UIComponent> list = getChildren();
   for (UIComponent child : list) {
     if (!(child instanceof UISEOToolbarForm) && child.isRendered()) {
       renderChild(child);
     }
   }
 }
예제 #3
0
 /* (non-Javadoc)
  * @see org.exoplatform.webui.core.UIComponent#processRender(org.exoplatform.webui.application.WebuiRequestContext)
  */
 public void processRender(WebuiRequestContext context) throws Exception {
   if (getComponentConfig() != null) {
     super.processRender(context);
     return;
   }
   UIForm uiForm = getAncestorOfType(UIForm.class);
   Writer writer = context.getWriter();
   writer.write("<div class=\"" + getId() + "\">");
   writer.write("<fieldset>");
   writer.write("<legend>" + uiForm.getLabel(getId()) + "</legend>");
   writer.write("<table class=\"UIFormGrid\">");
   for (UIComponent component : getChildren()) {
     if (component.isRendered()) {
       writer.write("<tr>");
       String componentName = uiForm.getLabel(component.getId());
       if (componentName != null && componentName.length() > 0 && !componentName.equals(getId())) {
         writer.write(
             "<td class=\"FieldLabel\"><label for=\""
                 + component.getId()
                 + "\">"
                 + componentName
                 + "</td>");
         writer.write("<td class=\"FieldComponent\">");
         renderUIComponent(component);
         writer.write("</td>");
       } else {
         writer.write("<td class=\"FieldComponent\" colspans=\"2\">");
         renderUIComponent(component);
         writer.write("</td>");
       }
       writer.write("</tr>");
     }
   }
   writer.write("</table>");
   writer.write("</fieldset>");
   writer.write("</div>");
 }