• Annie Kitchens
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi 

i am new in salesforce.

I had created a vf page products which shows list of products from a custom object "siteproducts"

Also there is a sidebar in the vf page for categories which also comes from custom object "categories"

I want that when ever i click on a particular category only corresponding products should be displayed.

I want to do it using Ajax. I am pasting a portion of my code here :

 

Product List :

 

<apex:outputPanel id="detail">
<apex:dataTable value="{!products}" var="prod" id="theTable" >

<apex:column >

<apex:facet name="header">Name</apex:facet>

<apex:outputText value="{!prod.Name}"/>

</apex:column>

<apex:column >

<apex:facet name="header">Image</apex:facet>

<apex:outputField value="{!prod.Image__c}"/>

</apex:column>

<apex:column >
<apex:outputLink value="/apex/ProductDetail?Id={!prod.Id}">
Details
</apex:outputLink>
</apex:column>

 

<apex:column >
<apex:outputLink value="/apex/ProductDetail?Id={!prod.Id}">
Add to Cart
</apex:outputLink>
</apex:column>

</apex:dataTable>
</apex:outputPanel>

 

 

Side bar of category :

 

<apex:dataList value="{!categories}" var="cat">
<apex:commandLink reRender="detail">{!cat.Name}
<apex:param name="categoryid" value="{!cat.id}"/>
</apex:commandLink>
</apex:dataList>

 

How will i implement this .Please help.

Thanks.