Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.html.databeans
Class RowSetBrowser

java.lang.Object
  extended byoracle.jdeveloper.html.WebBeanImpl
      extended byoracle.jdeveloper.html.DataWebBeanImpl
          extended byoracle.jbo.html.DataWebBeanImpl
              extended byoracle.jbo.html.databeans.RowSetBrowser
All Implemented Interfaces:
DataWebBean, DataWebBean, WebBean, WebBean

public class RowSetBrowser
extends DataWebBeanImpl

The RowSetBrowser Data Web Bean class dynamically generates an HTML table that contains records (rows) from a View Object's RowSet. The subset of the rows in the View Object's RowSet that are rendered to the JSP page's output stream is based on the RangeSize and the position of the View Object's current row.

JDeveloper's JSP Element wizard instantiates the RowSetBrowser 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 a RowSet browser provided by the wizard includes these methods: setUseRoundedCorners, setShowCurrentRow, setVisibleRows, setAlternateColors, setShowRecordNumbers, setReleaseApplicationResources, initialize, and render. For example:

 <jsp:useBean class="oracle.jbo.html.databeans.RowSetBrowser" id="rbDetail"
    scope="request" >
 <%
     rbDetail.setUseRoundedCorners(true);
     rbDetail.setShowCurrentRow(true);
     rbDetail.setVisibleRows(10);
     rbDetail.setAlternateColors(true);
     rbDetail.setShowRecordNumbers(true);
     rbDetail.initialize(application,session, request,response,out,
            "DeptToEmp_DeptToEmpModule.EmpView");
     rbDetail.render();
 %>
 </jsp:useBean>
 

Using the setDisplayAttributes method inherited from DataWebBeanImpl, you can set the attributes displayed by the HTML table.


Field Summary
protected  TableControl aTable
           
protected  boolean bAlternateColors
           
protected  boolean bShowCurrentRow
           
protected  java.util.Hashtable colTitles
           
protected  java.util.Vector extraUrlCols
           
protected  java.lang.String ImageDir
           
protected  int nVisibleRows
           
protected  boolean nVisibleRowsWasChanged
           
protected  boolean showRecordNumber
           
protected  java.lang.String sRowEditTarget
           
protected  java.lang.String sRowEditUrl
           
protected  java.lang.String sRowUrl
           
protected  java.lang.String sRowUrlTarget
           
protected  boolean useRoundedCorners
           
 
Fields inherited from class oracle.jdeveloper.html.DataWebBeanImpl
amName, bReleaseApplication, dispAttrs, ds
 
Fields inherited from class oracle.jdeveloper.html.WebBeanImpl
application, bUsedInTag, out, page, request, response, session
 
Fields inherited from interface oracle.jdeveloper.html.WebBean
contentFrameName, defaultCaboBase, defaultCaboImageBase, defaultImageBase, defaultJSPBase, defaultNLSFormat, JS_LIBRARIES, JS_NAMEID, JSButtonConstructorLib, JSCalendarConstructorLib, JSContainerConstructorLib, JSDataConstructLib, JSModalPageConstructorLib, JSTableConstructLib, JSToolbarConstructorLib, JSTreeConstructLib, JSUtilitiesLib
 
Constructor Summary
RowSetBrowser()
           
 
Method Summary
 void addImageUrlColumn(java.lang.String sTitle, java.lang.String sImageFile, java.lang.String sUrl)
          Adds an additional column with an image-based URL.
 void addImageUrlColumn(java.lang.String sTitle, java.lang.String sImageFile, java.lang.String sUrl, java.lang.String sTarget)
          Adds an additional column with an image-based URL.
 void addTextUrlColumn(java.lang.String sTitle, java.lang.String sText, java.lang.String sUrl)
          Adds an additional column that contains a line of text that represents a URL.
 void addTextUrlColumn(java.lang.String sTitle, java.lang.String sText, java.lang.String sUrl, java.lang.String sTarget)
          Adds an additional column that contains a line of text that represents a URL.
 java.lang.String fixupUrl(java.lang.String sUrl, java.lang.String sExtra)
          Internal: Applications should not use this method.
 java.lang.String getImageDir()
          Returns the path of the image root directory where all of the browser's images reside.
 java.lang.String getRowUrl()
          Returns the current Row URL setting.
 java.lang.String getRowUrlTargetWindow()
          Returns the name of the window being used as the Row URL target.
 boolean getShowCurrentRow()
          Returns whether the current RowSet row is highlighted when the HTML table is rendered.
 TableControl getTableControl()
          Returns the instance of the table class the is to be used for rendering
 int getVisibleRows()
          Returns the number of rows displayed (that is, "visible rows") in the RowSet browser, which is also the value of the RowSet's RangeSize.
protected  boolean initializeNewTableRow(HTMLTableRow htmlRow, Row[] drows, int rowno, boolean isEven)
           
 void render()
          Renders an HTML table that contains records from the View Object's RowSet.
protected  void renderTableHeaders()
           
 void setAlternateColors(boolean bSet)
          Displays rows in alternating background colors in the generated HTML table.
 void setAttributeTitle(java.lang.String sAttribute, java.lang.String sTitle)
          Sets the column title of the given attribute.
 void setImageDir(java.lang.String sDir)
          Specifies the path of the image root directory where all of the browser's images reside.
 void setRowEditTargetWindow(java.lang.String sName)
          Sets the name of the target frame or window where the row-editing URL is displayed.
 void setRowEditUrl(java.lang.String sUrl)
          Sets the row editing URL that is invoked when the user clicks the Edit button.
 void setRowUrl(java.lang.String sUrl)
          Sets the Row URL to be invoked when the user clicks the row number to the left of each row.
 void setRowUrlTargetWindow(java.lang.String sUrl)
          If you enabled the Row URL, this function sets up the target window for the URL when the user activates it.
 void setShowCurrentRow(boolean bSet)
          Enables or disables highlighting of the current RowSet's row when the HTML table is rendered.
 void setShowRecordNumbers(boolean bShow)
          Sets whether the control will render the record numbers in the browser.
 void setUseRoundedCorners(boolean bSet)
          Enables or disables the use of rounded corners in the HTML table generated by this Web Bean.
 void setVisibleRows(int nRows)
          Sets both the number of rows to be displayed by the RowSet browser and the RowSet's RangeSize.
 
Methods inherited from class oracle.jbo.html.DataWebBeanImpl
initialize, setUsedInTag
 
Methods inherited from class oracle.jdeveloper.html.DataWebBeanImpl
clearDisplayAttributes, getApplicationFromContext, getApplicationName, getAttributeLabel, getDisplayAttributeDefs, getDisplayAttributes, getDisplayFieldRenderer, getEditFieldRenderer, getRowKey, getRowSet, getViewObjectName, handleCommit, initialize, initialize, initialize, internalInitialize, isAppStateful, releaseApplicationResources, releaseApplicationResources, setDisplayAttributes, setDisplayFieldRenderer, setDisplayFieldRenderer, setEditFieldRenderer, setEditFieldRenderer, setReleaseApplicationResources, setRowSet, shouldDisplayAttribute
 
Methods inherited from class oracle.jdeveloper.html.WebBeanImpl
generateScriptSrc, getCookie, getOut, getRequest, getRequestVariable, getRequestVariable, getUniqueName, initBeanForJS, initBeanForJS, initBeanForJS, initialize, initialize, initialize, render, setRequestVariable, setRequestVariable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jdeveloper.html.DataWebBean
clearDisplayAttributes, getApplicationName, getDisplayAttributeDefs, getDisplayAttributes, getDisplayFieldRenderer, getEditFieldRenderer, getRowSet, getViewObjectName, handleCommit, initialize, initialize, isAppStateful, setDisplayAttributes, setDisplayFieldRenderer, setDisplayFieldRenderer, setEditFieldRenderer, setEditFieldRenderer, setReleaseApplicationResources, setRowSet, shouldDisplayAttribute
 
Methods inherited from interface oracle.jdeveloper.html.WebBean
initialize, initialize, internalInitialize, render
 

Field Detail

nVisibleRows

protected int nVisibleRows

bAlternateColors

protected boolean bAlternateColors

sRowUrl

protected java.lang.String sRowUrl

bShowCurrentRow

protected boolean bShowCurrentRow

sRowUrlTarget

protected java.lang.String sRowUrlTarget

extraUrlCols

protected java.util.Vector extraUrlCols

useRoundedCorners

protected boolean useRoundedCorners

showRecordNumber

protected boolean showRecordNumber

colTitles

protected java.util.Hashtable colTitles

sRowEditUrl

protected java.lang.String sRowEditUrl

ImageDir

protected java.lang.String ImageDir

sRowEditTarget

protected java.lang.String sRowEditTarget

nVisibleRowsWasChanged

protected boolean nVisibleRowsWasChanged

aTable

protected TableControl aTable
Constructor Detail

RowSetBrowser

public RowSetBrowser()
Method Detail

setImageDir

public void setImageDir(java.lang.String sDir)
Specifies the path of the image root directory where all of the browser's images reside. The Web Bean will prepend this path to all images it tries to retrieve.

Parameters:
sDir - path to the image root directory.

getImageDir

public java.lang.String getImageDir()
Returns the path of the image root directory where all of the browser's images reside. The Web Bean will prepend this path to all images it tries to retrieve.

Returns:
path to the image root directory.

setRowEditUrl

public void setRowEditUrl(java.lang.String sUrl)
Sets the row editing URL that is invoked when the user clicks the Edit button. Typically, an "Action" column will be created in the table, containing an Edit icon. Set the URL to the JSP page itself if you want to do in-place editing. If this URL is set to null, the column will not appear.

Parameters:
sUrl - URL where the row can be edited.

setRowEditTargetWindow

public void setRowEditTargetWindow(java.lang.String sName)
Sets the name of the target frame or window where the row-editing URL is displayed. When the user clicks the "Edit" buttom a secondary window will open where the row can be edited.

This method is necessary only if you are using HMTL Frames.

Parameters:
sName - name of the target window.

setAttributeTitle

public void setAttributeTitle(java.lang.String sAttribute,
                              java.lang.String sTitle)
Sets the column title of the given attribute.

Parameters:
sAttribute - attribute name.
sTitle - column title for attribute.

setShowRecordNumbers

public void setShowRecordNumbers(boolean bShow)
Sets whether the control will render the record numbers in the browser.

Parameters:
bShow - true to display record number; false to suppress record numbers.

setUseRoundedCorners

public void setUseRoundedCorners(boolean bSet)
Enables or disables the use of rounded corners in the HTML table generated by this Web Bean.

Parameters:
bSet - true use rounded corners; false use squared corners.

addTextUrlColumn

public void addTextUrlColumn(java.lang.String sTitle,
                             java.lang.String sText,
                             java.lang.String sUrl,
                             java.lang.String sTarget)
Adds an additional column that contains a line of text that represents a URL. The text will be repeated in each of the column's rows. This column will be appended after all of the columns that represent attributes belonging to the RowSet. The sTarget parameter specifies a secondary window or frame that will open when the URL is activated.

Parameters:
sTitle - text to use as the column title.
sText - text that will be used to represent the URL.
sUrl - URL that will be invoked when text is clicked.
sTarget - the target for the URL. This is useful when you are using HTML FRAMES.

addTextUrlColumn

public void addTextUrlColumn(java.lang.String sTitle,
                             java.lang.String sText,
                             java.lang.String sUrl)
Adds an additional column that contains a line of text that represents a URL. The text will be repeated in each of the column's rows. This column will be appended after all of the columns that represent attributes belonging to the RowSet.

Parameters:
sTitle - text to use as the column title.
sText - text that will be used to represent the URL.
sUrl - URL that will be invoked when text is clicked.

addImageUrlColumn

public void addImageUrlColumn(java.lang.String sTitle,
                              java.lang.String sImageFile,
                              java.lang.String sUrl,
                              java.lang.String sTarget)
Adds an additional column with an image-based URL. This image will be repeated in each of the column's rows. This column will be appended after all of the columns that represent attributes belonging to the RowSet. The sTarget parameter specifies a secondary window or frame that will open when the URL is activated.

Parameters:
sTitle - text to use as the column title.
sImageFile - URL for locating the image to be displayed.
sUrl - URL that will be invoked when image is clicked.
sTarget - the target for the URL. This is useful when you are using HTML FRAMES.

addImageUrlColumn

public void addImageUrlColumn(java.lang.String sTitle,
                              java.lang.String sImageFile,
                              java.lang.String sUrl)
Adds an additional column with an image-based URL. This image will be repeated in each of the column's rows. This column will be appended after all of the columns that represent attributes belonging to the RowSet.

Parameters:
sTitle - text to use as the column title.
sImageFile - URL for locating the image to be displayed.
sUrl - URL that will be invoked when text is clicked.

setRowUrlTargetWindow

public void setRowUrlTargetWindow(java.lang.String sUrl)
If you enabled the Row URL, this function sets up the target window for the URL when the user activates it.


getRowUrlTargetWindow

public java.lang.String getRowUrlTargetWindow()
Returns the name of the window being used as the Row URL target.

Returns:
name of the window used as the Row URL target.

setRowUrl

public void setRowUrl(java.lang.String sUrl)
Sets the Row URL to be invoked when the user clicks the row number to the left of each row. An additonal parameter is appended to your URL to pass the row number of the row that was clicked. The RowSetNavigator and NavigatorBar Data Web Beans process the extra URL parameter to place the RowSet currency on the row represented by this index.

Parameters:
sUrl - Row URL to be invoked

getRowUrl

public java.lang.String getRowUrl()
Returns the current Row URL setting. The value can be null.

Returns:
current Row URL.

setShowCurrentRow

public void setShowCurrentRow(boolean bSet)
Enables or disables highlighting of the current RowSet's row when the HTML table is rendered.

Parameters:
bSet - true to highlight the current RowSet row; false to not highlight the row.

getShowCurrentRow

public boolean getShowCurrentRow()
Returns whether the current RowSet row is highlighted when the HTML table is rendered.

Returns:
true if the current row is highlighted; false otherwise.

setVisibleRows

public void setVisibleRows(int nRows)
Sets both the number of rows to be displayed by the RowSet browser and the RowSet's RangeSize. It is important that this method also sets the RangeSize, because it is the sliding window used to traverse the RowSet. If you set the visible rows to -1 all the rows will be displayed.

Parameters:
nRows - number of rows to display in the RowSet browser and the RowSet's RangeSize. NOTE: The setVisibleRows() temporarily changes the display set of rows, but it doesn't make this change permanent to the rowset's RangeSize. If you need to make the change permanent you need to use dwb.getRowSet().setRangeSize(50) prior to rendering.

getVisibleRows

public int getVisibleRows()
Returns the number of rows displayed (that is, "visible rows") in the RowSet browser, which is also the value of the RowSet's RangeSize.

Returns:
the number of rows displayed in the RowSet browser, which is also the value of the RowSet's RangeSize.

setAlternateColors

public void setAlternateColors(boolean bSet)
Displays rows in alternating background colors in the generated HTML table.

Parameters:
bSet - true to display rows in alternating background colors; false to display rows in a single background color.

getTableControl

public TableControl getTableControl()
Returns the instance of the table class the is to be used for rendering


renderTableHeaders

protected void renderTableHeaders()
                           throws java.lang.Exception
Throws:
java.lang.Exception

initializeNewTableRow

protected boolean initializeNewTableRow(HTMLTableRow htmlRow,
                                        Row[] drows,
                                        int rowno,
                                        boolean isEven)

render

public void render()
            throws java.lang.Exception
Renders an HTML table that contains records from the View Object's RowSet. This is the View Object to which the RowSetBrowser object was initialized.

Specified by:
render in interface WebBean
Overrides:
render in class WebBeanImpl
Throws:
java.lang.Exception

fixupUrl

public java.lang.String fixupUrl(java.lang.String sUrl,
                                 java.lang.String sExtra)
Internal: Applications should not use this method.


Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

Copyright © 1997, 2004, Oracle. All rights reserved.