Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sasmita swain
retreive data from db
November 1, 2012 4:01 AM
Answer

sasmita swain

Rank: Regular Member

Posts: 185

Join Date: February 24, 2012

Recent Posts

hi

how to retreive categories with sub categories from database in shopping portlet???category should come as heading and subcategory will display for this category
any one please help meout
Thanks
Sasmita
Pavel Savinov
RE: retreive data from db
November 1, 2012 4:15 AM
Answer

Pavel Savinov

Rank: Junior Member

Posts: 97

Join Date: September 24, 2012

Recent Posts

You can create a hook for page /html/portlet/shopping/categories.jsp and iterate over all categories to build and display a tree:

1<%
2 List<ShoppingCategory> list = ShoppingCategoryLocalServiceUtil.getShoppingCategories(QueryUtil.ALL_POS,QueryUtil.ALL_POS);
3   /*
4      build a tree from list using category.isRoot(), category.getParentId(), etc.
5      and display categories in the form of tree.
6   */
7 }
8%>
Gaurav Jain
RE: retreive data from db
November 1, 2012 4:39 AM
Answer

Gaurav Jain

Rank: Regular Member

Posts: 146

Join Date: January 31, 2011

Recent Posts

sasmita swain:
hi

how to retreive categories with sub categories from database in shopping portlet???category should come as heading and subcategory will display for this category
any one please help meout
Thanks
Sasmita


@Sasmita, why are you duplicating posts? (http://www.liferay.com/web/guest/community/forums/-/message_boards/view_message/17584945)

Its really not nice. When you are still have doubts you can still post in your old post (which is just 1-2 days old).
I think we all should coordinate in keeping forum neat and healthy.
sasmita swain
RE: retreive data from db
November 1, 2012 9:19 PM
Answer

sasmita swain

Rank: Regular Member

Posts: 185

Join Date: February 24, 2012

Recent Posts

Pavel Savinov:
You can create a hook for page /html/portlet/shopping/categories.jsp and iterate over all categories to build and display a tree:

1<%
2 List<ShoppingCategory> list = ShoppingCategoryLocalServiceUtil.getShoppingCategories(QueryUtil.ALL_POS,QueryUtil.ALL_POS);
3   /*
4      build a tree from list using category.isRoot(), category.getParentId(), etc.
5      and display categories in the form of tree.
6   */
7 }
8%>



thanks for your replay
can you give some example?

Thanks
Sasmita
sasmita swain
RE: retreive data from db
November 2, 2012 10:19 PM
Answer

sasmita swain

Rank: Regular Member

Posts: 185

Join Date: February 24, 2012

Recent Posts

hi

how to retrieve data from db in aui tree????
Nikhil Nishchal
RE: retreive data from db
November 4, 2012 9:18 PM
Answer

Nikhil Nishchal

Rank: Regular Member

Posts: 146

Join Date: June 21, 2012

Recent Posts

sasmita swain:
hi

how to retrieve data from db in aui tree????



for alloy ui tree view you can use this link.
http://www.liferay.com/community/liferay-projects/alloy-ui/demo?title=community-liferay-projects-alloy-ui-demos-treeview

Here, in place of static content you can pass your db content from jsp.