1
14
15 package com.liferay.taglib.ui;
16
17 import com.liferay.portal.kernel.dao.search.ResultRow;
18 import com.liferay.portal.kernel.util.GetterUtil;
19
20 import javax.servlet.jsp.JspException;
21 import javax.servlet.jsp.JspTagException;
22 import javax.servlet.jsp.tagext.TagSupport;
23
24
30 public class SearchContainerRowParameterTag<R> extends TagSupport {
31
32 public int doStartTag() throws JspException {
33 SearchContainerRowTag<R> parentRowTag =
34 (SearchContainerRowTag<R>)findAncestorWithClass(
35 this, SearchContainerRowTag.class);
36
37 if (parentRowTag == null) {
38 throw new JspTagException(
39 "Requires liferay-ui:search-container-row");
40 }
41
42 ResultRow row = parentRowTag.getRow();
43
44 if (_name.equals("className")) {
45 row.setClassName(_name);
46 }
47 else if (_name.equals("classHoverName")) {
48 row.setClassHoverName((String)_value);
49 }
50 else if (_name.equals("restricted")) {
51 row.setRestricted(GetterUtil.getBoolean((String)_value, false));
52 }
53 else {
54 row.setParameter(_name, _value);
55 }
56
57 return EVAL_BODY_INCLUDE;
58 }
59
60 public void setName(String name) {
61 _name = name;
62 }
63
64 public void setValue(Object value) {
65 _value = value;
66 }
67
68 private String _name;
69 private Object _value;
70
71 }