Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I faced an issue with <apex:inputText> while using disabled attribute with it.

The scenario is i can disable and enable the <apex:inputText> using a checkbox.

<apex:inputText> is binded with an Integer variable.

But when i enable the


i get error : element value must resolve to a String type!

I tried these workarounds given in this post apex:inputText disabled binding causing "element value must resolve to a String type!"

But the above workarounds changes the appearance , the goal is not achievable.

When i tried binding <apex:inputText> with String , the functionality worked fine , however now i have to make use of Integer.valueOf(myStringVariable) everywhere i need to do calculations in my code.

I just want to know the reason behind this error element value must resolve to a String type!

Why this doesn't work with integer value.

share|improve this question
up vote 7 down vote accepted

This looks to be a bug in Visualforce - its been around since 2008 by the look of this post on the Developerforce Discussion Boards:

The best I've been able to do with this is to have the underlying property still stored as an Integer, but have a string based getter/setter for it that converts to/from a string. That way I can use the property as an Integer within my code and I just have to convert it once.

You'll need an answer from Salesforce as to why it works this way - given that people have been complaining about this behaviour for nearly 6 years, it feels like they might think its working correctly. Although Doug Chasman does suggest its a bug in the developerforce post above.

share|improve this answer

BTW, immediate="true" fix this problem for me.

share|improve this answer

Use outputText instead of disabled:

<apex:outputText id="test1" value="{!item.Number}" rendered="{!item.isallowed}"/>

This worked for me. Hope this is helpful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.