com.tle.web.wizard.scripting.objects
Interface ControlScriptObject
Declaration: public interface ControlScriptObject extends ScriptObject
All Superinterfaces: ScriptObject, java.io.Serializable

 

Referenced by the 'ctrl' variable in script

 

 

Methods Summary
abstract void clearInvalid()
    
Clear the invalid state of the control.
abstract java.lang.String getFormId()
    
Returns the ID of this control when displayed in the HTML
E.g.
abstract java.lang.String getValue()
    
Gets the current value of this control.
abstract boolean isEmpty()
    
Determines if this control has a value (for mandatory purposes)
abstract boolean isHidden()
    
abstract boolean isVisible()
    
abstract void setHidden(boolean hidden)
    
If set to true, the control is not shown on the page, but will retain it's value.
abstract void setInvalid(boolean invalid, java.lang.String message)
    
Mark the control as invalid so that the wizard is not considered complete.
abstract void setValue(java.lang.String value)
    
Sets a new value for this control.
abstract void setVisible(boolean visible)
    
If set to false, the control is not shown on the page AND it's value will be cleared Be careful not to confuse with setHidden, which does not clear the value.

 

Methods inherited from interface: com.tle.common.scripting.ScriptObject
scriptEnter, scriptExit

 

 

 

 

getValue

 

public abstract java.lang.String getValue( )

 

Gets the current value of this control.

 

Returns:
The stored value of this control

 

 

 

setValue

 

public abstract void setValue( java.lang.String value)

 

Sets a new value for this control. Will update any metadata that this control is mapped to.

 

Parameters:
value-
The new value for this control.

 

 

 

isHidden

 

public abstract boolean isHidden( )

 

Returns:
true if this control is not to be shown on the page.

 

 

 

setHidden

 

public abstract void setHidden( boolean hidden)

 

If set to true, the control is not shown on the page, but will retain it's value.

 

Parameters:
hidden-

 

 

 

isVisible

 

public abstract boolean isVisible( )

 

Returns:
false if this control is not to be shown on the page and not to store any metadata

 

 

 

setVisible

 

public abstract void setVisible( boolean visible)

 

If set to false, the control is not shown on the page AND it's value will be cleared Be careful not to confuse with setHidden, which does not clear the value.

 

Parameters:
visible-
The visibility of this control.

 

 

 

isEmpty

 

public abstract boolean isEmpty( )

 

Determines if this control has a value (for mandatory purposes)

 

Returns:
true if the control has no value

 

 

 

clearInvalid

 

public abstract void clearInvalid( )

 

Clear the invalid state of the control. Same as ctrl.setInvalid(false, null);

 

 

 

setInvalid

 

public abstract void setInvalid( boolean invalid,
java.lang.String message)

 

Mark the control as invalid so that the wizard is not considered complete. (The item will not be allowed to be published until the control is valid)

 

Parameters:
invalid-
true if the control is not valid.
message-
A message to display to the user.

 

 

 

getFormId

 

public abstract java.lang.String getFormId( )

 

Returns the ID of this control when displayed in the HTML
E.g. <input id="theid" type="text">

Note that not all controls will be rendered as a simple HTML equivalent (for example: the load attachments control) in this case the form ID is actually an ID prefix for all of the HTML elements rendered by this control.

 

Returns:
The ID or ID-prefix as rendered in the HTML