0

in a vf page i have 2 select lists, from one select i am getting the selected value and rendering second select list after that i want to process some other block depends on the value of second selected value, but iam not getting the value to the controller, my code is here

<apex:pageBlock id="pb">
            <apex:outputText value="Category" style="font-weight:900" /> &nbsp;
                <apex:selectList value="{!queueName}" size="1" id="first" >
                         <apex:selectOption itemLabel="--None--" itemValue=""/>
                        <apex:selectOptions value="{!QueueList}"/>
                        <apex:selectOption itemLabel="Event/Client Info" itemValue="1"/>
                        <apex:selectOption itemLabel="Afterhours Emergencies" itemValue="2"/>
                        <apex:selectOption itemLabel="Staffing or Travel" itemValue="100"/>
                        <apex:actionSupport event="onchange" rerender="pb"/> 
                </apex:selectList>
                <apex:pageBlockSection id="sub1" rendered="{!queueName='100'}" >
                    <apex:outputText value="Please select your staffing Coordinator" style="font-weight:900" /> &nbsp;
                <apex:selectList value="{!subqueue}"  size="1" id="second">
                        <apex:selectOption itemLabel="Jessica Koponen" itemValue="11"/>
                        <apex:selectOption itemLabel="Carmella Ramirez" itemValue="cramirez@healthadvocate.com"/>
                        <apex:selectOption itemLabel="June Thai" itemValue="jthai@healthadovcate.com"/>
                        <apex:selectOption itemLabel="Mary Casillas" itemValue="mcasillas@healthadvocate.com"/>
                        <apex:selectOption itemLabel="I don’t know" itemValue="ccovarrubias@healthadvocate.com"/>
                </apex:selectList>
                </apex:pageBlockSection>

                <apex:pageBlockSection id="sub2" rendered="{!queueName='1'}">
                    <apex:outputText value="Please email the Project Manager listed on your detail sheet" style="font-weight:800"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection id="sub3" rendered="{!queueName='2'}">
                    <apex:outputText value="Please call 484-567-0827"  style="font-weight:800"/>
                </apex:pageBlockSection>
        </apex:pageBlock>

in the class i am writing like this

public PageReference save() {

        system.debug('queueName### '+queueName);
        system.debug('subqueue### '+subqueue);



        if(queueName == '100')
        {
            queueName = subqueue;
        }
       }

here i am getting QueueName as 100, but getting subqueue as null, i want to get the selected value .. Please help me out guys thanks in advance

  • on the vf page, after u select queueName, is the subqueue pick list rendering? and when are you calling the save method? – night crawler Jun 28 '17 at 7:28
  • yes, after selecting queueName only rendering the subqueue and i am calling the save method using command button. – prasad nagamalli Jun 28 '17 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.