Fórum

Unable to Set width of text fields in <liferay-ui:input-field> tag

suresh midde, modificado 14 Anos atrás.

Unable to Set width of text fields in <liferay-ui:input-field> tag

Junior Member Postagens: 47 Data de Entrada: 03/12/08 Postagens Recentes
Hi,

I have tried placing

<default-hints>
<hint name="display-width">150</hint>
</default-hints>

inside my ext-model-hints.xml to set the width of the fields when I use <liferay-ui:input-text> tag, like this

<model name="com.ext.portlet.student.model.Student">

<default-hints>
<hint name="display-width">150</hint>
</default-hints>
<field name="sid" type="long" />
<field name="regNo" type="String" />
<field name="userId" type="long" />
</model>

But "default-hints" tag is getting disappeared once I do, "build-service" , I think this file we should not edit manually, There must be somewhere this is configured and autogenerated.

Can anyone have idea on this?

Regards
Suresh Midde
Ivo Ivanov, modificado 13 Anos atrás.

RE: Unable to Set width of text fields in <liferay-ui:input-field> ta

New Member Postagens: 4 Data de Entrada: 28/07/10 Postagens Recentes
You should use the cssStyle attribute to specify a class name:

<liferay-ui:input-field ... cssStyle="my-style-with-custom-width" />


Then in that class set the width as important:

.my-style-with-custom-width {
width: 300px !important;
}

simple emoticon