Package org.ajax4jsf.renderkit

Examples of org.ajax4jsf.renderkit.ComponentVariables


writer.endElement("div");

  }   
 
  public void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
    ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
    doEncodeEnd(writer, context, (org.richfaces.component.UIComboBox)component, variables );

    ComponentsVariableResolver.removeVariables(this, component);
  }   
View Full Code Here


writer.endElement("div");

  }   
 
  public void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
    ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
    doEncodeEnd(writer, context, (org.richfaces.component.UICalendar)component, variables );

    ComponentsVariableResolver.removeVariables(this, component);
  }   
View Full Code Here

    return org.richfaces.component.UIToolTip.class;
  }

 
  public void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component ) throws IOException {
    ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
    doEncodeBegin(writer, context, (org.richfaces.component.UIToolTip)component, variables );
  }   
View Full Code Here

    

  }   
 
    public void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
    ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
    doEncodeChildren(writer, context, (org.richfaces.component.UIToolTip)component, variables );
  }   
View Full Code Here

writer.endElement("span");

  }   
 
  public void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
    ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
    doEncodeEnd(writer, context, (org.richfaces.component.UIToolTip)component, variables );

    ComponentsVariableResolver.removeVariables(this, component);
  }   
View Full Code Here

writer.endElement("table");

  }   
 
  public void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
    ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
    doEncodeEnd(writer, context, (org.richfaces.component.UIInputNumberSpinner)component, variables );

    ComponentsVariableResolver.removeVariables(this, component);
  }   
View Full Code Here

   
    protected void preEncodeBegin(FacesContext context, UIComponent component) throws IOException {
      super.preEncodeBegin(context, component);
        if(component instanceof UITabPanel){
          UITabPanel tabPanel = (UITabPanel)component;
            ComponentVariables componentVariables = ComponentsVariableResolver.getVariables(this, tabPanel);
          componentVariables.setVariable("tabPanel", getTabPanelInfoCollector().collectTabPanelInfo(context, (UITabPanel)component));
      }
    }
View Full Code Here

          componentVariables.setVariable("tabPanel", getTabPanelInfoCollector().collectTabPanelInfo(context, (UITabPanel)component));
      }
    }
   
    public void encodeTabs(FacesContext context, UITabPanel tabPanel) throws IOException {
        ComponentVariables componentVariables = ComponentsVariableResolver.getVariables(this, tabPanel);

        tabPanel.setRenderedValue(null);
       
        Object checkedValue = checkValue(tabPanel.getValue());

        UITabPanel pane = tabPanel;
        UITab activeTab = null;

        TabsIteratorHelper helper = new TabsIteratorHelper(pane.getRenderedTabs(), checkedValue);
        activeTab = helper.getTab();

        if (activeTab == null) {
          Object label = MessageUtil.getLabel(context, tabPanel);
          String message = label + ": tab panel has no enabled or rendered tabs!";
          context.getExternalContext().log(message);
          return ;
        }

        if (helper.isFallback()) {
          Object label = MessageUtil.getLabel(context, tabPanel);
          String message = label + ": tab panel [@selectedTab=" + checkedValue +
              "] has no enabled or rendered tab with such name. Tab: " + activeTab.getName() +
              " will be used instead!";
          context.getExternalContext().log(message);
          tabPanel.setRenderedValue(activeTab.getName());
      } else if (checkedValue == null) {
          tabPanel.setRenderedValue(activeTab.getName());
      } else {
        tabPanel.setRenderedValue(null);
      }
       
        helper = null;

        ArrayList tabs = new ArrayList();
        boolean clientSide = UISwitchablePanel.CLIENT_METHOD.equals(pane.getSwitchType());

        TabInfoCollector tabInfoCollector = getTabInfoCollector();
       
        Set<Object> tabNamesSet = new HashSet<Object>();
       
        for (Iterator iter = pane.getRenderedTabs(); iter.hasNext();) {
            UITab tab = (UITab) iter.next();
            boolean active = activeTab == tab;
            tab.setActive(active);

            if (!clientSide) {
                clientSide = UISwitchablePanel.CLIENT_METHOD.equals(tab.getSwitchTypeOrDefault());
            }
           
            if (!tabNamesSet.add(tab.getName())) {
            throw new FacesException(TABS_WITH_SAME_NAMES_ERROR);
            }
                       
            tab.encodeTab(context, active);

            if (!tab.isDisabled()) {
                tabs.add(tabInfoCollector.collectTabInfo(context, tab));
            }
        }
       
        // Store flag for exist client-side tabs.
        componentVariables.setVariable("clientSide", new Boolean(clientSide));
        componentVariables.setVariable("tabs", tabs);
    }
View Full Code Here

     *
     * @param context
     * @throws IOException
     */
    public void encodeTabsScript(FacesContext context, UITabPanel pane) throws IOException {
        ComponentVariables variables = ComponentsVariableResolver.getVariables(this, pane);
        ArrayList tabs = (ArrayList) variables.getVariable("tabs");
        // TODO - create tab control function.
        getUtils().writeScript(context, pane, "RichFaces.panelTabs['" + pane.getClientId(context) + "']=" + ScriptUtils.toScript(tabs) + ";");
    }
View Full Code Here

        // TODO - create tab control function.
        getUtils().writeScript(context, pane, "RichFaces.panelTabs['" + pane.getClientId(context) + "']=" + ScriptUtils.toScript(tabs) + ";");
    }
   
    public void encodeTabPanelScript(FacesContext context, UITabPanel pane) throws IOException {
        ComponentVariables variables = ComponentsVariableResolver.getVariables(this, pane);
        Object tabPanel = variables.getVariable("tabPanel");
        getUtils().writeScript(context, pane, "RichFaces.tabPanel['" + pane.getClientId(context) + "']=" + ScriptUtils.toScript(tabPanel) + ";");
    }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.renderkit.ComponentVariables

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.