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
Sangeet kaseraSangeet kasera 

How to add condition in a column based on field type in PageBlockSection?

I just want to display a column baesd on field type, If field type is textarea ar RichTextArea then i want 1 column otherwise i want 2.
I fetched the data in apex to differentiate a fieldType. AnyOne please help me to implement it in pageBlockSection

Apex Code-
 result = new List<String>();
    String query = 'Select Id ';
    for(string fieldset : objectFields.keySet()) {  
        if(selectedCaseSummaryFields.contains(fieldset.toLowercase())){
            Schema.SObjectField fieldSearch = objectFields.get(fieldset);
            Schema.DescribeFieldResult fieldDescribe = fieldSearch.getDescribe();
            if(fieldDescribe.getType() == Schema.DisplayType.TextArea) {
            result.add(fieldDescribe.getLabel());
        }
        caseSummaryFields.Add(fieldset);
        }    
         if(fieldset != 'Id') query += ',' +fieldset;
    }
    System.debug('result' + result);

Visualforce Code-
 <!-- Case Summary Section Starts --> 
  <apex:pageBlockSection title="Summary" columns="2" >
      <apex:repeat value="{!caseSummaryFields}" var="f">
          <apex:outputField value="{!workingCase[f]}" />
      </apex:repeat>
  </apex:pageBlockSection>

Current View-
User-added imageI want description should take in 1 column and others took 2.

Regards,
Sangeet
 
Sangeet kaseraSangeet kasera
Anyone Please help me to resolve my issue.