SilverStream
Application Server 3.5

com.sssw.shr.page
Class AgpViewPanel

java.lang.Object
 |
 +--com.sssw.shr.page.AgpTag
       |
       +--com.sssw.shr.page.AgpControlBase
             |
             +--com.sssw.shr.page.AgpBlock
                   |
                   +--com.sssw.shr.page.AgpContainer
                         |
                         +--com.sssw.shr.page.AgpViewPanel
All Implemented Interfaces:
AgiJavaScriptEnhanced, AgiPageControl, AgiPageSubmitProcessor, AgiRowSetListener, AgiRowSetManager, Cloneable, Externalizable, Serializable, Servlet

public class AgpViewPanel
extends AgpContainer
implements AgiRowSetManager, AgiRowSetListener, AgiPageSubmitProcessor, Servlet

AgpViewPanel is a type of AgpContainer that represents a tabular data view. It consists of two blocks:

Properties:
Alignment, Automatic Query, Background Color, Background Image, Border Color, Border Size, Business Object Name, Cell Padding, Cell Spacing, Column Width, Column Width Unit, Distinct, Emulate Scrolling, Enable HTML Generation, Extended Attributes, Limit Rows, Limit Rows Per Page, Link Clause, Load Data, Maximum Rows, Name, Order By, Rows, Table Name, Transparent Background, Width
Events:
rowGenerateBegin
See Also:
Serialized Form

Fields inherited from class com.sssw.shr.page.AgpTag
UNIT_PERCENT, UNIT_PIXEL
 
Constructor Summary
AgpViewPanel()
           
 
Method Summary
 AgiRowCursor getCurrentRowCursor()
          Returns a row cursor pointing to the current row.
 boolean getEnableScrolling()
          Returns a boolean indicating whether scrolling is enabled.
 boolean getLimitRowCount()
          Returns a boolean indicating whether the number of rows displayed on a page is limited to the Rows property.
 int getOverlapRowCount()
          Returns the number of rows to overlap when scrolling up and down.
 int getPageRowCount()
          Returns the number of rows to display at one time.
 AgiRowCursor getRootRowCursor()
          Returns a row cursor to allow navigating the data independently of the view.
 Serializable invokeQuery(Serializable param)
          If the view is loading data from a Data Source Object, you must use this method to invoke it and populate the view with the resulting data.
 boolean scrollDownPage()
          Scrolls to the next page.
 boolean scrollDownRow()
          Scrolls the view down by one row.
 boolean scrollToFirstRow()
          Scrolls the view to the top row of data.
 boolean scrollToLastRow()
          Scrolls the view so that the last row of data is visible.
 boolean scrollUpPage()
          Scrolls to the previous page.
 boolean scrollUpRow()
          Scrolls the view up by one row.
 void setDataProvider(AgiRowCursor provider)
          Sets a different data source for the view to scroll.
 void setDataSource(String dsoName)
          Specify the Data Source object from which this view should load its data.
 void setEnableScrolling(boolean scrolling)
          Sets whether scrolling is enabled.
 void setLimitRowCount(boolean limitrowcount)
          Sets whether the number of rows displayed per page should be limited.
 void setOverlapRowCount(int rowcount)
          Specifies the number of rows to overlap when scrolling up and down by page.
 void setPageRowCount(int rowcount)
          Sets the number of rows to display in the view on a page.
 
Methods inherited from class com.sssw.shr.page.AgpContainer
getBlock, getBlockCount, getGroup, getGroupCount
 
Methods inherited from class com.sssw.shr.page.AgpBlock
getControls
 
Methods inherited from class com.sssw.shr.page.AgpControlBase
getName
 
Methods inherited from class com.sssw.shr.page.AgpTag
getBoolProperty, getEnableHTMLGeneration, getIntArrayProperty, getIntProperty, getIntPropertyUnit, getProperty, getStringArrayProperty, invalidateHTML, removeProperty, setEnableHTMLGeneration, setIntProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods implemented from interface com.sssw.shr.page.AgiJavaScriptEnhanced
generateFunction, generateRepaintScript, generateScriptInitializers, getFunctionNameForMethod, getFunctionNames, getMethodNames, getScriptObjectName, isHTMLRepaintPending, isJavaScriptRepaintPending
 
Methods implemented from interface com.sssw.shr.page.AgiPageControl
generateHTML, getPrefix, notifyPageLoaded, notifyPageRequestBegin, notifyPageRequestEnd, notifyPostValue, notifyPostValues
 
Methods implemented from interface com.sssw.shr.page.AgiPageSubmitProcessor
notifySubmit
 
Methods implemented from interface com.sssw.rt.event.AgiRowSetListener
dataReceivedAsync, dataReloaded, rowDataChanged, rowDeleted, rowInserted, rowPreDelete, rowPreInsert
 
Methods implemented from interface com.sssw.rt.util.AgiRowSetManager
clearRows, haveRowsChanged, query, query, refreshRows, updateRows
 
Methods implemented from interface java.io.Externalizable
readExternal, writeExternal
 
Methods implemented from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 

Constructor Detail

AgpViewPanel

public AgpViewPanel()
Method Detail

getPageRowCount

public int getPageRowCount()
Returns the number of rows to display at one time.
Usage:

This property is used only if the Limit Rows Per Page property is set to true.

Example:
 		int rowPerPage = agpView1.getPageRowCount();
 
See Also:
Limit Rows Per Page property, Rows property, AgpViewPanel.setPageRowCount(int rowcount)

setPageRowCount

public void setPageRowCount(int rowcount)
Sets the number of rows to display in the view on a page.
Parameters:
rowcount - the number of rows.
Usage:

In order for this property to take effect, the Limit Rows Per Page property should be set to true.

Example:
 		agpView1.setPageRowCount(10);
 
See Also:
Limit Rows Per Page property, Rows property, AgpViewPanel.getPageRowCount()

getOverlapRowCount

public int getOverlapRowCount()
Returns the number of rows to overlap when scrolling up and down.
Example:
 		int overlapRows = agpView1.getOverlapRowCount();
 
See Also:
AgpViewPanel.setOverlapRowCount(int rowcount)

setOverlapRowCount

public void setOverlapRowCount(int rowcount)
Specifies the number of rows to overlap when scrolling up and down by page.
Parameters:
rowcount - the number of rows to overlap.
Example:
 		agpView1.setOverlapRowCount(2);
 
See Also:
AgpViewPanel.getOverlapRowCount()

getLimitRowCount

public boolean getLimitRowCount()
Returns a boolean indicating whether the number of rows displayed on a page is limited to the Rows property.
Example:
 		boolean limitRows = agpView1.getLimitRowCount();
 
See Also:
Limit Rows Per Page property, Rows property, AgpViewPanel.setLimitRowCount(boolean limitrowcount)

setLimitRowCount

public void setLimitRowCount(boolean limitrowcount)
Sets whether the number of rows displayed per page should be limited.
Parameters:
limitrowcount - true if the number should be limited, or false to leave the number unlimited.
Usage:

Use the setLimitRowCount method to set the number of rows displayed on a page.

Example:
 		agpView1.setLimitRowCount(true);
 
See Also:
Limit Rows Per Page property, Rows property, AgpViewPanel.getLimitRowCount()

getEnableScrolling

public boolean getEnableScrolling()
Returns a boolean indicating whether scrolling is enabled.
Example:
 		boolean scrolling = agpView1.getEnableScrolling();
 
See Also:
Emulate Scrolling property, AgpViewPanel.setEnableScrolling(boolean scrolling)

setEnableScrolling

public void setEnableScrolling(boolean scrolling)
Sets whether scrolling is enabled.
Parameters:
scrolling - true if scrolling should be enabled, false if not.
Example:
 		agpView1.setEnableScrolling(true);
 
See Also:
Emulate Scrolling property, AgpViewPanel.getEnableScrolling()

getRootRowCursor

public AgiRowCursor getRootRowCursor()
Returns a row cursor to allow navigating the data independently of the view.
Usage:

The row cursor is positioned arbitrarily within the view data. The programmer must call gotoFirst() to position it on the first row.

Example:
 		AgiRowCursor rc = agpView1.getRootRowCursor();
 

getCurrentRowCursor

public AgiRowCursor getCurrentRowCursor()
Returns a row cursor pointing to the current row.
Usage:

This method is only valid while processing an event from a control contained in a data row of the view, for example, a property change event from a checkbox or a link event from a label.

Example:
 		AgiRowCursor rc = agpView1.getCurrentRowCursor();
 

setDataProvider

public void setDataProvider(AgiRowCursor provider)
                     throws AgoSecurityException,
                            AgoTransientSystemException,
                            AgoUnrecoverableSystemException
Sets a different data source for the view to scroll.
Parameters:
provider - the alternate data source object.
Usage:

Normally an HTML view scrolls only its built-in data source. Use this method to specify a different data source. If calling this method, expressions in the view must refer only to fields within the specified data source. Note that an HTML View uses the actual object provided in this call. Programmatically scrolling this object outside the view will affect the view's behavior and is not recommended.

Example:
 		agpView1.setDataProvider(agpData3);
 

setDataSource

public void setDataSource(String dsoName)
Specify the Data Source object from which this view should load its data. Invalid if setDataProvider() has been called.

invokeQuery

public Serializable invokeQuery(Serializable param)
                         throws Exception
If the view is loading data from a Data Source Object, you must use this method to invoke it and populate the view with the resulting data.

Invalid if setDataProvider() has been called.


scrollToFirstRow

public boolean scrollToFirstRow()
                         throws AgoSecurityException,
                                AgoTransientSystemException,
                                AgoUnrecoverableSystemException
Scrolls the view to the top row of data.
Usage:

Because the view remembers its top row of data, the programmer may need to call this method if new data has been inserted in order for the new data to display.

Example:
 		agpView1.scrollToFirstRow();
 
See Also:
AgpViewPanel.scrollDownPage(), AgpViewPanel.scrollDownRow(), AgpViewPanel.scrollToLastRow(), AgpViewPanel.scrollUpPage(), AgpViewPanel.scrollUpRow()

scrollToLastRow

public boolean scrollToLastRow()
                        throws AgoSecurityException,
                               AgoTransientSystemException,
                               AgoUnrecoverableSystemException
Scrolls the view so that the last row of data is visible.
Usage:

The view attempts to position the last row of data at the bottom of its allowed set of visible rows, to display a full page of data.

Example:
 		agpView1.scrollToLastRow();
 
See Also:
AgpViewPanel.scrollDownPage(), AgpViewPanel.scrollDownRow(), AgpViewPanel.scrollToFirstRow(), AgpViewPanel.scrollUpPage(), AgpViewPanel.scrollUpRow()

scrollDownRow

public boolean scrollDownRow()
                      throws AgoSecurityException,
                             AgoTransientSystemException,
                             AgoUnrecoverableSystemException
Scrolls the view down by one row.
Returns:
true if the view scrolled down, false if the last page of data is already displayed.
Example:
 		agpView1.scrollDownRow();
 
See Also:
AgpViewPanel.scrollDownPage(), AgpViewPanel.scrollToFirstRow(), AgpViewPanel.scrollToLastRow(), AgpViewPanel.scrollUpPage(), AgpViewPanel.scrollUpRow()

scrollUpRow

public boolean scrollUpRow()
                    throws AgoSecurityException,
                           AgoTransientSystemException,
                           AgoUnrecoverableSystemException
Scrolls the view up by one row.
Returns:
true if the view scrolled up, false if the first page of data is already displayed.
Example:
 		agpView1.scrollUpRow();
 
See Also:
AgpViewPanel.scrollDownPage(), AgpViewPanel.scrollDownRow(), AgpViewPanel.scrollToFirstRow(), AgpViewPanel.scrollToLastRow(), AgpViewPanel.scrollUpPage()

scrollUpPage

public boolean scrollUpPage()
                     throws AgoSecurityException,
                            AgoTransientSystemException,
                            AgoUnrecoverableSystemException
Scrolls to the previous page.
Returns:
true if scrolled up a full page, false if reached the top row.
Usage:

This method is useful only if the view is limited in the number of rows it displays at one time. The view displays the previous page of data, unless it has reached the first row of available data. The data on the new page includes some rows from the previously displayed page if the number of overlap rows (setOverlapRowCount()) is greater than zero.

Example:
 		agpView1.scrollUpPage();
 
See Also:
AgpViewPanel.scrollDownPage(), AgpViewPanel.scrollDownRow(), AgpViewPanel.scrollToFirstRow(), AgpViewPanel.scrollToLastRow(), AgpViewPanel.scrollUpRow()

scrollDownPage

public boolean scrollDownPage()
                       throws AgoSecurityException,
                              AgoTransientSystemException,
                              AgoUnrecoverableSystemException
Scrolls to the next page.
Returns:
true if scrolled down a full page, false if reached the bottom of the data.
Usage:

This method is useful only if the view is limited in the number of rows it displays at one time. The view displays the next page of data, unless it has reached the last row of available data. The data on the new page includes some rows from the previous page if the number of overlap rows (setOverlapRowCount()) is greater than zero.

Example:
 		agpView1.scrollDownPage();
 
See Also:
AgpViewPanel.setLimitRowCount(boolean limitrowcount), AgpViewPanel.setOverlapRowCount(int rowcount), AgpViewPanel.scrollDownRow(), AgpViewPanel.scrollToFirstRow(), AgpViewPanel.scrollToLastRow(), AgpViewPanel.scrollUpPage(), AgpViewPanel.scrollUpRow()

SilverStream
Application Server 3.5