Package com.volantis.mcs.protocols.response.attributes

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


    // Javadoc inherited   
    protected void doRenderCloseResponse(VolantisProtocol protocol,
        MCSAttributes attributes) throws ProtocolException {

        ResponseDatePickerAttributes responseDatePickerAttributes = (ResponseDatePickerAttributes) attributes;
           
        StringBuffer buffer = new StringBuffer();
       
        if (attributes.getId() != null) {
            buffer.append(createJavaScriptWidgetRegistrationOpening(attributes.getId()));           
            addCreatedWidgetId(attributes.getId());
        }
                           
        buffer.append("new Widget.Response.DatePicker(");

        String params[] = {
                responseDatePickerAttributes.getCurrentDate(),
                responseDatePickerAttributes.getRangeStart(),
                responseDatePickerAttributes.getRangeEnd()
        };
       
        for (int i = 0 ; i < params.length ; i++) {
            if (params[i] != null) {
                buffer.append("'" + params[i] + "'");
View Full Code Here


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

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

        String currentDate = attributes.getValue("", "current-date");
        String rangeStart = attributes.getValue("", "range-start");
        String rangeEnd = attributes.getValue("", "range-end");
       
        SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd");
        Date date = null;
       
        try {
          if(currentDate != null) { 
            date = dateFormater.parse(currentDate);
            responseDatePickerAttributes.setCurrentDate(dateFormater.format(date));
         
    } catch (ParseException e) {
      throw new XDIMEException("Invalid date format for current-date attribute.");     
    }

        try {
          if(rangeStart != null) {           
            date = dateFormater.parse(rangeStart);
            responseDatePickerAttributes.setRangeStart(dateFormater.format(date));
         
    } catch (ParseException e) {
      throw new XDIMEException("Invalid date format for range-start attribute.");     
    }

        try {
          if(rangeEnd != null) {           
            date = dateFormater.parse(rangeEnd);
            responseDatePickerAttributes.setRangeEnd(dateFormater.format(date));
         
    } catch (ParseException e) {
      throw new XDIMEException("Invalid date format for range-end attribute.");     
    }
                   
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.response.attributes.ResponseDatePickerAttributes

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.