|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdeveloper.html.WebBeanImpl oracle.jdeveloper.html.DataWebBeanImpl oracle.jbo.html.DataWebBeanImpl oracle.jbo.html.databeans.FindForm
The FindForm Data Web Bean generates a search form. The generated search form can be one of these types:
JDeveloper's JSP Element wizard instantiates the FindForm 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 FindForm provided by the wizard includes these methods: setTargetUrl, setUseSimpleMode, setReleaseApplicationResources, initialize, and render. For example:
<jsp:useBean class="oracle.jbo.html.databeans.FindForm" id="ffdetail" scope="request" > <% ffdetail.setTargetUrl(""); ffdetail.setUseSimpleMode("Ename"); ffdetail.setReleaseApplicationResources(false); ffdetail.initialize(application,session, request,response,out, "package3_Package3Module.EmpView"); ffdetail.render(); %> </jsp:useBean>
The value assigned to the setReleaseApplicationResources method determines whether the Application Module is released after the FindForm 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.
Since the FindForm bean generates an HTML form, you need to actually make use of it in two JSP pages. One page will use the FindForm by initializing it and calling the render() method to generate the query submission UI. The target page would also make use of the FindForm and call render(), but the receiving page would be sent extra URL parameters that let the FindForm Web Bean know that it needs to execute the query instead of rendering the query screen.
For example, consider this code snippet from the file DeptView_Query.jsp generated by the Web Application Wizard. The snippet renders the FindForm, then lets you navigate through the query results one record at a time.
<body> <center><h2>DeptView</h2></center> <br> <jsp:useBean id="RowQuery" class="oracle.jbo.html.databeans.FindForm" scope="request"> <% RowQuery.initialize(application, session , request, response, out, "package1_Package1Module.DeptView"); RowQuery.setTargetUrl("DeptView_Query.jsp"); RowQuery.setReleaseApplicationResources(true); RowQuery.render(); %> </jsp:useBean> <% if(RowQuery.queryWasExecuted()) { %> <jsp:useBean class="oracle.jbo.html.databeans.NavigatorBar" id="tb" scope="request" /> <% tb.setTargetUrl("DeptView.jsp"); tb.initialize(application,session, request,response,out, "package1_Package1Module.DeptView"); String sImageBase = (String)session.getValue("ImageBase"); tb.getContainer().setImageBase(sImageBase); // code to define toolbar buttons tb.render(); %> <br> <jsp:useBean id="RowViewer" class="oracle.jbo.html.databeans.ViewCurrentRecord" scope="request"> <% RowViewer.initialize(application, session , request, response, out, "package1_Package1Module.DeptView"); RowViewer.setReleaseApplicationResources(true); RowViewer.render(); %> </jsp:useBean> <% } %> </body>
The code snippet above initially renders the FindForm in the DeptView_Query.jsp. When the user clicks the "Add Condition" or "Clear Query" buttons, the if(RowQuery.queryWasExecuted()) test will fail and the .jsp page will continue to render the FindForm.
Since setTargetUrl() is set to DeptView_Query.jsp, the FindForm will be rendered "in-place". That is, DeptView_Query.jsp acts as its own target page.
When the user clicks "Execute Query", the FindForm query will be executed and the if(RowQuery.queryWasExecuted()) test will pass. The results of the query will be displayed by the ViewCurrentRecord Data Web Bean. In this case, the ViewCurrentRecord Data Web Bean acts as the receiving page described above. Note that although this example uses the ViewCurrentRecord Data Web Bean to display the results, any appropriate Date Web Bean, such as RowSetBrowser, can be used.
Field Summary | |
protected boolean |
bClearWhereClause
|
protected boolean |
bSimpleMode
|
protected boolean |
bWasExecuted
|
protected java.lang.String |
sAttribute
|
protected int |
simpleEditLength
|
protected java.lang.String |
sTarget
|
protected java.lang.String |
sTargetUrl
|
protected boolean |
useJS
|
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 | |
FindForm()
|
Method Summary | |
void |
clearQueryConditions()
Internal: Applications should not use this method. |
void |
clearSimpleMode()
Disables the simple search form UI and enables the advanced search form UI. |
void |
execute()
Executes the query defined by the query definition. |
QueryDefinition |
getQueryDefinition()
Internal: Applications should not use this method. |
int |
getSimpleEditLength()
Retrieves the length of the edit control used in the rendering of the simple query form. |
java.lang.String |
getTargetUrl()
Retrieves the URL being used as the target where the results of this Web Bean are displayed. |
java.lang.String |
getUrlTargetWindow()
Returns the name of the window or form in which the row target URL will be displayed. |
boolean |
isSimpleMode()
Determines whether the simple search mode of the FindForm UI is enabled. |
boolean |
queryWasExecuted()
Determines whether the FindForm bean has executed the query. |
void |
render()
Renders the Find Form. |
void |
renderSimpleForm()
Renders the simple form version of the query form. |
void |
saveQueryDefinition()
Internal: Applications should not use this method. |
void |
setClearWhereClauseOnClearConditions(boolean bClear)
If this option is set to true, the WHERE clause is cleared on the ViewObject when the 'clear query conditions' button is clicked. |
void |
setSimpleEditLength(int nLength)
Sets the length of the edit control used in the rendering of the simple query form. |
void |
setTargetUrl(java.lang.String sUrl)
Sets the URL being used as the target where the results of this Web Bean are displayed. |
void |
setUrlTargetWindow(java.lang.String sTarget)
Identifies the window or frame that will display the row target URL specified by the setTargetUrl() function. |
void |
setUseJS(boolean bSet)
|
void |
setUseSimpleMode(java.lang.String sAttribute)
Directs the FindForm bean to use the simple mode of the FindForm UI. |
Methods inherited from class oracle.jbo.html.DataWebBeanImpl |
initialize, setUsedInTag |
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 |
protected java.lang.String sTargetUrl
protected boolean bWasExecuted
protected boolean bSimpleMode
protected java.lang.String sAttribute
protected java.lang.String sTarget
protected boolean useRoundedCorners
protected boolean useJS
protected int simpleEditLength
protected boolean bClearWhereClause
Constructor Detail |
public FindForm()
Method Detail |
public void setSimpleEditLength(int nLength)
nLength
- length of the edit control, measured in characters.public void setClearWhereClauseOnClearConditions(boolean bClear)
public int getSimpleEditLength()
public void setUrlTargetWindow(java.lang.String sTarget)
sTarget
- window or form used to display the row target URL.public java.lang.String getUrlTargetWindow()
public void setUseSimpleMode(java.lang.String sAttribute)
If you want to use the advanced UI, follow setUseSimpleMode with clearSimpleMode. For example:
... setUseSimpleMode("Job"); clearSimpleMode() ...
sAttribute
- name of the View Object attribute used as part of the query.public void clearSimpleMode()
public boolean isSimpleMode()
public boolean queryWasExecuted()
public java.lang.String getTargetUrl()
public void setTargetUrl(java.lang.String sUrl)
sUrl
- target URL where this Web Bean's results are displayed.public void saveQueryDefinition() throws java.lang.Exception
Saves the current definition of a query while a user adds additional conditions to it. When the user clicks the "Add Condition" button in the advanced find form UI the Web Bean handles the form submission and calls saveQueryDefinition() to save the current query definition.
java.lang.Exception
public void clearQueryConditions() throws java.lang.Exception
Removes the conditions entered for a query in a form submission. When the user clicks the "Clear Condition" button, the Web Bean handles the form submission and calls clearQueryConditions() to remove any conditions entered in the Find Form UI.
java.lang.Exception
public QueryDefinition getQueryDefinition()
Returns the QueryDefinition stored in the session object. There is only one query definition active within a session. After the query is executed, the query definition is cleared.
public void setUseJS(boolean bSet)
public void execute()
public void renderSimpleForm() throws java.lang.Exception
If you use renderSimpleForm(), the simple Find Form UI will be rendered regardless of whether you specified clearSimpleMode().
java.lang.Exception
public void render() throws java.lang.Exception
render
in interface WebBean
render
in class WebBeanImpl
java.lang.Exception
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.