Tbeditor"

From Documentation
m ((via JWB))
m (correct highlight (via JWB))
Line 30: Line 30:
  
 
We create a map while key is property name with reasonable value.
 
We create a map while key is property name with reasonable value.
Note that we have to wrap the value into <tt>JavaScriptValue</tt> object if it's not String.  
+
Note that we have to wrap the value into <code>JavaScriptValue</code> object if it's not String.  
  
 
<blockquote>
 
<blockquote>
Line 43: Line 43:
 
! <center>Event Type</center>
 
! <center>Event Type</center>
 
|-
 
|-
| <center><tt>onChange</tt></center>
+
| <center><code>onChange</code></center>
 
| <javadoc>org.zkoss.zk.ui.event.InputEvent</javadoc>
 
| <javadoc>org.zkoss.zk.ui.event.InputEvent</javadoc>
  
<tt>'''Description:''' </tt> Denotes the content of an input component has been modified by the user.
+
<code>'''Description:''' </code> Denotes the content of an input component has been modified by the user.
  
 
|-
 
|-
| <center><tt>onChanging</tt></center>
+
| <center><code>onChanging</code></center>
 
| <javadoc>org.zkoss.zk.ui.event.InputEvent</javadoc>
 
| <javadoc>org.zkoss.zk.ui.event.InputEvent</javadoc>
  
<tt>'''Description:''' </tt> Denotes that user is changing the content of an input component. Notice that the component's content (at the server) won't be changed until <tt>onChange</tt> is received. Thus, you have to invoke the <tt>getValue </tt>method in the <tt>InputEvent </tt>class to retrieve the temporary value.
+
<code>'''Description:''' </code> Denotes that user is changing the content of an input component. Notice that the component's content (at the server) won't be changed until <code>onChange</code> is received. Thus, you have to invoke the <code>getValue </code>method in the <code>InputEvent </code>class to retrieve the temporary value.
 
|}
 
|}
  

Revision as of 09:24, 18 January 2022

Tbeditor

  • Java API: N/A
  • JavaScript API: N/A

Employment/Purpose

The component used to represent Trumbowyg

Tbeditor is a rich text editor to be used inside web pages. It's a WYSIWYG editor, which means that the text being edited on it looks as similar as possible to the results users have when publishing it.

Example

Zkcompref tbeditor.png

<tbeditor id="tb" value="this is a demo for &lt;b&gt;trumbowy&lt;/b&gt; editor!!" />

Customized Properties

Tbeditor provides a way for users to customize their own properties, check official document for the detail[1]. Here shows a simple example how to programmatic change the property.

Map config = new HashMap();
config.put("btns", new JavaScriptValue("['bold', 'italic', '|', 'link']"));
config.put("closable", true);
tb.setConfig(config);

We create a map while key is property name with reasonable value. Note that we have to wrap the value into JavaScriptValue object if it's not String.


  1. Not support all properties, for example, localization, custom skin, are not supported.

Supported Events

Name
Event Type
onChange
InputEvent

Description: Denotes the content of an input component has been modified by the user.

onChanging
InputEvent

Description: Denotes that user is changing the content of an input component. Notice that the component's content (at the server) won't be changed until onChange is received. Thus, you have to invoke the getValue method in the InputEvent class to retrieve the temporary value.

Supported Children

*NONE

Use Cases

Version Description Example Location
     

Version History

Last Update : 2022/01/18


Version Date Content
     



Last Update : 2022/01/18

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.