mathlearner
mathlearner

Reputation: 7639

Visualforce rendered attribute is not working as expected

<apex:pageBlock >

<apex:selectList id="fields" value="{! xxx}" multiselect="true" size="3" rendered="{! FieldRendering}">
<apex:selectOptions value="{!items}"/>
<!-- Search content -->
<apex:actionSupport event="onchange" reRender="srcResultPanel" action="{!find}"/>
</apex:selectList>

the select list is not rendering when FieldRendering attribute is true for sure but when i remove rendered attribute then its showing selectList and rerendering selectoptions properly can any one please tell how to fix it in starting FieldRendering attribute is false but after clicking a button it is true but it is not rendering after clicking the button why please explain and suggest how to fix it ??

Upvotes: 0

Views: 2481

Answers (1)

Moti Korets
Moti Korets

Reputation: 3748

The thing is if a tag is not meeting rendered criteria when the page loads it doesn't present in page so can't be rerendered. A viable solution is to wrap target tag in outputPanel and rerender It( the outputPanel tag).

Upvotes: 0

Related Questions