Textarea defaults to autogrow=false in PFM, why?

UI Components for JSF
Post Reply
jobor
Posts: 33
Joined: 19 Dec 2011, 22:34
Location: the Netherlands

01 Nov 2014, 00:04

Hello,

I do have a mobile page for entering tekst in just 1 textarea field. The textarea did not grow larger by entering CR/LF as in the examples JQuery Mobile. I tried the all the attributes of p:inputTextarea. You can see this also on the PFM demo pages. I discoverd that PFM is setting the InputTextarea configuration autogrow to false (this.cfg.autogrow=false;) during the initialization.

Does anybody know the reason why this is done?

I succeeded to change the behaviour of the textarea to autogrow by adding the small initialization PrimeFaces Mobile JavaScript to my page.
After PFM has done the initialization this code replaces the PrimeFaces.widget.InputTextarea with the definition this.cfg.autogrow=true;
So after this is done JQuery Mobile is able to add autogrow functionality to the textarea field. And now I have this nice field without scrollbar. And I don't have to worry about the height.

Code: Select all

<ui:define name="page-script">
	<script>
		PrimeFaces.widget.InputTextarea=PrimeFaces.widget.BaseWidget.extend(
			{init: function(a) {
				this._super(a);
				this.cfg.enhanced=true;
				this.cfg.autogrow=true;
				this.jq.textinput(this.cfg);
			}
		});
	</script>
</ui:define>
But maybe there is a good reason why this.cfg.autogrow is set to false?

Gr. Johan Borchers
With regards,
Johan Borchers

Mac OS X 10.15.7
NetBeans 12.3
OpenJDK Zulu11.37
JSF Mojarra 2.3.14
PrimeFaces 10.0.0
Tomcat 9.0.43
MySQL 5.6.x

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

02 Nov 2014, 14:04

Good question. I recognized that there were issues with (PrimeFaces Mobile 5.x) p:inputTextarea, so I am just using h:inputTextarea instead.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests