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
SFDCRKSFDCRK 

Same Issue, any solution yet?

I am hit with the same issue? any solution for this yet please let me know. Thanks in advance.
 
-RK
SFDCRKSFDCRK

sorry, this is the issue.

 

Error: Cannot coerce '100%' to class java.lang.Integer - when using Apex scontrol tag
Options  Options 
manu
Regular Contributor
Posts: 23


manu

Message 1 of 1

Viewed 5009 times


The Apex Pages component reference for 'scontrol' states for the 'Width' Integer attribute:
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.Integer
Either 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.
01-16-2008 01:05 AM

All Users' Tags:

dchasmandchasman
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:

Code:
<apex:scontrol width="-100">

will result in the generated iframe element with a width="100%" attribute.

No support for percentage height is planned at this time.

SFDCRKSFDCRK
Thanks!