0

I have the requirement where i have to make bottom td element available if Is This mercer case yes.And if Not it should be invisible.

<table>                     
    <tr>
        <th>
            <span>Is this a Mercer case?</span> 

        </th>
        <td>
            <apex:selectList size="1" value="{!mercerVal}" multiselect="false">
                <apex:selectOptions value="{!mercerOptions}" /> 
            </apex:selectList>
        </td>
        <th>
            <span>Direct Deposit of Cliam Reimbursement</span> 

        </th>
        <td>
            <apex:selectCheckboxes value="{!costContainmentVendorValList}" >
                <apex:selectOptions value="{!costContainmentVendorOptions}" />
            </apex:selectCheckboxes>
        </td>
    </tr>
    <tr>
        <td>
            <br/>
        </td>
    </tr>
</table>

Thanks

enter image description here

1
  • 2
    Please edit your question to include the relevant markup for these two inputs. – Adrian Larson Mar 16 '16 at 5:10
2

A bit of explanation, when you rerender an element, you only actually change the DOM of its children, so you need to wrap your selectCheckboxes in an outer element that, when rerendered, will update the rendered property of the tag itself.

You can modify the selectList and selectOptions as follows:

<apex:selectList ...>
    <apex:selectOptions />
    <apex:actionSupport event="onchange" rerender="deposit" />
</apex:selectList>
...
<apex:outputPanel id="deposit">
    <apex:selectCheckboxes rendered="{!mercerVal == 'Yes'}" ...>
        ...
    </apex:selectCheckboxes>
</apex:outputPanel>
3
  • Thanks Adrain.I was wondering these both are same panel already.Its like They are part of same Row of table.Would panel makes it toggle as coloum.Would that effect will be there. – David Mycka Mar 16 '16 at 5:29
  • Don't quite understand your question, but which element you rerender is not super important, as long as it is wraps the selectCheckboxes at some level. – Adrian Larson Mar 16 '16 at 5:33
  • Ok,Please also guide me how can i see what value is comming in !mercerVal..Do i print in debug log for controller or any other simpler option. – David Mycka Mar 16 '16 at 5:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.