function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jacob W LandisJacob W Landis 

Why rerender not working for the new record?

Hi,

I have a visualforce page code below. Basically a checkbox and a input text, by click checkbox, show inputtext, uncheck it, not show input text. It works perfectly fine when edit a record. But when I create a new record, it isn't working. Any ideas?
         
               <apex:outputPanel id="otherPrograms">  
                     {!OSFS_Grad_Student_Supplement__c.Other__c}       
                        <apex:pageBlockSectionItem >
                            <apex:inputcheckbox value="{!OSFS_Grad_Student_Supplement__c.Other__c   }" id="Other">
                                <apex:actionSupport event="onchange" rerender="otherPrograms" />
                            </apex:inputcheckbox>
                            <apex:outputLabel value="Other (List Program:)" for="Other"/>
                        </apex:pageBlockSectionItem>
                       
                        <apex:pageBlockSectionItem >
                            <apex:InputField value="{!OSFS_Grad_Student_Supplement__c.Other_Programs__c}"  rendered="{!OSFS_Grad_Student_Supplement__c.Other__c}" />
                        </apex:pageBlockSectionItem>
       
                    </apex:outputPanel>
Jacob W LandisJacob W Landis
Just found out , if I put some value in the required field, and then the rerender part (required field is not in the rerender section) works  for the record creation page as well.  seems like before you put any required field value, the none-required value is not set from page to the controller. very wearid. Anybody know why is that?
Carol VessonCarol Vesson

It seems like the issue might be related to the initial state of the checkbox when creating a new record. Make sure to check if the Other__c field is set to true by default in the record's initial state. This will ensure that the input text is shown when creating a new record. Double-check the default value in your object's schema settings. For more visit : https://bodyly.nl/decaduro-recensie-deca-durabolin-kopen/