Fórumok

liferay-ui:search-form questions

sweeheng sng, módosítva 16 év-val korábban

liferay-ui:search-form questions

New Member Bejegyzések: 3 Csatlakozás dátuma: 2005.12.20. Legújabb bejegyzések
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
Roman Hoyenko, módosítva 16 év-val korábban

RE: liferay-ui:search-form questions

Liferay Master Bejegyzések: 878 Csatlakozás dátuma: 2007.10.08. Legújabb bejegyzések
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?
C.S. L, módosítva 16 év-val korábban

RE: liferay-ui:search-form questions

Junior Member Bejegyzések: 83 Csatlakozás dátuma: 2007.01.06. Legújabb bejegyzések
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
Alex Rud, módosítva 16 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 17 Csatlakozás dátuma: 2008.02.29. Legújabb bejegyzések
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
danny chanyalew, módosítva 15 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 9 Csatlakozás dátuma: 2007.11.29. Legújabb bejegyzések
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
Christian Zozmann, módosítva 15 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 2 Csatlakozás dátuma: 2008.07.04. Legújabb bejegyzések
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
danny chanyalew, módosítva 15 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 9 Csatlakozás dátuma: 2007.11.29. Legújabb bejegyzések
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
Christian Zozmann, módosítva 15 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 2 Csatlakozás dátuma: 2008.07.04. Legújabb bejegyzések
This still won't work in portlet configuration pages, because it is in ROOT context ant the jsp file is not.
thumbnail
danny chanyalew, módosítva 15 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 9 Csatlakozás dátuma: 2007.11.29. Legújabb bejegyzések
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
Albert J Carter-Corbin, módosítva 15 év-val korábban

RE: liferay-ui:search-form questions

Regular Member Bejegyzések: 123 Csatlakozás dátuma: 2006.09.12. Legújabb bejegyzések
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
danny chanyalew, módosítva 15 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 9 Csatlakozás dátuma: 2007.11.29. Legújabb bejegyzések
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
Sohui Gu, módosítva 14 év-val korábban

RE: liferay-ui:search-form questions

Regular Member Bejegyzések: 115 Csatlakozás dátuma: 2006.07.07. Legújabb bejegyzések
It works. very good.
AA CC, módosítva 12 év-val korábban

RE: liferay-ui:search-form questions

Junior Member Bejegyzések: 38 Csatlakozás dátuma: 2011.05.31. Legújabb bejegyzések
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
Peter Rodriguez, módosítva 11 év-val korábban

RE: liferay-ui:search-form questions

Regular Member Bejegyzések: 154 Csatlakozás dátuma: 2010.06.07. Legújabb bejegyzések
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
Manish Kumar Jaiswal, módosítva 11 év-val korábban

RE: liferay-ui:search-form questions

Regular Member Bejegyzések: 153 Csatlakozás dátuma: 2008.11.25. Legújabb bejegyzések
Hi peter ,

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

Regards
Manish
Sascha Ringert, módosítva 14 év-val korábban

RE: liferay-ui:search-form questions

New Member Bejegyzések: 2 Csatlakozás dátuma: 2009.11.25. Legújabb bejegyzések
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