Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Liferay Adding actions to search container

    • 0
    • 3
    • 1
    • 2
    • 0
    • 0
    • 0
    • 0
    • 2.02k
    Comment on it

    Liferay Search Container is Liferay UI component which display data in Grid format and its also containing pagination. Search Container is just simple JSTL tag and its allow to use in JSP pages.

    According our requirement we need to display result in grid format with pagination then we will use search container and its JSTL tags.

    We know these are JSTL tags in Liferay UI section so we need to specify the respective tag URI in the JSP page so that we can use in JSP pages.

    The following is URI declaration in JSP page

    <%@taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
    

    Search container declaration syntax

    <liferay-ui:search-container>
    <liferay-ui:search-container-results/>  
    <liferay-ui:search-container-row>              
    <liferay-ui:search-container-column-text/>
    <liferay-ui:search-container-column-text/>     
    </liferay-ui:search-container-row>
    <liferay-ui:search-iterator/>
    </liferay-ui:search-container>
    

    We are define search container action through <liferay-ui:search-container-column-text/> tag.

    <liferay-ui:search-container-column-text/>
    

    This will illustrate column in Grid. We want to display how many columns, should be declared those many column-text tags and all these tags should be enclosed by search-container-row tag. So in all row it will display data in columns and it will use Model object and Model Setter key property to display data.
    The following are some impotent attributes

    Name:

    Name is the column header name and we specified the column header in search-container tag.


    Propetry:

    Propetry is model class setter property and property is used to fetch data from model object and display in the row column.


    Value:

    Values used for display data.


    Href:

    This is row URL so that when we click row then it will navigate to specified URL.


    <liferay-ui:search-container-column-text name="Action">
    <a href="">Delete</a>
    </liferay-ui:search-container-column-text>
    

    Please download attachment example.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: