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
    Commented Mar 16, 2016 at 5:10

1 Answer 1

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. Commented Mar 16, 2016 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
    Commented Mar 16, 2016 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. Commented Mar 16, 2016 at 5:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .