掲示板

liferay-ui:search-form questions

16年前 に sweeheng sng によって更新されました。

liferay-ui:search-form questions

New Member 投稿: 3 参加年月日: 05/12/20 最新の投稿
I'm currently creating new portlet using Liferay Plugins environment and deploying them into Liferay. Recently, I encountered a problem with using liferay-ui:search-form.

I tried doing this and Liferay failed to retrieve the page from my plugins portlet.
		<liferay-ui:search-form page="/html/portlet/my_workflow/definition_search.jsp" searchContainer="<%= searchContainer %>" />

If I do this, Liferay will fetch the page from Liferay workflow portlet.
		<liferay-ui:search-form page="/html/portlet/workflow/definition_search.jsp" searchContainer="<%= searchContainer %>" />

What should I do to overcome this? What is happening behind the scenes?
thumbnail
16年前 に Roman Hoyenko によって更新されました。

RE: liferay-ui:search-form questions

Liferay Master 投稿: 878 参加年月日: 07/10/08 最新の投稿
Well, my guess is that the path is incorrect and the file is not there:

/html/portlet/my_workflow/definition_search.jsp

Where are you putting the file? Is it standalone or ext. environment portlet?
16年前 に C.S. L によって更新されました。

RE: liferay-ui:search-form questions

Junior Member 投稿: 83 参加年月日: 07/01/06 最新の投稿
Hi Roman,

He mentioned that he is developing in the "Liferay Plugin" environment, so I guess it is a "standalone" environment.

I run into such problem too and could not find a solution to it.
Does anyone know whether all the Liferay's taglibs could be used in a portlet war/plugin environment?
There is a sample-ui plugin sample that demonstrates the use of liferay taglibs in a plugin environment.
However, it is not complete. it seems to me that those taglib that uses the 'page' attribute or page include function cannot be used in the plugin environment?

Appreciate if someone could provide some guidance on whether Liferay's current support for portlet plugin environment can fully replace the existing EXT environment esp. in terms of access to the Liferay's APIs and taglibs?

Thanks!

/CS
16年前 に Alex Rud によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 17 参加年月日: 08/02/29 最新の投稿
I am also having a problem w/ this issue. Is this a bug? Has it been or should it be reported? Has anyone developed a workaround for this?
thumbnail
15年前 に danny chanyalew によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 9 参加年月日: 07/11/29 最新の投稿
Did you find any solutions for this issue. I am running into the same issue. Just to experiment i copied the jsp file I included under
the page attribute of the search-form tag, to the root of the portal jar Root.war under the docroot directory and the tag lib worked. I am guessing the correct context is not passed to the tag lib for the portlet plugins... anyways, before i waste time figuring out a solution, just wanted to check how you were able to move on.

thx
d
15年前 に Christian Zozmann によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 2 参加年月日: 08/07/04 最新の投稿
I think you should add the context path in the include path like this:
<liferay-ui:search-form page="<%= request.getContextPath() + " html portlet articles article_search.jsp" %>"
	searchContainer="&lt;%= searchContainer %&gt;"
&gt;</liferay-ui:search-form>
thumbnail
15年前 に danny chanyalew によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 9 参加年月日: 07/11/29 最新の投稿
well, i actually figured out the issue and meant to post it back , but stormed with work... let me quickly type my finding.

Here is a solution I am proposing.


create a new variable to pass to the tag (add in the tld file) the variable will be used to pass an optional context object

file com.liferay.taglib.ui.IncludeTag.java

define a protected context varaible

In the com.liferay.taglib.ui.SearchFormTag.java (this class extends IncludeTag.java

if context is passed in during usage of tag, set the portected context variable to it(the formtag extends IncludeTag.java so gets visiblity to modify)


go back to file com.liferay.taglib.ui.IncludeTag.java
in doEndTag method

check if context variable is set do something like this.

if (context == null)
servletContext = getServletContext();
else
servletContext = context;


this way, you wouldn't introduce any risk of breaking the existing code. developers using this form tag from plugin can then use it like this.

<liferay-ui:search-form
page="/html/portlet/enterprise_admin/user_search.jsp"
searchContainer="<%= searchContainer %>"
context="<%= pageContext%>"
/>


Thanks
Danny
15年前 に Christian Zozmann によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 2 参加年月日: 08/07/04 最新の投稿
This still won't work in portlet configuration pages, because it is in ROOT context ant the jsp file is not.
thumbnail
15年前 に danny chanyalew によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 9 参加年月日: 07/11/29 最新の投稿
yes it does work. I have tested it very well. when you are in the plugin directory pageContext of your jsp paged passed as a context attribute to the search-form will not resolve to Root. it should resolve to your portlet plugin root dir xxx-portlet.war
thumbnail
15年前 に Albert J Carter-Corbin によって更新されました。

RE: liferay-ui:search-form questions

Regular Member 投稿: 123 参加年月日: 06/09/12 最新の投稿
I'm not sure if you have figured this out already but while looking at your suggestions I found a possible solution.

While looking at the 5.1.x version of liferay I found that the servletContext was one of the parameters for the liferay-ui:search-form taglib. So I passed that in my plugin and it worked without modifying any of the code


<liferay-ui:search-form
page="/html/portlet/webstore/default/order_search.jsp"
searchContainer="<%= searchContainer %>"
servletContext="<%=this.getServletContext() %>"
/>.
thumbnail
15年前 に danny chanyalew によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 9 参加年月日: 07/11/29 最新の投稿
They probably fixed it in that version. I doubt if I over looked at the parameter, since I saw similar issues with other UI taglibs in the plugin environment. But it is not like I haven't done that before emoticon anyways, I am glad it worked out for you without any change.
thumbnail
14年前 に Sohui Gu によって更新されました。

RE: liferay-ui:search-form questions

Regular Member 投稿: 115 参加年月日: 06/07/07 最新の投稿
It works. very good.
12年前 に AA CC によって更新されました。

RE: liferay-ui:search-form questions

Junior Member 投稿: 38 参加年月日: 11/05/31 最新の投稿
Hi,

i'm using this code

<liferay-ui:search-form
page="/html/portlet/login/create_account.jsp"
servletContext="<%=this.getServletContext() %>"
/>

but it doesn't work. Why ?
I'm in a custom-portlet .

Please Help me
11年前 に Peter Rodriguez によって更新されました。

RE: liferay-ui:search-form questions

Regular Member 投稿: 154 参加年月日: 10/06/07 最新の投稿
Guys, please I am having same issue. In this case my code is a s follows:


<liferay-ui:search-form page="/book_admin/booksearch.jsp" servletContext="<%=this.getServletContext() %>" />


and I am trying the to include the search form from a /book_admin/view.jsp. Both files exist in the same folder.
My search file doesnt show and there are no errors. Any help please (slightly urgent)?
thumbnail
11年前 に Manish Kumar Jaiswal によって更新されました。

RE: liferay-ui:search-form questions

Regular Member 投稿: 153 参加年月日: 08/11/25 最新の投稿
Hi peter ,

did you get any solution to this . can you share it with us ?

Regards
Manish
14年前 に Sascha Ringert によって更新されました。

RE: liferay-ui:search-form questions

New Member 投稿: 2 参加年月日: 09/11/25 最新の投稿
danny chanyalew:


<liferay-ui:search-form
page="/html/portlet/enterprise_admin/user_search.jsp"
searchContainer="<%= searchContainer %>"
context="<%= pageContext%>"
/>

First thx for your solution, but i have a question.
Liferay Version is "Liferay Portal Enterprise Edition 5.2.4"

I'm trying to get the user searching, from the control panel, working in my own Portlet.

The Problem looks to me like it needs a SearchContainer from the type "UserSearch"(com.liferay.portlet.enterpriseadmin.search.UserSearch)

But in my Portlet the Type "UserSearch" cannot be found and so it crashes emoticon
"Only a type can be imported. com.liferay.portlet.enterpriseadmin.search.UserSearch resolves to a package"

So i checked, that the "UserSearch" is in the portal-impl.jar and it can't be seen by my Portlet.

How do i fill now the param "searchContainer" from the search-form?
The ui-tld says that "searchContainer" is not required. But if u leave the param empty it crashes with a NullPointerException.


I'm hoping someone can help me.

Sascha