Class DateSettings

    • Constructor Detail

      • DateSettings

        public DateSettings()
    • Method Detail

      • getThis

        protected DateSettings getThis()
        Description copied from class: BasicSettings
        Returns the exact type of the this reference.
        It's a way to recover the type of the this object in a class hierarchy (cf. getThis "trick").
        Specified by:
        getThis in class BasicSettings<DateSettings>
        Returns:
        The exact type of the this reference
      • onChange

        public DateSettings onChange​(java.lang.String action)
        Description copied from class: BasicSettings
        Bind the "change" event to the given databroker action.
        Example:
         <jalios:field name="mytextfield" label="My Textfield" description="<span class='label label-info'>Reversed string: <em class='reverse-string'></em></span>">
           <jalios:control settings='<%= new TextFieldSettings().onChange("reverse") %>' />
         </jalios:field>
         <jalios:javascript>
         !function ($) {
           // Action regexp
           var pattern = /reverse/i;
        
           var callback = function(event) {
             var broker = $.jalios.Event.match(event, 'broker', pattern, true);
             if (!broker){ return; }
        
             // Element
             var elm = broker.source.currentTarget;
             broker.options._broked = true;
        
             var reverseString = $(elm).val().split('').reverse().join('');
             $(elm).closest('.widget-content').find('.help-block .reverse-string').html(reverseString);
           }
        
           var register = function() {
             // Register to broker
             $(document).on("jalios:broker", callback);
           }
        
           // Initialization on DOM ready
           $(document).ready(function($) {
             register();
           });
        
         }(window.jQuery);
         </jalios:javascript>
         
        Overrides:
        onChange in class AbstractTextSettings<DateSettings>
        Parameters:
        action - databroker action
        Returns:
        a reference to this object - used to chain calls
      • displayTime

        public DateSettings displayTime()
        Specify whether the control display the time and allows the time to be selected in the datepicker.
        Returns:
        a reference to this object - used to chain calls
      • displayDateOnly

        public DateSettings displayDateOnly()
        Specify whether the control displays only the date (not the time) and allows only the date (not the time) to be selected in the datepicker.
        Returns: