Class PromptConstantTransform

    • Field Detail

      • markDefaultAnswerAsComplex

        public FormalParameter markDefaultAnswerAsComplex
        Enforces application to mark given default answer, if exists, as complex.
        Complex default answers are those that can't be displayed with given prompt style because of its complexity. Most likely, these kind of answers are displayed below prompt question and expanded to corresponding expression format. This flag overrules prompt definition by marking complex given default answer.
        This flag is used as boolean value.
      • displayDynamicDateAsStatic

        public FormalParameter displayDynamicDateAsStatic
        Enforces application to display the dynamic date as a static date.
        If this formal parameter is set to true, then the dynamic date (e.g. Today + 1) will not be displayed as a complex answer. It would be resolved as a static date and the answer would be populated in the text box of the prompt. This flag is used as boolean value.
        Since:
        MicroStrategy Web 8.0.2
      • TIME_FORMAT_NONE

        public static final int TIME_FORMAT_NONE
        Value for formal parameter timeFieldFormat to indicate that there is no time display
        Since:
        MicroStrategy Web 8.0.2
        See Also:
        Constant Field Values
      • TIME_FORMAT_HOUR_MINUTES

        public static final int TIME_FORMAT_HOUR_MINUTES
        Value for formal parameter timeFieldFormat to indicate that time display contains hours and minutes.
        Since:
        MicroStrategy Web 8.0.2
        See Also:
        Constant Field Values
      • TIME_FORMAT_HOUR_MINUTES_SECONDS

        public static final int TIME_FORMAT_HOUR_MINUTES_SECONDS
        Value for formal parameter timeFieldFormat to indicate that time display contains hours, minutes and seconds.
        Since:
        MicroStrategy Web 8.0.2
        See Also:
        Constant Field Values
    • Constructor Detail

      • PromptConstantTransform

        public PromptConstantTransform()
        Default no-args constructor, initialize all the formal parameters.
    • Method Detail

      • isAnswerComplex

        public boolean isAnswerComplex()
        Indicates whether or not current answer is complex or not.
        It is complex if answer type is unknown.
        Specified by:
        isAnswerComplex in class AbstractPromptObjectTransform
        Returns:
        boolean true if Prompt's answer is considered as complex.
      • areThereAvailableSelections

        public boolean areThereAvailableSelections()
        Indicates whether or not there are available items.
        This function checks size of available selections. Returns false when selections are less or equal to zero.
        Overrides:
        areThereAvailableSelections in class AbstractPromptObjectTransform
        Returns:
        boolean true if available selection is greater than 0
      • getAnswer

        protected java.lang.String getAnswer()
        Indicates current prompt answer.
        Obtain the current String answer given to the prompt or a default one, if defined.
        Returns:
        String answer text
      • getDescription

        public java.lang.String getDescription()
        Indicates this transform's description.
        Specified by:
        getDescription in interface Transform
        Returns:
        the description of a constant answer.
      • renderDateField

        public void renderDateField​(MarkupOutput out)
        Renders the date field when the time field display is enabled.
        This method renders a text box for user to enter the date part of the answer.
        JavaScript is used to concatenate the values in the date field and the time field.
        Parameters:
        out - MarkupOutput where to write Calendar HTML code.
        Since:
        MicroStrategy Web 8.0.2
      • renderInputText

        public void renderInputText​(MarkupOutput out)
        Renders an HTML input tag to indicate prompt answer.
        It'll get answer's argument name for prompt event and create an HTML input tag whose id corresponds to given argument.
        Parameters:
        out - MarkupOutput where to write HTML input tag.
        Since:
        MicroStrategy Web 8.0.0
      • renderInputText

        public void renderInputText​(MarkupOutput out,
                                    java.lang.String argument)
        Renders an HTML input tag with ID property set to argument.
        Parameters:
        out - MarkupOutput where to write HTML input tag.
        argument - String input tag ID.
        Since:
        MicroStrategy Web 8.0.0
      • renderTimeField

        public void renderTimeField​(MarkupOutput out)
        Renders the time field as Hour/Minutes or Hour/Minutes/Seconds
        It renders the Hour in 12 Hour and 24 Hour formats and the JavaScript code enables one of them based on the client machines regional settings.
        The time separator (mstrweb.4682) is used in display portion as well as for concatenating the hour and minutes for the answer.
        Parameters:
        out - MarkupOutput where to write HTML input tag.
        Since:
        MicroStrategy Web 8.0.2
      • renderCalendar

        public void renderCalendar​(MarkupOutput out)
        Renders calendar HTML code.
        It obtains Id for textbox where date will be written by getting prompt's event answer argument. Also, it assigns the Calendar an unique Id.
        Parameters:
        out - MarkupOutput where to write Calendar HTML code.
        Since:
        MicroStrategy Web 8.0.0
      • renderCalendarForDateField

        public void renderCalendarForDateField​(MarkupOutput out)
        Renders calendar HTML code.
        This method is used along with renderDateField(MarkupOutput) method.
        Parameters:
        out - MarkupOutput where to write Calendar HTML code.
        Since:
        MicroStrategy Web 8.0.2
      • renderCalendar

        public void renderCalendar​(MarkupOutput out,
                                   java.lang.String argument,
                                   java.lang.String calendarArg)
        Renders calendar HTML code.
        It takes as parameters argument indicating which Textbox to write Dates and unique Id for Calendar denoted by calendarArg.
        Parameters:
        out - MarkupOutput where to writhe Calendar HTML code.
        argument - String Id denoting textbox
        calendarArg - String Unique Id for Calendar object.
        Since:
        MicroStrategy Web 8.0.0
      • isDisplayTimeEnabled

        public boolean isDisplayTimeEnabled()
        Returns true if the Time field needs to be displayed.
        This is based on the value of the FormalParameter timeFieldFormat and also on the data type of the constant prompt.
        Since:
        MicroStrategy Web 8.0.2
      • validData

        protected boolean validData​(java.lang.String value,
                                    int dataType)
        Validates value corresponds to given datatype.
        It checks whether value entered corresponds to datatype in attribute form.
        Parameters:
        value - String to be validated
        dataType - to determine what kind of value is being validated against.
        Returns:
        boolean true if data is valid for this prompt type/style