01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.jsp.tag.uilib.list;
16:
17: import java.io.Writer;
18: import org.araneaframework.jsp.tag.BaseTag;
19: import org.araneaframework.jsp.tag.uilib.form.FormTag;
20: import org.araneaframework.uilib.list.ListWidget;
21:
22: /**
23: * List widget filter tag.
24: *
25: * @author Oleg Mürk
26: *
27: * @jsp.tag
28: * name = "listFilter"
29: * body-content = "JSP"
30: * description = "Represents UiLib list filter. Introduces an implicit UiLib form, so one can place form elements under it."
31: */
32: public class ListFilterTag extends BaseTag {
33:
34: //
35: // Implementation
36: //
37:
38: public int doStartTag(Writer out) throws Exception {
39: super .doStartTag(out);
40:
41: // Get list data
42: String listId = (String) requireContextEntry(ListTag.LIST_ID_KEY);
43:
44: // Include form tag
45: formTag = new FormTag();
46: this .registerSubtag(formTag);
47: formTag.setId(listId + "." + ListWidget.FILTER_FORM_NAME);
48: this .executeStartSubtag(formTag);
49:
50: // Continue
51: return EVAL_BODY_INCLUDE;
52: }
53:
54: public int doEndTag(Writer out) throws Exception {
55:
56: this .executeEndSubtag(formTag);
57: this .unregisterSubtag(formTag);
58:
59: // Continue
60: super .doEndTag(out);
61: return EVAL_PAGE;
62: }
63:
64: protected FormTag formTag;
65: }
|