You need to sign in to do that
Don't have an account?
Diego Vieira 8
Visualforce ReRender Help
Someone can help?
I have a pageBlockSectionItem to display a selectList and i should render another pageBlockSectionItem if some option of the list is selected("Dinâmica").
*Mudanca variable in visualforce page is the realizaMudanca in the controller
This is the pageBlockSectionItem of the list:
This is the function that i called in the controller
This is the pageBlockSectionItem that i should render if "Dinâmica" is the option selected
I have a pageBlockSectionItem to display a selectList and i should render another pageBlockSectionItem if some option of the list is selected("Dinâmica").
*Mudanca variable in visualforce page is the realizaMudanca in the controller
This is the pageBlockSectionItem of the list:
<apex:pageBlockSectionItem> <apex:outputLabel value="Nova Fase do Candidato"/> <apex:selectList value="{!NovaFaseCandidato}" multiselect="false" size="1"> <apex:actionSupport event="onchange" action="{!Change}" reRender="{!IF({Mudanca, "Blockteste", "")}"/> <apex:selectOptions value="{!FasesCandidato}"/> </apex:selectList> </apex:pageBlockSectionItem>*this is giving a syntax error, I don't know why
This is the function that i called in the controller
public PageReference Change() { if(NovaFaseCandidato == 'Dinâmica') { realizaMudanca = true; system.debug('true'); } else { realizaMudanca = false; system.debug('false'); } return null; }
This is the pageBlockSectionItem that i should render if "Dinâmica" is the option selected
</apex:pageBlockSectionItem> <apex:pageBlockSectionItem id="Blockteste" rendered = "{!Mudanca}"> <apex:outputLabel value="Selecione o painel"/> <apex:selectList value="{!DataHoraPainel}" styleClass="flutua-direita" multiselect="false" size="1"> <apex:selectOptions value="{!QualPainel}"/> </apex:selectList> </apex:pageBlockSectionItem>
Hope this will help you
All Answers
Find below code for your reference:
<!-- Remove condition check from rerender-->
<apex:pageBlockSectionItem>
<apex:outputLabel value="Nova Fase do Candidato"/>
<apex:selectList value="{!NovaFaseCandidato}" multiselect="false" size="1">
<apex:actionSupport event="onchange" action="{!Change}" reRender="Blockteste"/>
<apex:selectOptions value="{!FasesCandidato}"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<!-- Wrap the pageblocksectionitem inside an output panel and rerender that -->
<apex:outputPanel id="Blockteste">
<apex:outputPanel rendered="{!Mudanca}">
<apex:pageBlockSectionItem>
<apex:outputLabel value="Selecione o painel"/>
<apex:selectList value="{!DataHoraPainel}" styleClass="flutua-direita" multiselect="false" size="1">
<apex:selectOptions value="{!QualPainel}"/>
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:outputPanel>
</apex:outputPanel>
Hope this will help you...
Thanks,
Sanjay
<apex:page >
<apex:pageBlockSectionItem>
<apex:outputLabel value="Nova Fase do Candidato"/>
<apex:selectList value="{!NovaFaseCandidato}" multiselect="false" size="1">
<apex:actionSupport event="onchange" action="{!Change}" reRender="{!IF({Mudanca, 'Blockteste', '')}"/>
<apex:selectOptions value="{!FasesCandidato}"/>
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:page>
@SKSANJAY, I think that I need a solution that doesn't use an outputPanel, and by the way, your code doesn't work too. I can't figure out why.
@Tiago Armando Coelho, Your code gets syntax error just like mine :/
Hope this will help you