Foros de discusión

liferay-ui:search-form questions

sweeheng sng, modificado hace 16 años.

liferay-ui:search-form questions

New Member Mensajes: 3 Fecha de incorporación: 20/12/05 Mensajes recientes
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, modificado hace 16 años.

RE: liferay-ui:search-form questions

Liferay Master Mensajes: 878 Fecha de incorporación: 8/10/07 Mensajes recientes
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, modificado hace 16 años.

RE: liferay-ui:search-form questions

Junior Member Mensajes: 83 Fecha de incorporación: 6/01/07 Mensajes recientes
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, modificado hace 16 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 17 Fecha de incorporación: 29/02/08 Mensajes recientes
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, modificado hace 15 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 9 Fecha de incorporación: 29/11/07 Mensajes recientes
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, modificado hace 15 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 2 Fecha de incorporación: 4/07/08 Mensajes recientes
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, modificado hace 15 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 9 Fecha de incorporación: 29/11/07 Mensajes recientes
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, modificado hace 15 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 2 Fecha de incorporación: 4/07/08 Mensajes recientes
This still won't work in portlet configuration pages, because it is in ROOT context ant the jsp file is not.
thumbnail
danny chanyalew, modificado hace 15 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 9 Fecha de incorporación: 29/11/07 Mensajes recientes
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, modificado hace 15 años.

RE: liferay-ui:search-form questions

Regular Member Mensajes: 123 Fecha de incorporación: 12/09/06 Mensajes recientes
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, modificado hace 15 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 9 Fecha de incorporación: 29/11/07 Mensajes recientes
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, modificado hace 14 años.

RE: liferay-ui:search-form questions

Regular Member Mensajes: 115 Fecha de incorporación: 7/07/06 Mensajes recientes
It works. very good.
AA CC, modificado hace 12 años.

RE: liferay-ui:search-form questions

Junior Member Mensajes: 38 Fecha de incorporación: 31/05/11 Mensajes recientes
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, modificado hace 11 años.

RE: liferay-ui:search-form questions

Regular Member Mensajes: 154 Fecha de incorporación: 7/06/10 Mensajes recientes
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, modificado hace 11 años.

RE: liferay-ui:search-form questions

Regular Member Mensajes: 153 Fecha de incorporación: 25/11/08 Mensajes recientes
Hi peter ,

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

Regards
Manish
Sascha Ringert, modificado hace 14 años.

RE: liferay-ui:search-form questions

New Member Mensajes: 2 Fecha de incorporación: 25/11/09 Mensajes recientes
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