org.paneris.jal.model
Class DDField

java.lang.Object
  extended by org.paneris.jal.model.DDField

public class DDField
extends java.lang.Object

This represents the results data for an individual Field in the database.

How come setValue(Object O) doesn't supercede setValue(string v)? Cos object is an object so the signature is different to compiler and JVM looks for methods with exactly this object type, then one with an object. ???????????????? Exactly. To get a String passed into the setValue(Object) form you would need to cast it explicitly, e.g.: String s="hello"; setValue((Object)s);


Constructor Summary
DDField(java.lang.String db, java.lang.Integer fieldNumber)
          Construct a results field given a database, and a field number.
 
Method Summary
 java.lang.String getCSVValue()
          formats this field to be output to a CSV format file We delegate all this work to the (static) class CSVUtil
 java.lang.String getDisplayValue()
           
 java.lang.String getDropDown()
          build a drop down list for this field (with the current value selected)
 java.lang.String getDropDown(java.lang.String allValue)
          build a drop down list for this field (with the current value selected), this would normally be used to build drop-downs for templates
 java.lang.String getDropDown(java.lang.String fieldname, boolean mandatory, java.lang.String allName)
          Does the work of creating HTML select tags.
 java.lang.String getDropDown(java.lang.String name, java.lang.String allValue)
          build a drop down list for this field (with the current value selected), this would normally be used to build drop-downs for templates
 java.lang.String getHiddenValue()
          formats this field to be displayed on a html page as a hidden input of the correct type We delegate all this work of creating HTML to (the static class) HTMLUtil
 java.lang.String getHiddenValueWithPostfix(java.lang.String postfix)
           
 java.lang.String getInputValue()
          formats this field to be displayed on a html page as in input box of the correct type
 java.lang.String getInputValue(java.lang.String allValue)
          formats this field to be displayed on a html page as in input box of the correct type If it is a lookup field then set allValue if you would like an extra option with value 0 (and display value allValue)
 java.lang.String getInputValueWithPostfix(java.lang.String postfix)
           
 java.lang.String getJavascriptDisplayValue()
          formats this field to be displayed on a web page.
 java.lang.String getJSValidation()
           
 java.lang.String getJSValidation(java.lang.String displayname)
           
 java.lang.String getJSValidation(java.lang.String fieldname, java.lang.String displayname)
           
 java.lang.String getJSValidation(java.lang.String fieldname, java.lang.String displayname, boolean mandatory)
          Does the work of creating JavaScript functions for validation.
 java.lang.String getJSValidationWithPostfix(java.lang.String postfix)
          Utility for multiple record editing
 java.lang.String getLinkedSelect()
          build a drop down list for this field (with the current value selected)
 java.lang.String getLinkedSelect(java.lang.String allName)
          build a drop down list for this field (with the current value selected), this would normally be used to build drop-downs for templates
 java.lang.String getLinkedSelect(java.lang.String fieldname, boolean mandatory, boolean unique, java.lang.String allValue, java.lang.String allName)
           
 DDRecord getLookup()
          Gos and gets the results set if this field has a lookup.
 FieldMetaData getMetaData()
          returns the metaData
 ValidationProblem getProblem()
          Does some checks and returns any problems
 java.lang.String getStringValue()
          return the string value
 java.lang.Object getValue()
          returns the value
 void setProblem(ValidationProblem prob)
          Sets the problem field
 void setValue(java.lang.Object v)
          sets the value from an object.
 void setValue(java.lang.String v)
          sets the value
 void setValueFromLookup(java.lang.String v)
          sets the value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDField

public DDField(java.lang.String db,
               java.lang.Integer fieldNumber)
        throws java.lang.Exception
Construct a results field given a database, and a field number.

Throws:
java.lang.Exception
Method Detail

getLookup

public DDRecord getLookup()
                   throws java.lang.Exception
Gos and gets the results set if this field has a lookup. If not it will just return null

Throws:
java.lang.Exception

getJavascriptDisplayValue

public java.lang.String getJavascriptDisplayValue()
                                           throws java.lang.Exception
formats this field to be displayed on a web page. this method will return null if the value is not set - bit controversial, but it allows the value to be used in the webmacro #if directive

Throws:
java.lang.Exception

getDisplayValue

public java.lang.String getDisplayValue()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getCSVValue

public java.lang.String getCSVValue()
                             throws java.lang.Exception
formats this field to be output to a CSV format file We delegate all this work to the (static) class CSVUtil

Throws:
java.lang.Exception

getHiddenValue

public java.lang.String getHiddenValue()
                                throws java.lang.Exception
formats this field to be displayed on a html page as a hidden input of the correct type We delegate all this work of creating HTML to (the static class) HTMLUtil

Throws:
java.lang.Exception

getHiddenValueWithPostfix

public java.lang.String getHiddenValueWithPostfix(java.lang.String postfix)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getInputValue

public java.lang.String getInputValue()
                               throws java.lang.Exception
formats this field to be displayed on a html page as in input box of the correct type

Throws:
java.lang.Exception

getInputValue

public java.lang.String getInputValue(java.lang.String allValue)
                               throws java.lang.Exception
formats this field to be displayed on a html page as in input box of the correct type If it is a lookup field then set allValue if you would like an extra option with value 0 (and display value allValue)

Throws:
java.lang.Exception

getInputValueWithPostfix

public java.lang.String getInputValueWithPostfix(java.lang.String postfix)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getLinkedSelect

public java.lang.String getLinkedSelect()
                                 throws java.lang.Exception
build a drop down list for this field (with the current value selected)

Throws:
java.lang.Exception

getLinkedSelect

public java.lang.String getLinkedSelect(java.lang.String allName)
                                 throws java.lang.Exception
build a drop down list for this field (with the current value selected), this would normally be used to build drop-downs for templates

Throws:
java.lang.Exception

getLinkedSelect

public java.lang.String getLinkedSelect(java.lang.String fieldname,
                                        boolean mandatory,
                                        boolean unique,
                                        java.lang.String allValue,
                                        java.lang.String allName)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getDropDown

public java.lang.String getDropDown()
                             throws java.lang.Exception
build a drop down list for this field (with the current value selected)

Throws:
java.lang.Exception

getDropDown

public java.lang.String getDropDown(java.lang.String allValue)
                             throws java.lang.Exception
build a drop down list for this field (with the current value selected), this would normally be used to build drop-downs for templates

Throws:
java.lang.Exception

getDropDown

public java.lang.String getDropDown(java.lang.String name,
                                    java.lang.String allValue)
                             throws java.lang.Exception
build a drop down list for this field (with the current value selected), this would normally be used to build drop-downs for templates

Throws:
java.lang.Exception

getDropDown

public java.lang.String getDropDown(java.lang.String fieldname,
                                    boolean mandatory,
                                    java.lang.String allName)
                             throws java.lang.Exception
Does the work of creating HTML select tags. We delegate all this work of creating HTML to (the static class) HTMLUtil

Throws:
java.lang.Exception

getJSValidation

public java.lang.String getJSValidation(java.lang.String fieldname,
                                        java.lang.String displayname,
                                        boolean mandatory)
                                 throws java.lang.Exception
Does the work of creating JavaScript functions for validation. We delegate all this work of creating HTML to (the static class) HTMLUtil

Throws:
java.lang.Exception

getJSValidation

public java.lang.String getJSValidation(java.lang.String fieldname,
                                        java.lang.String displayname)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getJSValidation

public java.lang.String getJSValidation(java.lang.String displayname)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getJSValidation

public java.lang.String getJSValidation()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getJSValidationWithPostfix

public java.lang.String getJSValidationWithPostfix(java.lang.String postfix)
                                            throws java.lang.Exception
Utility for multiple record editing

Throws:
java.lang.Exception

getValue

public java.lang.Object getValue()
returns the value


getMetaData

public FieldMetaData getMetaData()
returns the metaData


getStringValue

public java.lang.String getStringValue()
return the string value


getProblem

public ValidationProblem getProblem()
Does some checks and returns any problems


setProblem

public void setProblem(ValidationProblem prob)
Sets the problem field


setValue

public void setValue(java.lang.Object v)
sets the value from an object. It is intended that this function be used to quickly insert objects into our DDField which have been extracted from a database (via JDBC). Hence we do not expect any validation errors (famous last words :-) and do not validate. I've left the code in, though, so we can change our minds.


setValueFromLookup

public void setValueFromLookup(java.lang.String v)
                        throws java.lang.Exception
sets the value

Throws:
java.lang.Exception

setValue

public void setValue(java.lang.String v)
sets the value



Copyright © 2000-2008 PanEris. All Rights Reserved.