HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.transform.actions
Class SetFormValue

java.lang.Object
  extended by com.ibm.hats.transform.actions.ScriptAction
      extended by com.ibm.hats.transform.actions.SetFormValue

public class SetFormValue
extends ScriptAction

This class represents the action to set a value at the specified position. The underlying Javascript will use this position and length to update all HTML input controls on the form with the correct value. The current implementation of this class generates code similar to the following:

     checkInput2('in_123_10', 'myvalue','hidden')
 
where "123" is the linear, 1-based cursor position, where "10" is the length of the area to update, and where "myvalue" is the updated value.


Field Summary
 
Fields inherited from class com.ibm.hats.transform.actions.ScriptAction
LANG_JAVASCRIPT
 
Constructor Summary
SetFormValue(String value, int pos, int length)
          Constructs a new SetFormValue object.
SetFormValue(String value, int pos, int length, int screenId)
          Constructs a new SetFormValue object.
 
Method Summary
 String generateScript(String language, ContextAttributes contextAttributes)
          Returns the generated script.
 int getLength()
          Returns the length.
 int getPos()
          Returns the position.
 int getScreenId()
           
 String getValue()
          Returns the value.
 void setLength(int length)
          Sets the length.
 void setPos(int pos)
          Sets the position.
 void setScreenId(int screenId)
           
 void setValue(String value)
          Sets the value.
 
Methods inherited from class com.ibm.hats.transform.actions.ScriptAction
combineScriptActions, combineScriptActions, generateScript, generateScript, generateScript, generateScript, generateScript
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetFormValue

public SetFormValue(String value,
                    int pos,
                    int length)
Constructs a new SetFormValue object.

Parameters:
value - new value
pos - linear, 1-based screen position
length - length of the region to update

SetFormValue

public SetFormValue(String value,
                    int pos,
                    int length,
                    int screenId)
Constructs a new SetFormValue object.

Parameters:
value - new value
pos - linear, 1-based screen position
length - length of the region to update
Method Detail

generateScript

public String generateScript(String language,
                             ContextAttributes contextAttributes)
Returns the generated script. Example of a script generated with this method:

     checkInput2('in_123_10', 'myvalue','hidden')
 

Specified by:
generateScript in class ScriptAction
Parameters:
language - The language.
contextAttributes - The context attributes.
Returns:
The generated script.

getLength

public int getLength()
Returns the length.

Returns:
int

getPos

public int getPos()
Returns the position.

Returns:
int

getValue

public String getValue()
Returns the value.

Returns:
String

getScreenId

public int getScreenId()

setLength

public void setLength(int length)
Sets the length.

Parameters:
length - The length to set

setPos

public void setPos(int pos)
Sets the position.

Parameters:
pos - The pos to set

setValue

public void setValue(String value)
Sets the value.

Parameters:
value - The value to set

setScreenId

public void setScreenId(int screenId)

HATS 7.5.1 (201005110649)