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
ANJALIRAJIANJALIRAJI 

Regarding output label

Hi,

I am using picklist field ,by selecting its values some fields are hidden.The code is working fine.

But the problem is with the design.

The Code is:

Output Label = Incident Type

Object Name=Incident_Record__c

Field Name(picklist)=Incident_Type__c}"

 

 

<apex:outputLabel value="Incident Type" for="incident"  />
<apex:actionRegion >
<apex:inputField value="{!Incident_Record__c.Incident_Type__c}" style=""  required="true" id="incident" >
<apex:actionsupport event="onchange" rerender="sec1"/>
</apex:inputfield>
</apex:actionRegion>

 

 

The Output  is:

 

 

Here there is a huge space between Incident Type and the picklist.How to reduce this space ?

sfdcfoxsfdcfox

They are technically two separate fields; you need to group them together as one, or even better, just bind the event to the field itself (there's no reason to go about this method you've gone through:

 

<apex:actionRegion>
  <apex:pageBlockSection>
    <apex:inputField value="{!Incident_Record__c.Incident_Type__c}" required="true">
      <apex:actionSupport event="onchange" reRender="sec1"/>
    </apex:inputField>
  </apex:pageBlockSection>
</apex:actionRegion>

The alternative design to this would be use an apex:pageBlockSectionItem.

ANJALIRAJIANJALIRAJI

 

Hi,

Thanks for your reply.

If I use code like this,the design is coming perfectly.But error is coming,

 

code used:

 

<apex:actionRegion>

<apex:pageBlockSection>
<>

</apex:pageBlockSection>

</apex:actionRegion>

 

The error coming after selecting the picklist value i.e, "all the mandatory field values must be entered".

How to fix this problem?