public void encodeBegin()

in empire-db-jakarta-faces/src/main/java/org/apache/empire/jakarta/components/TabViewTag.java [217:285]


    public void encodeBegin(FacesContext context)
        throws IOException
    {
        // call base
        super.encodeBegin(context);

        // registerTabViewBean
        // context.getExternalContext().getRequestMap().put("tabView", this);
        getViewMode();

        // render components
        ResponseWriter writer = context.getResponseWriter();
        writer.startElement(InputControl.HTML_TAG_DIV, this);
        helper.writeComponentId(writer, true); /* must always render id! */
        helper.writeStyleClass(writer);
        // style
        String style = this.helper.getTagAttributeString("style");
        if (StringUtils.isNotEmpty(style))
            this.helper.writeAttribute(writer, InputControl.HTML_ATTR_STYLE, style);

        // The Blind
        String showTabBlindJs = null;
        if (ObjectUtils.getBoolean(helper.getTagAttributeValue("showBlind")))
        {   // hide bar
            String tabBlindClass = TagStyleClass.TAB_BLIND.get();
            writer.startElement(InputControl.HTML_TAG_DIV, this);
            writer.writeAttribute(InputControl.HTML_ATTR_CLASS, tabBlindClass, null);
            writer.writeAttribute(InputControl.HTML_ATTR_STYLE, "display:none", null);
            writer.endElement(InputControl.HTML_TAG_DIV);
            // showTabBlindJs
            String tabViewId = this.getClientId();
            showTabBlindJs = StringUtils.concat("$(document.getElementById('", tabViewId, "')).find('.", tabBlindClass,"').show();");
        }
        
        // The Tabs
        if (ObjectUtils.getBoolean(this.helper.getTagAttributeValue("hideTabBar")))
        {   // hide bar
            encodeTabs(context, null, null);
        }
        else
        {   // show bar
            writer.startElement(mode.BAR_TAG, this);
            writer.writeAttribute(InputControl.HTML_ATTR_CLASS, TagStyleClass.TAB_BAR.get(), null);
            if (mode.BAR_ROW_TAG!=null)
                writer.startElement(mode.BAR_ROW_TAG, this);
            // encode Tabs
            encodeTabs(context, writer, showTabBlindJs);
            // Bar padding item
            if (mode.BAR_PAD_TAG!=null)
            {   // Bar padding item
                writer.startElement(mode.BAR_PAD_TAG, this);
                writer.writeAttribute(InputControl.HTML_ATTR_CLASS, TagStyleClass.TAB_BAR_PADDING.get(), null);
                writer.endElement(mode.BAR_PAD_TAG);
            }
            // finish
            if (mode.BAR_ROW_TAG!=null)
                writer.endElement(mode.BAR_ROW_TAG);
            writer.endElement(mode.BAR_TAG);
        }
        
        // The Pages
        writer.startElement(mode.PANEL_TAG, this);
        writer.writeAttribute(InputControl.HTML_ATTR_CLASS, TagStyleClass.TAB_PANEL.get(), null);
        String minHeight = this.helper.getTagAttributeString("minHeight");
        if (StringUtils.isNotEmpty(minHeight))
        {
            writer.writeAttribute(InputControl.HTML_ATTR_STYLE, "min-height:" + minHeight, null);
        }
    }