Package org.apache.empire.struts2.jsp.components

Examples of org.apache.empire.struts2.jsp.components.DataValueComponent


    }
   
    @Override
    public void renderInput(HtmlWriter writer, ControlInfo ci)
    {
        HtmlTag input = writer.startTag("textarea");
        input.addAttribute("id",    ci.getId());
        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        input.addAttribute("name",  ci.getName());
        input.addAttribute("disabled", ci.getDisabled());
        input.addAttribute("rows",  Math.max(ci.getVSize(), 2));
        input.addAttribute("cols",  Math.max(ci.getHSize(), 1));
        // maxlength
        if (ci.getDisabled()==false)
        {   // Get Max Length
            String checklength = getFormatOption(ci, "maxlength:");
            if (StringUtils.isValid(checklength))
            {   // Do lengthcheck via onKeyPress and onKeyUp Events
                int maxLength = (int)ci.getColumn().getSize();
                checklength = StringUtils.replace(checklength, "{0}", String.valueOf(maxLength));
                input.addAttribute("onkeypress", checklength);
                input.addAttribute("onkeyup",    checklength);
            }  
        }
        // Event Attributes
        input.addAttribute("onclick",   ci.getOnclick());
        input.addAttribute("onchange",  ci.getOnchange());
        input.addAttribute("onfocus",   ci.getOnfocus());
        input.addAttribute("onblur",    ci.getOnblur());
        // Body
        String value = StringUtils.toString(ci.getValue());
        value = StringEscapeUtils.escapeHtml(value);
        input.beginBody(value);
        // End
        input.endTag();
    }
View Full Code Here


        // Create
        InputControl control = InputControlManager.getControl(controlType);
        if (control==null)
            control= InputControlManager.getControl("text");
        // Create component
        return new DataValueComponent(control, stack, req, res);
    }
View Full Code Here

        action = checkAction(action);
       
        super.populateParams();

        // Component
        DataValueComponent comp = (DataValueComponent)component;

        // Control Component
        comp.setOptions( getLookupOptions() );
        comp.setColumn (getColumn());
        comp.setRecordValue(getValue());
        comp.setNullValue(getObject(nullValue, null));
        comp.setBodyUsage(body);
        comp.setFormat(format);
       
        // Data Value Component
        comp.setHtmlTag(tag);
        if (action!=null)
        {
            comp.setAction(action);
            comp.setUrlType(urlType);
            comp.setAlt(getItemValue(alt));
            comp.setAnchorClass(anchorClass);
            if (action.startsWith("javascript:")==false)
                comp.setParam(str(param, getActionItemPropertyName()), getItemValue(item));
        }
       
        // Common UI
        comp.setOnclick(onclick);
        comp.setOndblclick(ondblclick);
        comp.setCssClass(cssClass);
        comp.setCssStyle(cssStyle);
       
    }
View Full Code Here

        // Create
        InputControl control = InputControlManager.getControl(controlType);
        if (control==null)
            control= InputControlManager.getControl("text");
        // Create component
        return new DataValueComponent(control, stack, req, res);
    }
View Full Code Here

        action = checkAction(action);
       
        super.populateParams();

        // Component
        DataValueComponent comp = (DataValueComponent)component;

        // Control Component
        comp.setOptions( getLookupOptions() );
        comp.setColumn (getColumn());
        comp.setRecordValue(getValue());
        comp.setNullValue(getObject(nullValue, null));
        comp.setBodyUsage(body);
        comp.setFormat(format);
       
        // Data Value Component
        comp.setHtmlTag(tag);
        if (action!=null)
        {
            comp.setAction(action);
            comp.setAlt(getItemValue(alt));
            comp.setAnchorClass(anchorClass);
            if (action.startsWith("javascript:")==false)
                comp.setParam(str(param, getActionItemPropertyName()), getItemValue(item));
        }
       
        // Common UI
        comp.setOnclick(onclick);
        comp.setOndblclick(ondblclick);
        comp.setCssClass(cssClass);
        comp.setCssStyle(cssStyle);
       
    }
View Full Code Here

        // Create
        InputControl control = InputControlManager.getControl(controlType);
        if (control==null)
            control= InputControlManager.getControl("text");
        // Create component
        return new DataValueComponent(control, stack, req, res);
    }
View Full Code Here

        action = checkAction(action);
       
        super.populateParams();

        // Component
        DataValueComponent comp = (DataValueComponent)component;

        // Control Component
        comp.setOptions( getLookupOptions() );
        comp.setColumn (getColumn());
        comp.setRecordValue(getValue());
        comp.setNullValue(getObject(nullValue, null));
        comp.setBodyUsage(body);
        comp.setFormat(format);
       
        // Data Value Component
        comp.setHtmlTag(tag);
        if (action!=null)
        {
            comp.setAction(action);
            comp.setAlt(getItemValue(alt));
            comp.setAnchorClass(anchorClass);
            comp.setParam(str(param, getActionItemPropertyName()), getItemValue(item));
        }
       
        // Common UI
        comp.setOnclick(onclick);
        comp.setOndblclick(ondblclick);
        comp.setCssClass(cssClass);
        comp.setCssStyle(cssStyle);
       
    }
View Full Code Here

            if (ObjectUtils.contains(keyColumns, col))
                continue;
            // Get the value from the input control
            Object value = null;
            String field = getRequestFieldName(col);
            InputControl control = null;
            if (record.isFieldReadOnly(col)==false)
                control = InputControlManager.getControl(col.getControlType());
            // Get Value from Control first
            if (control!=null && (value=control.getFieldValue(field, action, locale, col))!=null)
            {   // Check for Error
                if (value instanceof InputControl.FieldValueError)
                {
                    InputControl.FieldValueError fieldError = (InputControl.FieldValueError)value;
                    // Error
View Full Code Here

            if (ObjectUtils.contains(keyColumns, col))
                continue;
            // Get the value from the input control
            Object value = null;
            String field = getRequestFieldName(col);
            InputControl control = null;
            if (record.isFieldReadOnly(col)==false)
                control = InputControlManager.getControl(col.getControlType());
            // Get Value from Control first
            if (control!=null && (value=control.getFieldValue(field, action, locale, col))!=null)
            {   // Check for Error
                if (value instanceof InputControl.FieldValueError)
                {
                    InputControl.FieldValueError fieldError = (InputControl.FieldValueError)value;
                    // Error
View Full Code Here

        {
            log.error("cannot determine action URL. Request object does not implement WebRequest");
            return null;
        }
        // We have a webRequest   
        WebRequest webRequest = (WebRequest)request;
        // Get the uri
        String uri = "/" + action;
        if (uri.indexOf('.')<0)
            uri += ".action";
        // now build the url
        return UrlHelperEx.buildUrl(uri, webRequest.getRequestContext(), webRequest.getResponseContext(), parameters, null, true, true);
    }
View Full Code Here

TOP

Related Classes of org.apache.empire.struts2.jsp.components.DataValueComponent

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.