public class TestDependency extends Object implements Dependency
Constructor and Description |
---|
TestDependency(Select country,
DependentSelect state) |
Modifier and Type | Method and Description |
---|---|
Object |
getInitialValues(Field f)
Returns the initial values for the target field These are the values that
are displayed when the form is first rendered.
|
boolean |
isSubmitDataValid(FormData fd)
Returns true if the submitted values are in a valid range of values.
|
void |
renderDependencyData(FormData fd,
Writer out)
Writes out data to keep track of dependency state.
|
void |
setDependencyDataFromSubmit(FormData fd,
javax.servlet.http.HttpServletRequest req)
The inverse of
renderDependencyData , sets any depedency data submitted
as part of the form. |
String |
toString() |
void |
updateValues(FormData fd,
javax.servlet.http.HttpServletRequest req)
Sets new values for target field in the FormData object.
|
public TestDependency(Select country, DependentSelect state)
public Object getInitialValues(Field f)
Dependency
If there is no initial data, the returned object can also be null or an empty data object, depending on what the target field expects when there is no data.
getInitialValues
in interface Dependency
public void updateValues(FormData fd, javax.servlet.http.HttpServletRequest req) throws DependencyException
Dependency
Note:This method invoke FormData.setDependencyUpdated()
if it sets new values in the formdata object. New values are values that
are different from the values that were last displayed to the client.
There are 2 conditions that typically must be satisfied for this to be true:
updateValues
in interface Dependency
DependencyException
public void setDependencyDataFromSubmit(FormData fd, javax.servlet.http.HttpServletRequest req)
Dependency
renderDependencyData
, sets any depedency data submitted
as part of the form. This data is set in the specified FormData
object
and can be later used by the updateValues
method.setDependencyDataFromSubmit
in interface Dependency
public void renderDependencyData(FormData fd, Writer out) throws SQLException, IOException
Dependency
renderDependencyData
in interface Dependency
SQLException
IOException
public boolean isSubmitDataValid(FormData fd)
Dependency
If this method is not applicable, this method should return true every time.
isSubmitDataValid
in interface Dependency