You need to sign in to do that
Don't have an account?
Sangeet 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-
I want description should take in 1 column and others took 2.
Regards,
Sangeet
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-
I want description should take in 1 column and others took 2.
Regards,
Sangeet
Sangeet kasera
Anyone Please help me to resolve my issue.