You need to sign in to do that
Don't have an account?
Error: Cannot coerce '100%' to class java.lang.Integer - when using Apex scontrol tag
The Apex Pages component reference for 'scontrol' states for the 'Width' Integer attribute:
For the moment I'm setting my width attribute to px but a percentage for width would be ideal.
The width of the inline frame that should display the s-control, expressed either as a percentage of the total available horizontal space (for example width="80%"), or as the number of pixels (for example, width="600px").When I attempt to set width="100%" I recieve the following error:
Error: Cannot coerce '100%' to class java.lang.IntegerEither the documentation is wrong or the conversion behind the scenes is not taking into account percentages.
For the moment I'm setting my width attribute to px but a percentage for width would be ideal.
Percentage values for <apex:scontrol width> is supported in a rather bizarre (and incorrectly documented) way currently - if you specify a negative integer value it will be interpreted as the absolute value expressed as a percent. For example:
will result in the generated iframe element with a width="100%" attribute.
No support for percentage height is planned at this time.