You need to sign in to do that
Don't have an account?
Rahul
My Code :-
<apex:inputField value="{!buck1.Aadhar_Number__c}" required="true"/>
<apex:inputField value="{!buck1.CBIL__c}" required="true"/>
<apex:actionRegion >
<apex:pageBlockSectionItem >
<apex:outputLabel >Do you Have Loans? :</apex:outputLabel>
<apex:inputField value="{!Bucket1__c.Do_you_have_Loans__c}">
<apex:actionSupport action="{!null}" event="onchange" reRender="myform" />
</apex:inputfield>
</apex:pageBlockSectionItem>
</apex:actionRegion>
<apex:pageBlockSectionItem >
<apex:outputPanel id="myform" >
<apex:outputPanel rendered="{!IF(Bucket1__c.Do_you_have_Loans__c== 'Yes', true,false)}" >
<apex:outputLabel >EMI Per Month</apex:outputLabel>
<apex:inputField value="{!Bucket1__c.EMI_Per_Month__c}" ></apex:inputField>
</apex:outputPanel>
</apex:outputPanel>
</apex:pageBlockSectionItem>
Hello friends, Iam rendering a input field based on Picklist condition. Its working but they are not displayed with proper styling. Need your Help
My Code :-
<apex:inputField value="{!buck1.Aadhar_Number__c}" required="true"/>
<apex:inputField value="{!buck1.CBIL__c}" required="true"/>
<apex:actionRegion >
<apex:pageBlockSectionItem >
<apex:outputLabel >Do you Have Loans? :</apex:outputLabel>
<apex:inputField value="{!Bucket1__c.Do_you_have_Loans__c}">
<apex:actionSupport action="{!null}" event="onchange" reRender="myform" />
</apex:inputfield>
</apex:pageBlockSectionItem>
</apex:actionRegion>
<apex:pageBlockSectionItem >
<apex:outputPanel id="myform" >
<apex:outputPanel rendered="{!IF(Bucket1__c.Do_you_have_Loans__c== 'Yes', true,false)}" >
<apex:outputLabel >EMI Per Month</apex:outputLabel>
<apex:inputField value="{!Bucket1__c.EMI_Per_Month__c}" ></apex:inputField>
</apex:outputPanel>
</apex:outputPanel>
</apex:pageBlockSectionItem>
To get the formating try something like:
note that we are trying to match the layout from one pageBlockSectionItem to the next i.e. outputLabel is the first to follow, so it picks up the formatting in the pageBlockSectionItem first.
Also move the actionRegion to tighten around the field that is doing the change(action).
Its not perfect , but may help.
Regards
Andrew