Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sergio Ramazzina
Doubts about using model hints
September 9, 2012 11:40 PM
Answer

Sergio Ramazzina

Rank: New Member

Posts: 6

Join Date: June 8, 2011

Recent Posts

Hi all,

I'm new to Liferay and I need some help to understand why some things seems not to work. I'm developing a series of portlets and I'm trying to use model hints to set the width of text input fields or to set the width and height of some texarea fields. I carefully read this blog http://tinyurl.com/d7rhlgk that explains how to set all these things but my portlet form fields seems not to understand these settings. Am I missing something? I've also tried to go through the source of the site portlet where the textarea fiels that contains the description of the site has width and height set the same way but I don not understand why mine seems unaware of these settings and sets the textarea size to default.

Here it is the code I put in portlet-model-hints.xml

 1   
 2                  <field name="name" type="String">
 3            <hint name="max-length">64</hint>
 4            <validator name="required" />
 5        </field>
 6        <field name="description" type="String">
 7            <hint name="max-length">255</hint>
 8            <hint name="display-height">105</hint>
 9            <hint name="display-width">500</hint>
10        </field>


Other question anyone can explain me how does work the <validator name="required" /> tag?

Thanks a lot for the support

Sergio
Rewati Raman
RE: Doubts about using model hints
September 10, 2012 12:24 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

Hi Sergio Ramazzina,
1   <field name="name" type="String">
2            <hint name="max-length">64</hint>
3            <validator name="required" />
4        </field>


i hope atleast above code is working properly because i tried and its cjhnaging the size of string

Regards,
Rewati Raman
Harish Kumar
RE: Doubts about using model hints
September 10, 2012 12:25 AM
Answer

Harish Kumar

Rank: Expert

Posts: 472

Join Date: July 31, 2010

Recent Posts

I've replied regarding the same in this thread
Mazhar Alam
RE: Doubts about using model hints
September 10, 2012 12:37 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 201

Join Date: November 25, 2011

Recent Posts

What exactly do you need..in which you are facing probs..?
Check you are building the service again after modifying the model-hints.
ensure that it reflects in your Sql folder..

Thanks
Sergio Ramazzina
RE: Doubts about using model hints
September 10, 2012 9:43 PM
Answer

Sergio Ramazzina

Rank: New Member

Posts: 6

Join Date: June 8, 2011

Recent Posts

Sorry if I explained my problem uncorrectly. The hint

1
2           <hint name="max-length">64</hint>


worked properly changing the size of the varchar field as required in the generated table SQL. The hints that didn't worked were

1
2            <hint name="display-height">105</hint>
3            <hint name="display-width">500</hint>


that changed the displayed size of the input control in the generated portlet. But I found the why. I was using it with the aui taglib instead of
the liferay-ui. The thing that I don't understand is that if I look at the code of the site admin portlet for example it uses the same hints to set the size of a
textarea box but using the aui taglib. So why is it working there and not on my portlet? What am I missing?

Regards

Sergio
suneel kumar
RE: Doubts about using model hints
September 15, 2015 9:47 PM
Answer

suneel kumar

Rank: New Member

Posts: 14

Join Date: September 14, 2015

Recent Posts

how to work with custom portlet for permissions??
David H Nebinger
RE: Doubts about using model hints
September 15, 2015 10:13 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11113

Join Date: September 1, 2006

Recent Posts

What does custom portlet permissions have to do with model hints?

Have you checked dev.liferay.com where there are learning paths for resource and portlet permissions?
suneel kumar
Change title bar and icon
November 11, 2015 9:18 PM
Answer

suneel kumar

Rank: New Member

Posts: 14

Join Date: September 14, 2015

Recent Posts

Hi how to change title bar and icon using theme in liferay

i have to change the controll panel title bar .
when i click the controll panel in new tab it should dispaly "xxxx" title . how to do it
anybody help me