dbforms
Tag dbform


a database application form (root element of a JSP view)

Example:
					this is the root element of a data manipulation form
				


Tag Information
Tag Classorg.dbforms.taglib.DbFormTag
TagExtraInfo Classorg.dbforms.taglib.DbFormTagTEI
Body ContentJSP
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
idfalsetruejava.lang.String expose id, enables interaction with JavaScript (not supported by all browsers!)
dbConnectionNamefalsetruejava.lang.String indicate which dbconnection object to user.
namefalsefalsejava.lang.String the name of this dbform tag needed to reference the tag if tableName attribute is calculated at runtime
tableNamefalsetruejava.lang.String the name of the table/view referenced by the dbform not required if form is empty!
actionfalsetruejava.lang.String Override the servlet to which the dbform should be submitted Default is the org.dbforms.Controller servlet Useful when dbForms is used in read-only mode. Example: < db:dbform table="TABLE1" followUp="this.jsp" action = "/demo/servlet/com.abc.myServlet">
readOnlyfalsetruejava.lang.String Rendering of read-only html widgets WARNING: This is not terribly secure as it becomes editable if javascript is disabled in the browser. A More secure option is not placing an update button on your form.
tableListfalsetruejava.lang.String Allows a user to specify a list of tables to select from Used in conjuction with the whereClause attribute The value specified in the tableList attribute is used to specify the 'from' part of the Select query. Hence the name: table list. The conditions used to define the table associations are specified in the whereClause attribute.( along with other conditions and orderBy) Multiple table access is valid only for data retrieval. Insert, Update, and Delete are not supported. Example: In dbForms-config.xml: <table name="AnyName"> <field name="Table1.id" fieldType="VARCHAR2" isKey="true"/> <field name="Table2.id" fieldType="VARCHAR2" isKey="true"/> <field name="Table1.fieldName" fieldType="VARCHAR2"/> <field name="Table2.OtherField" fieldType="NUMBER"/> </table> In jsp: <db:form tableName="AnyName" maxRows="*" followUp="next.jsp" tableList="Table1,Table2" whereClause="Where Table1.id = Table2.id"> <db:header/> <db:body> <db:textField fieldName="Table1.fieldName"/> <db:textField fieldName="Table2.otherField"/> </db:body> <db:footer/> </db:form> Resulting Query: SELECT Table1.id, Table2.id,Table1.fieldName,Table2.otherField FROM Table1,Table2 WHERE Table1.id = Table2.id
searchFilterRequiredfalsetruejava.lang.String If set to true, the actual resultSet is obtained only if search filters have been specified, otherwise an empty resultset is returned. Perfect for situations where, without search filters, the resultset would be much too large. This feature validates the following: searchTag contains a value the filter attribute (dbforms tag) contains a value a filter tag is specified
maxRowsfalsetruejava.lang.String Determines how many times the body tag and its sub-elements get executed (evaluated and rendered): maxRows = n => body gets executed n times (with n elementOF N) maxRows = "*" => body gets executed for every row in the table (=> "endless" form) not required if form is empty!
whereClausefalsetruejava.lang.String Replaces the filter attribute in situations where the whereClause is more complex. Allows a developer to specify a free form conditional clause (where Clause + order + etc). Also, the whereClause can not be used with orderBy or filter attributes. They will be ignored. Order by should be used within the whereClause instead. If you use the whereClause searching and sorting will not work! See the new <filter> tag to search/sort with complex where clauses. Example: <% StringBuffer whereClause = new StringBuffer(); whereClause.append("WHERE (FIELD1>'25' AND FIELD1<'50' ) OR FIELD2 NOT NULL ORDERBY FIELD7"); %> <db:dbform table="TABLE1" followUp="this.jsp" whereClause = "<%whereClause.toString()%>">
formValidatorNamefalsetruejava.lang.String this attribute contains the name of the form which is used for validation (defined in the validation.xml file).
captionResourcefalsetruejava.lang.String this attribute is to be used in conjunction with the internationalization support in dbForms v1.1+. It allows the developer to specify if the 'caption' attribute values, found in embedded button tags, should be looked up in the associated resource bundles. By default, this attribute is set to 'false'.
javascriptValidationfalsetruejava.lang.String this attribute is used to specify if client-side validation (javascript) should be executed. By default, this attribute is set to 'false'. Default javascripts are defined in the validator-rules.xml file.
javascriptValidationSrcFilefalsetruejava.lang.String this attribute allows a developer to specify a javascript file (.js) to be used for client-side validation. Default javascripts are defined in the validator-rules.xml file.
javascriptFieldsArrayfalsetruejava.lang.String this attribute is used to specify if dbForms should generate a javascript method which can be used by (javascript) developers for referencing dbform-generated field names . By default, this attribute is set to 'false'. Generated code example: <SCRIPT language="javascript"> <!-- var dbformFields = new Array(); dbformFields["phone"] = "f_0_0@root_8"; dbformFields["bugstate"] = "f_0_0@root_9"; dbformFields["reporter"] = "f_0_0@root_7"; dbformFields["priority"] = "f_0_0@root_2"; dbformFields["description"] = "f_0_0@root_4"; dbformFields["category"] = "f_0_0@root_1"; function getDbFormFieldName(name){ return dbformFields[name]; } --> </SCRIPT>
redisplayFieldsOnErrorfalsetruejava.lang.String In a jsp which contains many input fields, it may be desirable, in the event of an error, to redisplay input data.(instead of refreshing the fields from the DB) DbForms implements this functionality by default with INSERT fields only. If you choose to set this attribute to "true" then DbForms will redisplay entered values even with UPDATES.
followUpfalsetruejava.lang.String site to be invoked after action Note that buttons can override followUp (and followUpOnError) settings defined in the dbform tag
followUpOnErrorfalsetruejava.lang.String site to be invoked after action, if error occured on page Note that buttons can override followUp (and followUpOnError) settings defined in the dbform tag
autoUpdatefalsetruejava.lang.String if "true", at every action (navigation, insert, update, etc.) all input fields of ALL currently rendered rowsets are parsed and updated. many rows may be affected. This can be very useful if people need to change lots of data, even multiple datarows, at once if "false", updates are only performed if an explicite "update"- action is launched (normally by hitting the updateAction-button). Only the current row is affected. if "OnUpdateOnly", updates are only performed if an explicite "update" - action is launched (normally by hitting the updateAction-button), all input fields of ALL currently rendered rowsets are parsed and updated. Many rows may be affected. This can be very useful if people need to change lots of data, even multiple datarows, at once.
overrideFieldCheckfalsetruejava.lang.String If set to true the field values will not be checked if they are changed. The database update will be done always This could be usefull if you want to call your interceptor always to check fields which are not part of the table. In your interceptor you can use return DbEventInterceptor.IGNORE_OPERATION if you do not want the database update
parentFieldfalsetruejava.lang.String used in sub-form: field(s) in the main form that is/are linked to this form Should either be a key or set to sortable="true" in dbforms-config.xml
childFieldfalsetruejava.lang.String used in sub-form: field(s) in this form that is/are linked to the parent form Should either be a key or set to sortable="true" in dbforms-config.xml
targetfalsetruejava.lang.String pendant to the html-target attribute in html-form tag: the target frame to jump to
multipartfalsetruejava.lang.String multipart must be set to "true" if the form contains file-upload tags or if the form may be invoked by a form containing file-upload tags, orif it containts fields of BLOB or DISKBLOB. default is "false" (multipart-support off)
orderByfalsetruejava.lang.String a SQL orderBy-CLAUSE (without the keyword "ORDER BY") example: "id, name desc" "id" "id asc" "firstname asc, lastname desc" important: if you use a non-primary key, you MUST specify sortable="true" within your dbforms-config.xml file for the key you want to sort by if you do not specify it here, you may define it globally in your dbforms-config.xml file. If you do not specify any information, DbForms automatically takes the key-fields for sorting. remember field names are CASE SENSITIVE in DbForms framework (at least in current version)
filterfalsetruejava.lang.String definition of a FILTER. Format: Fieldname/Fielvalue pairs, seperated by , or ; symbol. Examples: filter="id=2" filter="id=2;name=Hugo Berger" filter="deptno=101,salery>=30000,name~Peter" the ~ symbol is an aquivalant to the SQL keyword "LIKE" used in SELECT statements! since version 0.9, you can use <, > <= and >= operators, too! <db:dbform tableName="employee" maxRows="*" followUp="/employees.jsp" autoUpdate="false" filter ="deptno=101,salary>=30000,name~Peter%" ... < /db:dbform > Operator: Meaning: Example: = Equals aField=value <> Not Equal aField<>value < Smaller then aField<100 > Greater then aField>0 <= Smaller then or equal aField<=100 >= Greater then or equal aField>=0 ~ Like aField~%P% Since version 1.1.3pr1: ISNULL is null aField ISNULL NOTISNULL is not null aField NOTISNULL By default, all filter definitions are ANDed together. If you wish to use OR, you may prefix your filter definition with the '|' symbol. (even better! - use the whereClause attribute ) Example: aFieldVal=3, |anotherField>3 would produce the following: ... where aFieldVal=3 OR anotherField>3 filter will be overwritten by searching!
sqlFilterfalsetruejava.lang.String a filter in sql syntax which will be added to the where clause
gotoPrefixfalsetruejava.lang.String allows to define a prefix applied to request parameters in order to provide a convenient and easyway of implementing navigation. Using this attribute may substitute the use of the more complicated and not very convenient GotoButton-Tag! example: if you define gotoPrefix="fv_" then you can call your jsp that way: customers.jsp?fv_id=4 => DbForms fetches the value of fv_ id which is "4" and then navigates to the row where id is 4. this attribute was added in release 0.9
gotoHtfalsetruejava.util.Hashtable allows to define a hashtable containing fieldName / fieldValue combinations which represent the valueof a key (which can consist of more than one field, of course!) example: you could define a hashtable "myGotoHash" and apply it to the attribute <%Hashtable myGotoHash = null;if(request.getParameter("goto")!=null) { myGotoHash = new Hashtable();myGotoHash.put("id",request.getParameter("goto")); }%> <db:form table="customer" followUp="customer.jsp" gotoHt="<%= myGotoHash %>" > ... some code ...</db:form> now, when a user calls aview.jsp?goto=234, then DbForms will navigate thetable to the row where id==234! there are many other ways you can use this facility. the only important thing is that the key value(s) in the hashtables refer to valid field names of the table. BE SURE TO SPECIFY ALL YOUR KEYS OR NAVIGATION WILL BE UNPREDICTABLE [ if you do not know what all the values should be, use a wildcard like: myGotoHash.put("how_used","*"); and navigation will be to the first instance this attribute was added in release 0.9
localWebEventfalsetruejava.lang.String this attribute allows a JSP view developer to trigger WebEvents(NavigationsEvents)on the JSP. No controller interaction is needed. This attribute aims to make linkage between dialogs easier. currently, the available "local web event"-commands are: navFirst navPrev navNext navLast navNew if a developer wants to show the last row of a table, then she/he could apply the value "navNext" to this attribute. Note that this attribute is evaluated in runtime, this gives additional flexibility this attribute was added in release 0.9
onSubmitfalsetruejava.lang.String JavaScript event handler executed before the form is submited. If the event handler returns FALSE, the form will not be submitted. When the result is TRUE, the form will be submitted
autocompletefalsetruejava.lang.String if the autocomplete value is specified then the attribute is inserted in the form tag. if the value is "off" and if the browser has autocompletion ability, it can be disabled with this tag. Any value will be accepted for autocomplete. e.g. autocomplete="any", the generated HTML code is: <form name="dbforms" ... autocomplete="any" ... >

Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.