How to set width to InputText in ADF
Solution 1
Set the contentStyle
Example: contentStyle="width:240px;"
(Setting inlineStyle only adds CSS to the wrapper span - which is an inline style, so cannot set a width.)
It's also worth setting simple="true"
to remove other styling emitted by the control.
Solution 2
If you are using ADF BC then by default the width will be the number of character in your database, for instance if you have VARCHAR2(255) then your text box will have 255 columns.
2 Ways you can solve this:
- From the Entity Object, Select an Attribute and in UI Hints and change the width to suite the number of characters you want - 70 seems good width.
- From the page itself, change columns attribute of inputText to whatever you want - Still 70 should look ok
Solution 3
You don't give the data source, but assuming it is coming from a VO via a Data Control, Find the VO that is the basis for it, and select the attribute and change its display width property in the UI hints area.
If not a VO, then indicate the source of the data for further help.
avalagne
Updated on June 17, 2022Comments
-
avalagne almost 2 years
I have ADF application, which is a film database. I have a big problem with settings ADF component af:inputText.
I tried a lot of different width settings of the various components, but I always failed.
There are pictures...
You do not know how to do it please? Thank you.