This discussion is archived
3 Replies Latest reply: Oct 27, 2012 6:59 AM by RMishra RSS

how to display items from database using catagorylookupdroplet

967509 Newbie
Currently Being Moderated
Hi everyone,

i want to know how to display items from database using catagorylookup droplet. if anybody have any code snippet please share it.

Thanks in advance,
  • 1. Re: how to display items from database using catagorylookupdroplet
    RMishra Journeyer
    Currently Being Moderated
    <dsp:droplet name=".................../CategoryLookup">
         <dsp:param name="id" param="itemId"/>
         <dsp:oparam name="output">
              <dsp:valueof param="element.displayName"/>
                        
                   <%-- This is show the Child Category --%>
                   <dsp:droplet name="......................./ForEach">
                   <dsp:param name="array" param="element.childCategories"/>
                   <dsp:oparam name="outputStart">Child Categories</dsp:oparam>
                   <dsp:oparam name="output">
                        <dsp:a href="">//bydefault it will take its own file's name
                             <dsp:param name="itemId" param="element.repositoryId"/>                                                                                          <dsp:valueof param="element.displayName"/>
                        </dsp:a>
                   </dsp:oparam>                                             
                   </dsp:droplet>
         
                   <%-- This is show the Child Product --%>          
                   <dsp:droplet name=".............../ForEach">
                        <dsp:param name="array" param="element.childProducts"/>
                        <dsp:oparam name="outputStart">Child Products</dsp:oparam>
                                  <dsp:oparam name="output">
                                       <dsp:droplet name="................/ProductLookup">
                                            <dsp:param name="id" param="itemId"/>
                                            <dsp:param name="elementName" value="Prod"/>
                                            <dsp:oparam name="output">
                                                 <dsp:getvalueof id="img102" param="Prod.smallImage.url" idtype="java.lang.String">
                                                      <dsp:img height="250" width="250" src="<%=img102%>"/>
                                                 </dsp:getvalueof>
                                            </dsp:oparam>
                                       </dsp:droplet>
         
                                       <dsp:a href="productView.jsp">
                                            <dsp:param name="itemId" param="element.repositoryId"/>
                                            <dsp:valueof param="element.displayName"/>
                                       </dsp:a>
                             ..............................
                             ..............................

    Hope this helps.
    -RMishra
  • 2. Re: how to display items from database using catagorylookupdroplet
    967509 Newbie
    Currently Being Moderated
    thanks for the reply Mishra,

    in the same way how wil display the items in one catagory in the same page. for example if the cursor was placed on women in crs store it'll display all the items which are available for women like shirts,skirts.........etc. how we will do that?
  • 3. Re: how to display items from database using catagorylookupdroplet
    RMishra Journeyer
    Currently Being Moderated
    yes, one way is:
    <dsp:a href="...CategoryPage.jsp/itemId="cat123">woman</.......>

    when you once open women category page just note down categoryId and paste hard coded like aboive.
    If there is alternate solution please someone paste here.
    -RMishra

    Edited by: RMishra on Oct 27, 2012 7:28 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points