Package muntjac :: Package ui :: Module login_form :: Class LoginForm
[hide private]
[frames] | no frames]

Class LoginForm

source code

                             object --+                        
                                      |                        
                    util.IEventListener --+                    
                                          |                    
              terminal.paintable.IPaintable --+                
                                              |                
                                 object --+   |                
                                          |   |                
     terminal.variable_owner.IVariableOwner --+                
                                              |                
                                 object --+   |                
                                          |   |                
                terminal.sizeable.ISizeable --+                
                                              |                
                           component.IComponent --+            
                                                  |            
                                     object --+   |            
                                              |   |            
   event.method_event_source.IMethodEventSource --+            
                                                  |            
               abstract_component.AbstractComponent --+        
                                                      |        
                             object --+               |        
                                      |               |        
                    util.IEventListener --+           |        
                                          |           |        
              terminal.paintable.IPaintable --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
     terminal.variable_owner.IVariableOwner --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
                terminal.sizeable.ISizeable --+       |        
                                              |       |        
                           component.IComponent --+   |        
                                                  |   |        
            component_container.IComponentContainer --+        
                                                      |        
abstract_component_container.AbstractComponentContainer --+    
                                                          |    
                           custom_component.CustomComponent --+
                                                              |
                                                             LoginForm

LoginForm is a Muntjac component to handle common problem among Ajax applications: browsers password managers don't fill dynamically created forms like all those UI elements created by Muntjac.

For developer it is easy to use: add component to a desired place in you UI and add ILoginListener to validate form input. Behind the curtain LoginForm creates an iframe with static html that browsers detect.

Login form is by default 100% width and height, so consider using it inside a sized Panel or Window.

Login page html can be overridden by replacing protected getLoginHTML method. As the login page is actually an iframe, styles must be handled manually. By default component tries to guess the right place for theme css.

Note, this is a new Ajax terminal specific component and is likely to change.

Instance Methods [hide private]
 
__init__(self)
Constructs a new custom component.
source code
 
getLoginHTML(self)
Returns byte array containing login page html.
source code
 
attach(self)
Notifies all contained components that the container is attached to a window.
source code
 
detach(self)
Notifies all contained components that the container is detached from a window.
source code
 
addListener(self, listener, iface=None)
Adds ILoginListener to handle login logic.
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Removes ILoginListener.
source code
 
removeCallback(self, callback, eventType=None) source code
 
setWidth(self, width, unit=None)
Sets the width of the object.
source code
 
setHeight(self, height, unit=None)
Sets the height of the object.
source code
 
getUsernameCaption(self)
Returns the caption for the user name field.
source code
 
setUsernameCaption(self, usernameCaption)
Sets the caption to show for the user name field.
source code
 
getPasswordCaption(self)
Returns the caption for the password field.
source code
 
setPasswordCaption(self, passwordCaption)
Sets the caption to show for the password field.
source code
 
getLoginButtonCaption(self)
Returns the caption for the login button.
source code
 
setLoginButtonCaption(self, loginButtonCaption)
Sets the caption (button text) to show for the login button.
source code

Inherited from custom_component.CustomComponent: addComponent, getComponentCount, getComponentIterator, getComponentType, getCompositionRoot, moveComponentsFrom, paintContent, removeAllComponents, removeComponent, replaceComponent, setComponentType, setCompositionRoot

Inherited from abstract_component_container.AbstractComponentContainer: fireComponentAttachEvent, fireComponentDetachEvent, getInvalidSizedChildren, repaintChangedChildTrees, repaintChildTrees, requestRepaintAll, setEnabled

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, changeVariables, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, focus, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, parseStringSize, registerCallback, registerListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidthUnits, withdrawCallback, withdrawListener

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _UNDEFINED_HEIGHT = '140px'
  _UNDEFINED_WIDTH = '200px'

Inherited from custom_component.CustomComponent: CLIENT_WIDGET

Inherited from abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructs a new custom component.

The component is implemented by wrapping the methods of the composition root component given as parameter. The composition root must not be null and can not be changed after the composition.

Parameters:
  • compositionRoot - the root of the composition component tree.
Overrides: object.__init__
(inherited documentation)

getLoginHTML(self)

source code 

Returns byte array containing login page html. If you need to override the login html, use the default html as basis. Login page sets its target with javascript.

Returns:
byte array containing login page html

attach(self)

source code 

Notifies all contained components that the container is attached to a window.

Overrides: component.IComponent.attach
(inherited documentation)

detach(self)

source code 

Notifies all contained components that the container is detached from a window.

Overrides: component.IComponent.detach
(inherited documentation)

addListener(self, listener, iface=None)

source code 

Adds ILoginListener to handle login logic.

Parameters:
  • listener - the new IListener to be registered.
Raises:
  • ValueError - unless method has a match in object
Overrides: event.method_event_source.IMethodEventSource.addListener

addCallback(self, callback, eventType=None, *args)

source code 
Overrides: terminal.paintable.IPaintable.addCallback

removeListener(self, listener, iface=None)

source code 

Removes ILoginListener.

Parameters:
  • listener - the listener to be removed.
Overrides: event.method_event_source.IMethodEventSource.removeListener

removeCallback(self, callback, eventType=None)

source code 
Overrides: terminal.paintable.IPaintable.removeCallback

setWidth(self, width, unit=None)

source code 

Sets the width of the object. Negative number implies unspecified size (terminal is free to set the size).

Parameters:
Overrides: terminal.sizeable.ISizeable.setWidth
(inherited documentation)

setHeight(self, height, unit=None)

source code 

Sets the height of the object. Negative number implies unspecified size (terminal is free to set the size).

Parameters:
  • args - tuple of the form
    • (height)
      1. the height of the object in units specified by heightUnits property or the height of the component using string presentation. String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size.
    • (height, unit)
      1. the height of the object.
      2. the unit used for the width. Possible values include UNITS_PIXELS, UNITS_POINTS, UNITS_PICAS, UNITS_EM, UNITS_EX, UNITS_MM, UNITS_CM, UNITS_INCH, UNITS_PERCENTAGE.
Overrides: terminal.sizeable.ISizeable.setHeight
(inherited documentation)

setUsernameCaption(self, usernameCaption)

source code 

Sets the caption to show for the user name field. The caption cannot be changed after the form has been shown to the user.

setPasswordCaption(self, passwordCaption)

source code 

Sets the caption to show for the password field. The caption cannot be changed after the form has been shown to the user.

setLoginButtonCaption(self, loginButtonCaption)

source code 

Sets the caption (button text) to show for the login button. The caption cannot be changed after the form has been shown to the user.