📄 usage.apt
字号:
* ajax:displayTag~~~~~~~~~~~~~~~~~ The displayTag is similar to the area tag, but it specifically tailored to the Display Tag. It wraps DisplayTag ajaxing pagination and sorting. If you use this tag your content have to be xhtml conform. +------------------------------------------------------------------------+<ajax:displayTag id="displayTagFrame"> <display:table name="service.allCars" class="displaytag" pagesize="10" scope="page" defaultsort="1" defaultorder="descending" export="true" id="row" excludedParams="ajax"> <display:column property="make" title="Make" sortable="true" headerClass="sortable" /> <display:column property="model" title="Model" sortable="true" headerClass="sortable" /> <display:column title="Link" media="html"> <a href="http://www.${row.make}.com">${row.make} Web Page</a> </display:column> <display:column title="Link" media="excel xml"> www.${row.make}.com </display:column> </display:table></ajax:displayTag>+------------------------------------------------------------------------+*---------------------+------------------------------------------------------------+-------------* <<Parameter>> | <<Description>> | <<Required>>*---------------------+------------------------------------------------------------+-------------* id | Name of ID used for enclosing DIV tag written by tag | yes*---------------------+------------------------------------------------------------+-------------* pagelinksClass | CSS class name of the DisplayTag's navigation links [default="pagelinks"] | no*---------------------+------------------------------------------------------------+-------------* columnClass | The CSS class of the TD within the THEAD of the table that should have their HREFs rewritten [default="sortable"] | no*---------------------+------------------------------------------------------------+-------------* postFunction | Function to execute after Ajax is finished, allowing for a chain of additional functions to execute | no*---------------------+------------------------------------------------------------+-------------* parameters | A comma-separated list of parameters to pass to the server-side action or servlet | false*---------------------+------------------------------------------------------------+-------------** ajax:htmlContent~~~~~~~~~~~~~~~~~~ The HTML content tag allows you to fill a region on the page (often a DIV tag) with any HTML content pulled from another webpage. The AJAX action may be activated by attaching it to an anchor link or form field. This tag expects an HTML response instead of XML and the AJAX function will not parse it as XML; it will simply insert the content of the response as is.+------------------------------------------------------------------------+<div id="modelDescription"></div><div id="htmlContentForm"> <p>Select by ANCHOR link.</p> <ul> <li><a href="javascript://nop/" class="contentLink">Ford</a></li> <li><a href="javascript://nop/" class="contentLink">Honda</a></li> <li><a href="javascript://nop/" class="contentLink">Mazda</a></li> </ul></div><ajax:htmlContent baseUrl="${pageContext.request.contextPath}/htmlcontent.view" sourceClass="contentLink" target="modelDescription" parameters="q={ajaxParameter}" />+------------------------------------------------------------------------+ <<Note: Tag must appear AFTER the web form.>>*---------------------+------------------------------------------------------------+-------------* <<Parameter>> | <<Description>> | <<Required>>*---------------------+------------------------------------------------------------+-------------* var | Name of the JavaScript object created | no*---------------------+------------------------------------------------------------+-------------* attachTo | Name of the JavaScript object to which htmlContent will attach. You must define 'var' for this to work. | no*---------------------+------------------------------------------------------------+-------------* baseUrl | URL of server-side action or servlet that processes a simple command | yes*---------------------+------------------------------------------------------------+-------------* source | ID of the element to which the event will be attached | either source or sourceClass must be defined*---------------------+------------------------------------------------------------+-------------* sourceClass | The CSS class name of the elements to which the event will be attached | either source or sourceClass must be defined*---------------------+------------------------------------------------------------+-------------* target | ID of DIV tag or other element that will be filled with the response's HTML | yes*---------------------+------------------------------------------------------------+-------------* parameters | A comma-separated list of parameters to pass to the server-side action or servlet | yes*---------------------+------------------------------------------------------------+-------------* eventType | Specifies the event type to attach to the source field(s) | no*---------------------+------------------------------------------------------------+-------------* preFunction | Function to execute before Ajax is begun | no*---------------------+------------------------------------------------------------+-------------* postFunction | Function to execute after Ajax is finished, allowing for a chain of additional functions to execute | no*---------------------+------------------------------------------------------------+-------------* errorFunction | Function to execute if there is a server exception (non-200 HTTP response) | no*---------------------+------------------------------------------------------------+-------------** ajax:portlet~~~~~~~~~~~~~~ The portlet tag simulates a <a href="http://www.jcp.org/en/jsr/detail?id=168">JSR-168</a> style portlet by allowing you to define a portion of the page that pulls content from another location using Ajax with or without a periodic refresh. This tag expects an HTML response instead of XML and the AJAX function will not parse it as XML; it will simply insert the content of the response as is.+------------------------------------------------------------------------+<ajax:portlet source="portlet_1" baseUrl="${pageContext.request.contextPath}/htmlcontent.view?make=ford" classNamePrefix="portlet" title="Ford Portlet" imageClose="${pageContext.request.contextPath}/img/close.png" imageMaximize="${pageContext.request.contextPath}/img/maximize.png" imageMinimize="${pageContext.request.contextPath}/img/minimize.png" imageRefresh="${pageContext.request.contextPath}/img/refresh.png" />+------------------------------------------------------------------------+*---------------------+------------------------------------------------------------+-------------* <<Parameter>> | <<Description>> | <<Required>>*---------------------+------------------------------------------------------------+-------------* var | Name of the JavaScript object created | no*---------------------+------------------------------------------------------------+-------------* attachTo | Name of the JavaScript object to which portlet will attach. You must define 'var' for this to work. | no*---------------------+------------------------------------------------------------+-------------* baseUrl | URL of server-side action or servlet that processes a simple command | yes*---------------------+------------------------------------------------------------+-------------* source | ID of the portlet | yes*---------------------+------------------------------------------------------------+-------------* parameters | A comma-separated list of parameters to pass to the server-side action or servlet | no*---------------------+------------------------------------------------------------+-------------* classNamePrefix | CSS class name prefix to use for the portlet's 'Box', 'Tools', 'Refresh', 'Size', 'Close', 'Title', and 'Content' elements | yes*---------------------+------------------------------------------------------------+-------------* title | Title for portlet header | yes*---------------------+------------------------------------------------------------+-------------* imageClose | Image used for the close icon | no*---------------------+------------------------------------------------------------+-------------* imageMaximize | Image used for the maximize icon | no*---------------------+------------------------------------------------------------+-------------* imageMinimize | Image used for the minimize icon | no*---------------------+------------------------------------------------------------+-------------* imageRefresh | Image used for the refresh icon | no*---------------------+------------------------------------------------------------+-------------* refreshPeriod | The time (in seconds) the portlet waits before automatically refreshing its content. If no period is specified, the portlet will not refresh itself automatically, but must be commanded to do so by clicking the refresh image/link (if one is defined). Lastly, the refresh will not occur until after the first time the content is loaded, so if executeOnLoad is set to false, the refresh will not begin until you manually refresh the first time. | no*---------------------+------------------------------------------------------------+-------------* executeOnLoad | Indicates whether the portlet's content should be retrieved when the page loads [default=true] | no*---------------------+------------------------------------------------------------+-------------* expireDays | Number of days cookie should persist | no*---------------------+------------------------------------------------------------+-------------* expireHours | Number of hours cookie should persist | no*---------------------+------------------------------------------------------------+-------------* expireMinutes | Number of minutes cookie should persist | no*---------------------+------------------------------------------------------------+-------------* preFunction | Function to execute before Ajax is begun | no*---------------------+------------------------------------------------------------+-------------* postFunction | Function to execute after Ajax is finished, allowing for a chain of additional functions to execute | no*---------------------+------------------------------------------------------------+-------------* errorFunction | Function to execute if there is a server exception (non-200 HTTP response) | no*---------------------+------------------------------------------------------------+-------------** ajax:select~~~~~~~~~~~~~ The select tag allows one to retrieve a list of values from a backend servlet (or other server-side control) and display them in another HTML select box.+------------------------------------------------------------------------+<form> Make: <select id="make" name="make"> <option value="">Select make</option> <c:forEach items="${makes}" var="make"> <option value="${make}">${make}</option> </c:forEach> </select> Model: <select id="model" name="model"> <option value="">Select model</option> </select></form><ajax:select baseUrl="${pageContext.request.contextPath}/GetCarModel.view" source="make" target="model" parameters="make={make}" postFunction="doOtherThings" />+------------------------------------------------------------------------+ <<Note: Tag must appear AFTER the web form.>>*---------------------+------------------------------------------------------------+-------------* <<Parameter>> | <<Description>> | <<Required>>*---------------------+------------------------------------------------------------+-------------* var | Name of the JavaScript object created | no*---------------------+------------------------------------------------------------+-------------* attachTo | Name of the JavaScript object to which select will attach. You must define 'var' for this to work. | no*---------------------+------------------------------------------------------------+-------------* baseUrl | URL of server-side action or servlet that processes a simple command | yes*---------------------+------------------------------------------------------------+-------------* source | The initial select field that will form the basis for the search via AJAX | yes*---------------------+------------------------------------------------------------+-------------* target | Select field where value of AJAX search will be populated | yes*---------------------+------------------------------------------------------------+-------------* parameters | A comma-separated list of parameters to pass to the server-side action or servlet | no*---------------------+------------------------------------------------------------+-------------* eventType | Specifies the event type to attach to the source field(s) | no*---------------------+------------------------------------------------------------+-------------* executeOnLoad | Indicates whether the target select/dropdown should be populated when the object is initialized (this is essentially when the form loads) [default=false] | no*---------------------+------------------------------------------------------------+-------------* defaultOptions | A comma-seperated list of values of options to be marked as selected by default if they exist in the new set of options | no*---------------------+------------------------------------------------------------+-------------* preFunction | Function to execute before Ajax is begun | no*---------------------+------------------------------------------------------------+-------------* postFunction | Function to execute after Ajax is finished, allowing for a chain of additional functions to execute | no*---------------------+------------------------------------------------------------+-------------* errorFunction | Function to execute if there is a server exception (non-200 HTTP response) | no*---------------------+------------------------------------------------------------+-------------* parser | The response parser to implement [default=ResponseHtmlParser] | no*---------------------+------------------------------------------------------------+-------------** ajax:tabPanel~~~~~~~~~~~~~~~ Provides a tabbed page view of content from different resources+------------------------------------------------------------------------+<ajax:tabPanel id="ajaxCurrentTab"> <ajax:tab caption="Ford" baseUrl="${pageContext.request.contextPath}/htmlcontent.view?make=ford"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -