You need to sign in to do that
Don't have an account?
Rerendered Inputfield Label Not Displaying (VF)
Hello,
I am trying have an inputfield render based upon what a user selects on another picklist field. The new field is rendering, but blank with no label. Here is the code I have so far..I am missing something simple?
<apex:pageBlockSection columns="3" title="What is this?">
<apex:inputField value="{!Bug_Enhancement__c.Request_Status__c}"/>
<apex:inputField value="{!Bug_Enhancement__c.Update_Existing_or_New_Article__c}" label="Is this a New Article or Update to an Existing?">
<apex:actionSupport event="onchange" reRender="updateinfo"/>
</apex:inputField>
<apex:outputPanel id="updateinfo">
<apex:inputField value="{!Bug_Enhancement__c.Article_Number__c}" label="Article Number?" rendered="{!Bug_Enhancement__c.Update_Existing_or_New_Article__c =='Update'}"/>
</apex:outputPanel>
</apex:pageBlockSection>
<apex:pageBlockSection title="What categories should we tag this article in?" >
</apex:pageBlockSection>
</apex:actionRegion>
I am trying have an inputfield render based upon what a user selects on another picklist field. The new field is rendering, but blank with no label. Here is the code I have so far..I am missing something simple?
<apex:pageBlockSection columns="3" title="What is this?">
<apex:inputField value="{!Bug_Enhancement__c.Request_Status__c}"/>
<apex:inputField value="{!Bug_Enhancement__c.Update_Existing_or_New_Article__c}" label="Is this a New Article or Update to an Existing?">
<apex:actionSupport event="onchange" reRender="updateinfo"/>
</apex:inputField>
<apex:outputPanel id="updateinfo">
<apex:inputField value="{!Bug_Enhancement__c.Article_Number__c}" label="Article Number?" rendered="{!Bug_Enhancement__c.Update_Existing_or_New_Article__c =='Update'}"/>
</apex:outputPanel>
</apex:pageBlockSection>
<apex:pageBlockSection title="What categories should we tag this article in?" >
</apex:pageBlockSection>
</apex:actionRegion>
<apex:outputPanel id="updateinfo" rendered="{!Bug_Enhancement__c.Update_Existing_or_New_Article__c =='Update'}">
<apex:inputField value="{!Bug_Enhancement__c.Article_Number__c}" label="Article Number?" />
</apex:outputPanel>
Let me know if this works..
If this helps,please mark it as best answer to help others :)
1) Sonam - I tried that and when I do that, nothing at all renders.
2) Vinit - That will work but I do not want to put this in a new section, I want to keep the new field to be rendered in the same section. Are you saying that is not possible and I will NEED to create a new section to correctly render this field?
George
As far as I know,outputpanel has issues with actionsupport rerender attribute and it manipulates with the Label styling.
So,that's why I suggested you to put it inside another apex:pageBlockSection ,you can also try with apex:pageBlockSectionItem,I have not tried with it and let me know if that works.
<apex:outputPanel id="updateinfo">
<apex:outputPanel id="updateinfo2">
<apex:inputField value="{!Bug_Enhancement__c.Article_Number__c}" label="Article Number?" rendered="{!Bug_Enhancement__c.Update_Existing_or_New_Article__c =='Update'}"/>
</apex:outputPanel>
</apex:outputPanel>
Unfortunately both suggestions produce the same result as I was previously experiencing, where the label is not rerendering. As always I appreciate the feedback though and i'll keep plugging.
George
it's works near perfectly (just a little left margin) to add a pageBlockSection inside the outputPanel
Cheers