Package com.volantis.mcs.protocols.widgets.attributes

Examples of com.volantis.mcs.protocols.widgets.attributes.TableBodyAttributes


     * @param context
     */
    public TableBodyElement(XDIMEContextInternal context) {
        super(WidgetElements.TBODY, context);
       
        protocolAttributes = new TableBodyAttributes();
    }
View Full Code Here


        return (TableBodyAttributes) protocolAttributes;
    }
   
    // Javadoc inherited
    protected void initialiseElementSpecificAttributes(XDIMEContextInternal context, XDIMEAttributes attributes) throws XDIMEException {
        TableBodyAttributes tableBodyAttributes = getTableBodyAttributes();
       
        // Initialize XHTML2 table attributes.
        com.volantis.mcs.protocols.TableBodyAttributes xhtml2Attributes =
            new com.volantis.mcs.protocols.TableBodyAttributes();
       
        xhtml2Attributes.copy(tableBodyAttributes);
       
        tableBodyAttributes.setXHTML2Attributes(xhtml2Attributes);

        // Initialize "cachedPagesCount" attribute.
        String cachedPagesCountAttribute = attributes.getValue("", "cached-pages-count");
       
        if (cachedPagesCountAttribute != null) {
            int cachedPagesCount;
       
            try {
                cachedPagesCount = Integer.parseInt(cachedPagesCountAttribute);
            } catch (NumberFormatException e) {
                throw new XDIMEException("Invalid value for cached-pages-count attribute.");
            }
       
            tableBodyAttributes.setCachedPagesCount(cachedPagesCount);
        }
    }
View Full Code Here

        if (!isWidgetSupported(protocol)) {
            return;
        }
  
        // Render TBODY element opening
        TableBodyAttributes tableBodyAttributes = (TableBodyAttributes) attributes;
       
        if (tableBodyAttributes.getXHTML2Attributes().getId() == null) {
            tableBodyAttributes.getXHTML2Attributes().setId(protocol.getMarinerPageContext().generateUniqueFCID());
        }
       
        protocol.writeOpenTableBody(tableBodyAttributes.getXHTML2Attributes());
    }
View Full Code Here

        if (!isWidgetSupported(protocol)) {
            return;
        }

        // Render TBODY element closure.
        TableBodyAttributes tableBodyAttributes = (TableBodyAttributes) attributes;
       
        protocol.writeCloseTableBody(tableBodyAttributes.getXHTML2Attributes());
       
        // Prepare buffer for JavaScript
        StringBuffer script = new StringBuffer();
       
        String tableBodyId = attributes.getId();
        HashMap options = new HashMap();
       
        // Prepare options to render.
        StyleValue rowsPerPage = attributes.getStyles().getPropertyValues()
            .getSpecifiedValue(StylePropertyDetails.MCS_TABLE_ROWS_PER_PAGE);
       
        if (rowsPerPage instanceof StyleInteger) {
            options.put("rowsPerPage", Integer.toString(((StyleInteger) rowsPerPage).getInteger()));
        }
       
        LoadAttributes loadAttributes = tableBodyAttributes.getLoadAttributes();
       
        if (loadAttributes != null) {

            // require AJAX script module
            require(WidgetScriptModules.BASE_AJAX, protocol, attributes);
           
            HashMap loadOptions = new HashMap();

            loadOptions.put("src", createJavaScriptString(loadAttributes.getSrc()));

            String when = loadAttributes.getWhen();
            loadOptions.put("when", createJavaScriptString(when != null ? when : "onload"));
           
            StringBuffer loadScript = new StringBuffer();
           
            loadScript.append("new Widget.TableBodyLoad(")
                .append(createJavaScriptObject(loadOptions))
                .append(")");
           
            options.put("load", loadScript.toString());
        }
       
        // Initialize cache.
        if (tableBodyAttributes.getCachedPagesCount() != 0) {
            options.put("cachedPagesCount", Integer.toString(tableBodyAttributes.getCachedPagesCount()));
        }
       
        // Render JavaScript to buffer
        if (tableBodyId != null) {
            script.append(createJavaScriptWidgetRegistrationOpening(tableBodyId, true));
        }
       
        script.append("new Widget.TableBody(")
            .append(createJavaScriptString(tableBodyAttributes.getXHTML2Attributes().getId()))
            .append(", ")
            .append(createJavaScriptObject(options))
            .append(")");

        if (tableBodyId != null) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.widgets.attributes.TableBodyAttributes

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.