I have the following VisualForce page. I have a picklist with the name Tip_studija__c
. The pickist can have the values 'redni'
or 'izredni'
. I want to achieve the following: when I choose the value 'izredni'
the button shows and when I click on the value 'redni'
the button hides. That button is labeled as Samoplacnik
.
My code does not achieve this and I do not know where is the problem.
<apex:page controller="CustomStudentController">
<apex:form id="form1">
<apex:pageBlock id="mainSection" title="Nov Student">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Student.Name}"/>
<apex:inputField value="{!Student.Priimek__c}"/>
<apex:inputField value="{!Student.Letnik__c}"/>
<apex:inputField value="{!Student.Naslov__c}"/>
<apex:inputField value="{!Student.Datum_rojstva__c}"/>
<apex:inputField value="{!Student.Naziv_fakultete__c}"/>
<apex:inputField value="{!Student.Studijski_program__c}"/>
<apex:inputField value="{!Student.Tip_studija__c}" rendered="{!IF(Student.Tip_studija__c == 'izredni', false, true )}">
<apex:actionSupport event="onchange" rerender="placnik" />
</apex:inputField>
<apex:selectcheckboxes id="btnSpl" layout="pagedirection">
<apex:selectOption id="Placnik" itemValue="Samoplacnik" itemLabel="Samoplacnik" />
</apex:selectcheckboxes>
<apex:pageBlock id="vsi" title="Vsi studenti">
<apex:pageBlockTable value="{!students}" var="wrapper">
<apex:column value="{!wrapper.Name}"/>
<apex:column value="{!wrapper.Priimek__c}"/>
<apex:column value="{!wrapper.Naslov__c}"/>
<apex:column value="{!wrapper.Datum_rojstva__c}"/>
<apex:column value="{!wrapper.Naziv_fakultete__c}"/>
<apex:column value="{!wrapper.Studijski_program__c}"/>
<apex:column value="{!wrapper.Letnik__c}"/>
<apex:column value="{!wrapper.Tip_studija__c}"/>
<apex:column >
<apex:commandButton action="{!deleteStudentRecordById}" value="del" reRender="mainSection">
<apex:param name="studentId" value="{!wrapper.id}"/>
</apex:commandButton>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:commandButton action="{!SaveRecord}" value="Save" id="theButton" reRender="mainSection"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>