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

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


        }
        // if we found wizard it means that this submit button should be
        // wrapped (on client-side) with javascritp that controls button
        // behaviour. In this way standard submit might be used by widgets.
        if(null != wizard){
            ButtonScriptHandlerAttributes buttonAttributes = new ButtonScriptHandlerAttributes();
           
            VolantisProtocol protocol = getProtocol(context);
            WidgetModule widgetModule = protocol.getWidgetModule();
           
            try {
View Full Code Here


        // when we found wizard we have to associate this submit button
        // with complete action on wizard.
        if(null != wizard){
            VolantisProtocol protocol = getProtocol(context);
            ButtonScriptHandlerAttributes buttonAttributes = new ButtonScriptHandlerAttributes();
           
            String submitId = protocolAttributes.getId();
            if(null == submitId){
                submitId = protocol.getMarinerPageContext().generateUniqueFCID();
                protocolAttributes.setId(submitId);
            }
           
            buttonAttributes.setId(submitId);

            //if xf:label element was not specified for xf:submit element
            //then set label to the default value
            if (null == caption) {
                ((XFFormFieldAttributes)protocolAttributes)
                    .setCaption(new LiteralTextAssetReference(
                            DEFAULT_SUBMIT_CAPTION));
            }
           
            // wizard is embracing this element
            // wizard id is needed for proper action reference desciption
            WizardAttributes wizardAttrs = (WizardAttributes)wizard.getProtocolAttributes();
            final String wizardId = wizardAttrs.getId();
           
            // associate button with complete action
            final List memberList = new ArrayList();
            memberList.add(ActionName.COMPLETE);
            buttonAttributes.setActionReference(new ActionReference() {
                public String getWidgetId() {return wizardId;}
                public List getMemberNames() {return memberList;}
            });
           
            WidgetModule widgetModule = protocol.getWidgetModule();
View Full Code Here

            return;
        }     
       
       
        // Render only javascript responsible for handling button
        ButtonScriptHandlerAttributes actionButtonAttributes =
            (ButtonScriptHandlerAttributes) attributes;
       
        ActionReference actionReference = actionButtonAttributes.getActionReference();
       
        // Get disabled styles.
        StylesExtractor stylesExtractor =
            createStylesExtractor(protocol, attributes.getStyles());

        stylesExtractor.setPseudoClass(StatefulPseudoClasses.MCS_DISABLED);
       
        StringBuffer scriptBuffer = new StringBuffer();
       
        // Finally, render the JavaScript part.
        if (attributes.getId() != null) {
            scriptBuffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }

        scriptBuffer.append("new Widget.Button(")
            .append(createJavaScriptString(actionButtonAttributes.getId()))
            .append(",{")
            .append("disabledStyle:" + stylesExtractor.getJavaScriptStyles());
       
        if (actionReference != null) {
            scriptBuffer.append(",action:")
View Full Code Here

TOP

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

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.