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
DannyK89DannyK89 

Field Sets Questions

So I am kind of new to field sets. I have put them in my visualforce page but I have a question. 

 

I have some Long Text Area fields in my field set and when I render them on the page inside of <apex:inputField> tag they are really small. I was wondering is there a way to resize these fields? I ask because I have multiple fields with different field types in the field set and I don't think changing the style of the <apex:inputField> tag will help me much.

Best Answer chosen by Admin (Salesforce Developers) 
Devendra NataniDevendra Natani

Hello,

 

You can use the following code to solve your problem.

 

<apex:repeat value="{!$ObjectType.Account.FieldSets.AccountFieldset}" var="fs" >  
      <apex:inputField value="{!a[fs]}" required="{!fs.required}" rendered="{!CONTAINS(LOWER(fs) , LOWER('Name')) }"/> 
      <apex:inputField value="{!a[fs]}" required="{!fs.required}" style="width:500px" rendered="{!NOT(CONTAINS(LOWER(fs) , LOWER('Name')) )}"/> 
</apex:repeat>

In the above code I have used fieldset of Account object and reffered the "name" field in rendered property of input field. You can use the Long text area field api name instead of "name" field. 

 

You can also use the apex:inputtextarea control instead of input field. 

 

Please let me know if there is any issue.

 

 

 

 

 

All Answers

kiranmutturukiranmutturu

wwhy can't u use <apex:inputtextarea> in this scenario to bind the text area field

Devendra NataniDevendra Natani

Hello,

 

You can use the following code to solve your problem.

 

<apex:repeat value="{!$ObjectType.Account.FieldSets.AccountFieldset}" var="fs" >  
      <apex:inputField value="{!a[fs]}" required="{!fs.required}" rendered="{!CONTAINS(LOWER(fs) , LOWER('Name')) }"/> 
      <apex:inputField value="{!a[fs]}" required="{!fs.required}" style="width:500px" rendered="{!NOT(CONTAINS(LOWER(fs) , LOWER('Name')) )}"/> 
</apex:repeat>

In the above code I have used fieldset of Account object and reffered the "name" field in rendered property of input field. You can use the Long text area field api name instead of "name" field. 

 

You can also use the apex:inputtextarea control instead of input field. 

 

Please let me know if there is any issue.

 

 

 

 

 

This was selected as the best answer