Examples of ResponseTableBodyAttributes


Examples of com.volantis.mcs.protocols.response.attributes.ResponseTableBodyAttributes

        // Render closure of the string widget. It'll now contain content of table rows.
        String stringId = renderCloseString(protocol);

        StringBuffer script = new StringBuffer();
       
        ResponseTableBodyAttributes tableAttributes = (ResponseTableBodyAttributes) attributes;

        if (tableAttributes.getId() != null) {
            script.append(createJavaScriptWidgetRegistrationOpening(tableAttributes.getId(), true));
        }
       
        int rowsCount = tableAttributes.getTotalRowsCount();
       
        script.append("new Widget.TableBodyResponse(")
            .append(rowsCount == -1 ? "null" : Integer.toString(rowsCount))
            .append(", ")
            .append(createJavaScriptWidgetReference(stringId, true))
            .append(")");
                                           
        if (tableAttributes.getId() != null) {
            script.append(createJavaScriptWidgetRegistrationClosure());
        }
       
        writeJavaScript(script.toString());
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.response.attributes.ResponseTableBodyAttributes

     * @param context An internal XDIME context.
     */
    public ResponseTableBodyElement(XDIMEContextInternal context){
        super(ResponseElements.TABLE_BODY, context);
       
        protocolAttributes = new ResponseTableBodyAttributes();
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.response.attributes.ResponseTableBodyAttributes

    // Javadoc inherited
    protected void initialiseElementSpecificAttributes(
            XDIMEContextInternal context, XDIMEAttributes attributes)
            throws XDIMEException {
       
        ResponseTableBodyAttributes responseTableAttributes = (ResponseTableBodyAttributes) protocolAttributes;

        // Parse the "total-pages-count" attribute.
        String totalRowsCountAttribute = attributes.getValue("", "total-rows-count");
       
        if (totalRowsCountAttribute != null) {
            int totalRowsCount;
       
            try {
                totalRowsCount = Integer.parseInt(totalRowsCountAttribute);
            } catch (NumberFormatException e) {
                throw new XDIMEException("Invalid value for total-rows-count attribute.");
            }
           
            if (totalRowsCount <= 0) {
                throw new XDIMEException("The value of total-rows-count attribute must be positive.");               
            }
       
            responseTableAttributes.setTotalRowsCount(totalRowsCount);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.