function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sk kumarsk kumar 

in my scenario i hav 3 nodes like n1,n2,n3 & products like cpu,mouse,network,monitor. so when i selected n1 it will show cpu in other node next to n1 node.but Qn is if i select cpu node again it will show anothr node named intel next to cpu & its details

so basically its like a nested manner related to each other..so  i m putting my code over here..anyone kindly suggest or modify my code as for the given require ments..its urgent plz reply,,,!!

thnx in advance..:)

vf page---


<apex:page standardController="Account" extensions="productconfig6" sidebar="false" showHeader="false" standardStylesheets="true" > 
    <apex:form >
      <apex:pageblock >
        <apex:panelGrid columns="1" style="float:left;">
         Select Node&nbsp;&nbsp;&nbsp; <apex:selectList size="1" value="{!SelectedNode}">
                 <apex:selectOptions value="{!SelectedNodes}"/>
                      <apex:actionSupport event="onchange" reRender="a"/>
                      </apex:selectList>
                      <br></br><br></br>
                Select Product &nbsp;&nbsp;<apex:selectList size="1" value="{!product}" id="a">
               <apex:selectOptions value="{!products}"/>
                       <apex:actionSupport event="onclick" reRender="Details" action="{!productDetails}"/>
                    </apex:selectList>
                 </apex:panelGrid>
               <apex:outputPanel id="Details">
             <apex:detail subject="{!pList.id}"/>
          </apex:outputPanel>
        </apex:pageblock>
      </apex:form>
   </apex:page>

controller-----

public with sharing class productconfig6
  {
       Public String SelectedNode{get;set;}
       Public String Product{get;set;}
      
       Public String SelectedProduct{get;set;}
       public product2 pList {get; set;}
       
          public productconfig6(ApexPages.StandardController controller){
          
         }
     public List<SelectOption> getSelectedNodes()
      {
         List<SelectOption> options = new List<SelectOption>();
         options.add(new SelectOption('None','--- None ---'));      
         options.add(new SelectOption('N1','N1'));
         options.add(new SelectOption('N2','N2'));
         options.add(new SelectOption('N3','N3'));      
         return options;
      }
      
      public List<SelectOption> getProducts()
     {
          List<SelectOption> options = new List<SelectOption>();
          if(SelectedNode == 'N1')
         {     
              options.add(new SelectOption('CPU','CPU'));
             options.add(new SelectOption('MOUSE','MOUSE'));
         }
          else if(SelectedNode == 'N2')
         {     
             options.add(new SelectOption('N/W','N/W'));
             options.add(new SelectOption('network','network'));
             
          }
          else if(SelectedNode == 'N3')
        {     
             options.add(new SelectOption('MONITOR','MONITOR'));
            
         }
          else
          {
             options.add(new SelectOption('None','--- None ---'));
          }    
         return options;
      }     
  
  public List<String> productDetails()
     {
    
   pList= [select id,name FROM product2 where name=:product limit 1];
        return null;
    }
}
logontokartiklogontokartik
Instead of using getter method to return selectOptions, use action method to populate them and call these action methods via your <actionSupport>. Please look at a similar blog post that I answered few weeks back. Hope this helps

https://developer.salesforce.com/forums/ForumsMain?id=906F0000000Ael7IAC