|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jdeveloper.html.WebBeanImpl | +--oracle.jdeveloper.html.DataWebBeanImpl | +--oracle.jbo.html.databeans.JSEditCurrentRecord
The EditCurrentRecord Data Web Bean edits the current record of a View Object's RowSet. This Web Bean contains two main entry points render() and execute().
JDeveloper's JSP Element wizard instantiates the EditCurrentRecord class in a jsp:useBean tag in a .JSP file. Along with the class, the wizard also includes an ID and a scope declaration set to request. If you change the scope to any other value, you will have to handle possible multithreading issues.
The definition of an EditCurrentRecord edit form provided by the wizard includes these methods: setUseRoundedCorners, setSubmitText, setDeleteText, setShowRecordNumbers, setMaximumFieldWidth, setMaximumFieldHeight, setReleaseApplicationResources, initialize, and render. For example:
<jsp:useBean class="oracle.jbo.html.databeans.EditCurrentRecord" id="efDetail" scope="request" > <% efDetail.setUseRoundedCorners(true); efDetail.setSubmitText("Save Changes"); efDetail.setDeleteText("Delete Record"); efDetail.setShowRecordNumbers(true); efDetail.setMaximumFieldWidth(40); efDetail.setMaximumFieldHeight(0); efDetail.setReleaseApplicationResources(true); efDetail.initialize(application,session, request,response,out, "package3_Package3Module.EmpView"); efDetail.render(); %> </jsp:useBean>
The value assigned to the setReleaseApplicationResources method determines whether the Application Module is released after the EditCurrentRecord Data Web Bean processes it. Typically, the value should not be set to true unless this is the last Web Bean to be processed in the JSP page.
The EditCurrentRecord Data Web Bean renders the page by using field renderers. A field renderer is a technique of rendering an attribute. For example, TextAreas and Lists are field renderers. The field renderers are responsible for rendering a single attribute from the current row. The createDefaultFieldRenderers() function populates the collection of field renderes for all the visible attributes. You can retrieve an attribute's field renderer by using the getFieldRenderer() function. You can also create your own field renderers:
For a sample usage of this Data Web Bean, see the sample application generated by the JSP Application Wizard.
Field Summary | |
protected java.util.Hashtable |
fieldRenderers
The location where the set of field renderers is stored. |
protected int |
JSlibNeeded
Determines whether the bean has already generated the required JavaScript libraries. |
protected int |
maxFieldHeight
The default display height (in characters) for an attribute. |
protected int |
maxFieldWidth
Determines the threshold width (in characters) of the field. |
protected Row |
newRow
Stores the new row when EditCurrentRecord is in INSERT mode. |
protected java.lang.String |
NLSFormat
Determines the default date format. |
protected boolean |
renderNewRow
Determines whether new rows will be inserted into the form. |
protected java.lang.String |
sDeleteRecord
Text displayed on the "Delete" button. |
protected boolean |
showRecordNumber
Determines whether record numbers are displayed on the form. |
protected java.lang.String |
sSaveChanges
Text displayed on the "Save" button. |
protected java.lang.String |
sTargetUrl
The target URL of the HTML form. |
protected boolean |
useJS
Determines whether JavaScript is used for the dynamic version of EditCurrentRecord. |
protected boolean |
useRoundedCorners
Determines whether rounded or squared corners are used on the HTML form. |
Fields inherited from class oracle.jdeveloper.html.DataWebBeanImpl |
attributeRenderers,
bReleaseApplication,
dispAttrs,
isStateFull,
qView,
sApplication,
sRowSetName |
Fields inherited from class oracle.jdeveloper.html.WebBeanImpl |
application,
ctx,
out,
page,
request,
response,
session |
Constructor Summary | |
JSEditCurrentRecord()
|
Method Summary | |
void |
createDefaultFieldRenderers()
Populates the collection of field renderers with the defaults obtained from the View Object attributes. |
void |
createNewRow()
Directs the EditCurrentRecord Web Bean to create a new row in the RowSet and to give focus to this row when generating the edit form. |
void |
execute()
Reads the _ROWOPERATION parameter from the JSP page's request and performs the appropriate row operation on the record being edited. |
HTMLFieldRenderer |
getDefaultFieldRenderer(AttributeDef attrDef)
Retrieves the default field renderer for a specified attribute definition (that is, the attribute metadata). |
HTMLFieldRenderer |
getFieldRenderer(java.lang.String sAttrName)
Returns the current field renderer associated with the specified attribute. |
java.lang.String |
getNLSFormat()
Returns the NLS date format defined by the Cabo API. |
java.lang.String |
getTargetUrl()
Gets the target URL that will receive the HTML FORM parameters when the user clicks the SUBMIT button. |
void |
render()
Renders EditCurrentRecord's edit form containing the current record of the View Object's RowSet. |
void |
setDeleteText(java.lang.String sText)
Specifies the title used on the DELETE button displayed by the form. |
void |
setFieldRenderer(java.lang.String sAttrName,
HTMLFieldRenderer rField)
Associates the provided field renderer with the provided attribute. |
void |
setMaximumFieldHeight(int nHeight)
Sets the maximum field height for a TextArea (a multi-line text region). |
void |
setMaximumFieldWidth(int nWidth)
Sets the maximum field width, measured in number of characters, reserved for the attribute. |
void |
setNLSFormat(java.lang.String format)
Sets the NLS format for the date as defined by the Cabo API. |
void |
setRowSet(RowSet aQuery)
Internal: Applications should not use this method. |
void |
setShowRecordNumbers(boolean bShow)
Determines whether the control will render the record numbers on the form. |
void |
setSubmitText(java.lang.String sText)
Specifies the title used on the SUBMIT button displayed by the form. |
void |
setTargetUrl(java.lang.String sUrl)
Specifies the target URL that will receive the HTML FORM parameters when the user clicks the SUBMIT button. |
void |
setUseJS(boolean bSet)
Determines whether JavaScript is used for the dynamic version of EditCurrentRecord. |
void |
setUseRoundedCorners(boolean bSet)
Enables or disables the use of rounded corners in the HTML table generated by this Web Bean. |
void |
useCheckBoxGroup(java.lang.String sAttribute,
java.lang.String sQuery,
java.lang.String sLabel,
java.lang.String sValue)
A shortcut method for associating a check box group with the given attribute. |
void |
useComboBox(java.lang.String sAttribute,
java.lang.String sQuery,
java.lang.String sLabel,
java.lang.String sValue)
A shortcut method for associating a combo box with the given attribute. |
void |
useDateField(java.lang.String sAttribute)
Displays a calendar for the specified attribute. |
void |
useEditField(java.lang.String sAttribute)
Displays a single-line edit field in the HMTL form for the specified attribute. |
void |
useHiddenField(java.lang.String sAttribute)
Provides a non-viewable field in the HMTL form for the specified attribute. |
void |
useListBox(java.lang.String sAttribute,
java.lang.String sQuery,
java.lang.String sLabel,
java.lang.String sValue)
A shortcut method for associating a list box with the given attribute. |
void |
useListOfValues(java.lang.String sAttribute,
java.lang.String voName,
java.lang.String sDisplayAttributes,
java.lang.String sDataAttribute)
Enables a LOV (list of values) for the specified attribute in the UI. |
void |
useLOV(java.lang.String sAttribute,
java.lang.String voName)
Enables a LOV (list of values) for the specified attribute in the UI. |
void |
useRadioGroup(java.lang.String sAttribute,
java.lang.String sQuery,
java.lang.String sLabel,
java.lang.String sValue)
A shortcut method for associating a radio button group with the given attribute. |
void |
useStaticCheckBoxGroup(java.lang.String sAttribute,
java.lang.String[] labels,
java.lang.String[] values)
Defines a check box group picklist that is populated from two arrays: one for the labels and the other for the values. |
void |
useStaticComboBox(java.lang.String sAttribute,
java.lang.String[] labels,
java.lang.String[] values)
Defines an attribute's combo box picklist that is populated from two arrays: one for the labels and the other for the values. |
void |
useStaticListBox(java.lang.String sAttribute,
java.lang.String[] labels,
java.lang.String[] values)
Defines an attribute's list box picklist that is populated from two arrays: one for the labels and the other for the values. |
void |
useStaticRadioGroup(java.lang.String sAttribute,
java.lang.String[] labels,
java.lang.String[] values)
Defines a radio group picklist that is populated from two arrays: one for the labels and the other for the values. |
void |
useTextArea(java.lang.String sAttribute)
Displays a multi-line edit field in the HTML form for the specified attribute. |
Methods inherited from class oracle.jdeveloper.html.WebBeanImpl |
generateScriptSrc,
getCookie,
getOut,
getRenderingContext,
getRequest,
getRequestVariable,
getUniqueName,
initBeanForJS,
initialize,
initialize,
initialize,
render,
setRequestVariable |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String sTargetUrl
protected java.lang.String sSaveChanges
protected java.lang.String sDeleteRecord
protected java.util.Hashtable fieldRenderers
protected boolean renderNewRow
protected Row newRow
protected boolean showRecordNumber
protected int maxFieldWidth
protected int maxFieldHeight
protected boolean useRoundedCorners
protected boolean useJS
protected int JSlibNeeded
protected java.lang.String NLSFormat
Constructor Detail |
public JSEditCurrentRecord()
Method Detail |
public void setUseRoundedCorners(boolean bSet)
bSet
- true to use rounded corners in the table; false to use
squared corners.public void setNLSFormat(java.lang.String format)
format
- the date format.public java.lang.String getNLSFormat()
public void setUseJS(boolean bSet)
bSet
- true to use JavaScript; false otherwise.public void setMaximumFieldWidth(int nWidth)
nWidth
- width of the field, measured in number of characters.public void setMaximumFieldHeight(int nHeight)
nHeight
- height of the TextArea, measured in characters.public void setShowRecordNumbers(boolean bShow)
bShow
- true to render record numbers on the form; false to
omit record numbers.public void setSubmitText(java.lang.String sText)
sText
- text displayed on the SUBMIT button.public void setDeleteText(java.lang.String sText)
sText
- text displayed on the DELETE button.public void setTargetUrl(java.lang.String sUrl)
sUrl
- target URL for the HTML FORM parameters.public java.lang.String getTargetUrl()
public void setRowSet(RowSet aQuery)
Sets up the RowSet that contains the row to be edited. That is, it clears the field renderers if the row to be edited is null; otherwise, it populates the the row with its field renderers.
The RowSet is automatically retrieved as a side effect of the initialize() function. Call setRowSet only if you need to initialize the Web Bean with a RowSet other than the one designated by the initialize method.
aQuery
- the RowSet to be edited.public void createNewRow()
public void createDefaultFieldRenderers()
public HTMLFieldRenderer getDefaultFieldRenderer(AttributeDef attrDef)
attrDef
- an attribute definition.public void setFieldRenderer(java.lang.String sAttrName, HTMLFieldRenderer rField)
sAttrName
- name of the attribute.rField
- name of the field renderer.public HTMLFieldRenderer getFieldRenderer(java.lang.String sAttrName)
sAttrName
- name of the attribute.public void useComboBox(java.lang.String sAttribute, java.lang.String sQuery, java.lang.String sLabel, java.lang.String sValue)
sAttribute
- name of the attribute to be associated with the combo box.sQuery
- string representing the query used to populate the combo box.sLabel
- name of the column used for the prompt.sValue
- name of the column used for the value.public void useStaticComboBox(java.lang.String sAttribute, java.lang.String[] labels, java.lang.String[] values)
sAttribute
- name of attribute represented by the combo box.labels
- String array containing the labels for each value.values
- String array containing the values assoicated with each label.public void useListBox(java.lang.String sAttribute, java.lang.String sQuery, java.lang.String sLabel, java.lang.String sValue)
sAttribute
- name of the attribute to be associated with the list box.sQuery
- string representing the query used to populate the list box.sLabel
- name of the column used for the prompt.sValue
- name of the column used for the value.public void useStaticListBox(java.lang.String sAttribute, java.lang.String[] labels, java.lang.String[] values)
sAttribute
- name of attribute represented by the list box.labels
- String array containing the labels for each value.values
- String array containing the values assoicated with each label.public void useRadioGroup(java.lang.String sAttribute, java.lang.String sQuery, java.lang.String sLabel, java.lang.String sValue)
sAttribute
- name of the attribute to be associated with the radio group.sQuery
- string representing the query used to populate the radio group.sLabel
- name of the column used for the prompt.sValue
- name of the column used for the value.public void useStaticRadioGroup(java.lang.String sAttribute, java.lang.String[] labels, java.lang.String[] values)
sAttribute
- name of attribute represented by the radio group.labels
- String array containing the labels for each value.values
- String array containing the values assoicated with each label.public void useCheckBoxGroup(java.lang.String sAttribute, java.lang.String sQuery, java.lang.String sLabel, java.lang.String sValue)
sAttribute
- name of the attribute to be associated with the check box group.sQuery
- string representing the query used to populate the check box group.sLabel
- name of the column used for the prompt.sValue
- name of the column used for the value.public void useStaticCheckBoxGroup(java.lang.String sAttribute, java.lang.String[] labels, java.lang.String[] values)
sAttribute
- name of attribute represented by the check box group.labels
- string array containing the labels for each value.values
- string array containing the values assoicated with each label.public void useEditField(java.lang.String sAttribute)
sAttribute
- the attribute for which a single-line edit field
should be displayed.public void useTextArea(java.lang.String sAttribute)
sAttribute
- the attribute for which a single-line edit field
should be displayed.public void useHiddenField(java.lang.String sAttribute)
sAttribute
- name of the attrubute that should be stored in a
non-viewable field.public void useDateField(java.lang.String sAttribute)
sAttribute
- the attribute for which a calendar should be displayed.public void useListOfValues(java.lang.String sAttribute, java.lang.String voName, java.lang.String sDisplayAttributes, java.lang.String sDataAttribute)
This method enables a LOV for one or more of the RowSet's attributes.
To return all of the RowSet's attributes,
use the useLOV
method.
sAtttibute
- name of the attribute for which an LOV
should be enabled.voName
- name of the View Object to which the attribute belongs.sDisplayAttributes
- a comma-separated list of the RowSet's attributes
that will be displayed when the attribute is selected.sDataAttribute
- the location from which the attributes' values are
obtained.useLOV(String, String)
public void useLOV(java.lang.String sAttribute, java.lang.String voName)
This method enables a LOV for all of the RowSet's attributes.
To enable a LOV for a subset of the attributes,
use the useListOfValues
method.
sAtttibute
- name of the attribute for which an LOV
should be enabled.voName
- name of the View Object to which the attribute belongs.useListOfValues(String, String, String, String)
public void execute() throws java.lang.Exception
public void render() throws java.lang.Exception
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |