0

Size of the multiline TextBox [closed]

asked 2020-05-29 18:31:44 +0800

v552 gravatar image v552
1

Is it possible to get height/width on the server side (Java code) after resizing TextBox by dragging the stretch symbol on the right side on bottom of the textbox?

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by cor3000
close date 2020-06-04 11:35:16

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-06-02 17:27:50 +0800

cor3000 gravatar image cor3000
6280 2 7

yes it is, at least in modern browsers (non IE) there's a dedicated web API (ResizeObserver) to observe changes of resizable elements such as textareas.

In ZK it can be initialized/cleaned up using the client side API (during onBind/onUnbind), and custom events can be fired to the server side (widget.fire())

https://www.zkoss.org/javadoc/latest/jsdoc/zk/Widget.html#fire-global.String-zk.Object-global.Map-int-

The example below shows this in a simple case. To reduce the number of events fired it uses the duplicatIgnore option.

https://zkfiddle.org/sample/1qms0np/1-observe-textbox-resize

link publish delete flag offensive edit
0

answered 2020-06-03 12:49:46 +0800

v552 gravatar image v552
1

Great thanks! I tried ResizeObserver and it really works for me!

link publish delete flag offensive edit

Comments

great, thanks for getting back

cor3000 ( 2020-06-04 11:34:55 +0800 )edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2020-05-29 18:31:44 +0800

Seen: 13 times

Last updated: Jun 03 '20

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More