Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPS-41810 #19362

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions portal-web/docroot/html/taglib/ui/input_search/page.jsp
Expand Up @@ -25,14 +25,19 @@ String name = GetterUtil.getString((String)request.getAttribute("liferay-ui:inpu
String placeholder = GetterUtil.getString((String)request.getAttribute("liferay-ui:input-search:placeholder"));
boolean showButton = GetterUtil.getBoolean(request.getAttribute("liferay-ui:input-search:showButton"));
String title = GetterUtil.getString((String)request.getAttribute("liferay-ui:input-search:title"));
boolean useNamespace = GetterUtil.getBoolean(request.getAttribute("liferay-ui:input-search:useNamespace"), true);

String value = ParamUtil.getString(request, name);

if (!useNamespace) {
namespace = StringPool.BLANK;
}
%>

<div class="<%= cssClass %> input-group">
<label class="hide-accessible" for="<portlet:namespace /><%= id %>"><%= title %></label>
<label class="hide-accessible" for="<%= namespace + id %>"><%= title %></label>

<input class="form-control search-query" id="<portlet:namespace /><%= id %>" name="<portlet:namespace /><%= name %>" placeholder="<%= placeholder %>" title="<%= title %>" type="text" value="<%= HtmlUtil.escapeAttribute(value) %>" />
<input class="form-control search-query" id="<%= namespace + id %>" name="<%= namespace + name %>" placeholder="<%= placeholder %>" title="<%= title %>" type="text" value="<%= HtmlUtil.escapeAttribute(value) %>" />

<c:if test="<%= showButton %>">
<span class="input-group-btn">
Expand Down
Expand Up @@ -50,5 +50,5 @@ portletURL.setWindowState(WindowState.MAXIMIZED);
<form action="<%= HtmlUtil.escape(portletURL.toString()) %>" class="form" method="post" name="<%= namespace %>fm" onSubmit="submitForm(this); return false;">

<div class="form-search">
<liferay-ui:input-search name="keywords" placeholder='<%= LanguageUtil.get(locale, "keywords") %>' />
<liferay-ui:input-search id='<%= namespace + "keywords_" + StringUtil.randomId() %>' name='<%= namespace + "keywords" %>' placeholder='<%= LanguageUtil.get(locale, "keywords") %>' useNamespace="<%= false %>" />
</div>
5 changes: 5 additions & 0 deletions util-taglib/src/META-INF/liferay-ui.tld
Expand Up @@ -2191,6 +2191,11 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>useNamespace</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>input-select</name>
Expand Down
7 changes: 7 additions & 0 deletions util-taglib/src/com/liferay/taglib/ui/InputSearchTag.java
Expand Up @@ -58,6 +58,10 @@ public void setTitle(String title) {
_title = title;
}

public void setUseNamespace(boolean useNamespace) {
_useNamespace = useNamespace;
}

@Override
protected void cleanUp() {
super.cleanUp();
Expand All @@ -70,6 +74,7 @@ protected void cleanUp() {
_placeholder = null;
_showButton = true;
_title = null;
_useNamespace = true;
}

@Override
Expand Down Expand Up @@ -122,6 +127,7 @@ protected void setAttributes(HttpServletRequest request) {
"liferay-ui:input-search:placeholder", placeholder);
request.setAttribute("liferay-ui:input-search:showButton", _showButton);
request.setAttribute("liferay-ui:input-search:title", title);
request.setAttribute("liferay-ui:input-search:useNamespace", _useNamespace);
}

private static final String _PAGE = "/html/taglib/ui/input_search/page.jsp";
Expand All @@ -134,5 +140,6 @@ protected void setAttributes(HttpServletRequest request) {
private String _placeholder;
private boolean _showButton = true;
private String _title;
private boolean _useNamespace = true;

}