Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sweeheng sng
liferay-ui:search-form questions
January 1, 2008 7:17 PM
Answer

sweeheng sng

Rank: New Member

Posts: 3

Join Date: December 19, 2005

Recent Posts

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.
1        <liferay-ui:search-form
2            page="/html/portlet/my_workflow/definition_search.jsp"
3            searchContainer="<%= searchContainer %>"
4        />

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

What should I do to overcome this? What is happening behind the scenes?
Roman Hoyenko
RE: liferay-ui:search-form questions
January 3, 2008 2:35 PM
Answer

Roman Hoyenko

Rank: Liferay Master

Posts: 868

Join Date: October 8, 2007

Recent Posts

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
RE: liferay-ui:search-form questions
January 3, 2008 9:47 PM
Answer

C.S. L

Rank: Junior Member

Posts: 83

Join Date: January 5, 2007

Recent Posts

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
RE: liferay-ui:search-form questions
February 29, 2008 11:26 AM
Answer

Alex Rud

Rank: New Member

Posts: 17

Join Date: February 29, 2008

Recent Posts

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?
danny chanyalew
RE: liferay-ui:search-form questions
August 18, 2008 9:36 PM
Answer

danny chanyalew

Rank: New Member

Posts: 9

Join Date: November 29, 2007

Recent Posts

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
RE: liferay-ui:search-form questions
August 28, 2008 6:22 AM
Answer

Christian Zozmann

Rank: New Member

Posts: 2

Join Date: July 4, 2008

Recent Posts

I think you should add the context path in the include path like this:
1<liferay-ui:search-form
2    page="<%= request.getContextPath() + "/html/portlet/articles/article_search.jsp" %>"
3    searchContainer="<%= searchContainer %>"
4>
danny chanyalew
RE: liferay-ui:search-form questions
August 29, 2008 12:57 AM
Answer

danny chanyalew

Rank: New Member

Posts: 9

Join Date: November 29, 2007

Recent Posts

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
RE: liferay-ui:search-form questions
September 4, 2008 4:47 AM
Answer

Christian Zozmann

Rank: New Member

Posts: 2

Join Date: July 4, 2008

Recent Posts

This still won't work in portlet configuration pages, because it is in ROOT context ant the jsp file is not.
danny chanyalew
RE: liferay-ui:search-form questions
September 6, 2008 10:08 PM
Answer

danny chanyalew

Rank: New Member

Posts: 9

Join Date: November 29, 2007

Recent Posts

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
Albert J Carter-Corbin
RE: liferay-ui:search-form questions
December 5, 2008 3:15 PM
Answer

Albert J Carter-Corbin

Rank: Regular Member

Posts: 122

Join Date: September 11, 2006

Recent Posts

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() %>"
/>.
danny chanyalew
RE: liferay-ui:search-form questions
February 5, 2009 9:14 PM
Answer

danny chanyalew

Rank: New Member

Posts: 9

Join Date: November 29, 2007

Recent Posts

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.
Sohui Gu
RE: liferay-ui:search-form questions
November 25, 2009 1:24 AM
Answer

Sohui Gu

Rank: Regular Member

Posts: 114

Join Date: July 6, 2006

Recent Posts

It works. very good.
Sascha Ringaart
RE: liferay-ui:search-form questions
November 25, 2009 10:39 AM
Answer

Sascha Ringaart

Rank: New Member

Posts: 2

Join Date: November 25, 2009

Recent Posts

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
AA CC
RE: liferay-ui:search-form questions
August 30, 2011 5:23 AM
Answer

AA CC

Rank: Junior Member

Posts: 38

Join Date: May 31, 2011

Recent Posts

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
David Ilechukwu
RE: liferay-ui:search-form questions
August 9, 2012 8:16 AM
Answer

David Ilechukwu

Rank: Regular Member

Posts: 116

Join Date: June 7, 2010

Recent Posts

Guys, please I am having same issue. In this case my code is a s follows:

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


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)?
Manish Kumar Jaiswal
RE: liferay-ui:search-form questions
August 27, 2012 3:47 AM
Answer

Manish Kumar Jaiswal

Rank: Regular Member

Posts: 133

Join Date: November 25, 2008

Recent Posts

Hi peter ,

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

Regards
Manish