Class AbstractTextSettings<T extends AbstractTextSettings<T>>

    • Constructor Detail

      • AbstractTextSettings

        public AbstractTextSettings()
    • Method Detail

      • onChange

        public T 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 BasicSettings<T extends AbstractTextSettings<T>>
        Parameters:
        action - databroker action
        Returns:
        a reference to this object - used to chain calls