File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ ( function ( XtlSnippet , undefined ) {
2+ const setXtlExpressionVisibility = ( executionContext ) => {
3+ const context = executionContext . getFormContext ( ) ;
4+
5+ const isPlainText = context . getAttribute ( "oss_containsplaintext" ) . getValue ( ) ;
6+ const isHtml = context . getAttribute ( "oss_ishtml" ) . getValue ( ) ;
7+
8+ const showRichTextControl = isPlainText && isHtml ;
9+
10+ context . getControl ( "oss_xtlexpression" ) . setVisible ( ! showRichTextControl ) ;
11+ context . getControl ( "oss_xtlexpression1" ) . setVisible ( showRichTextControl ) ;
12+ } ;
13+
14+ const setIsHtmlVisibility = ( executionContext ) => {
15+ const context = executionContext . getFormContext ( ) ;
16+
17+ const isPlainText = context . getAttribute ( "oss_containsplaintext" ) . getValue ( ) ;
18+
19+ context . getControl ( "oss_ishtml" ) . setVisible ( isPlainText ) ;
20+ } ;
21+
22+
23+ XtlSnippet . onLoad = ( executionContext ) => {
24+ const context = executionContext . getFormContext ( ) ;
25+
26+ context . getAttribute ( "oss_containsplaintext" ) . addOnChange ( setXtlExpressionVisibility ) ;
27+ context . getAttribute ( "oss_containsplaintext" ) . addOnChange ( setIsHtmlVisibility ) ;
28+ context . getAttribute ( "oss_ishtml" ) . addOnChange ( setXtlExpressionVisibility ) ;
29+
30+ setXtlExpressionVisibility ( executionContext ) ;
31+ setIsHtmlVisibility ( executionContext ) ;
32+ } ;
33+
34+ } ) ( window . XtlSnippet = window . XtlSnippet || { } ) ;
You can’t perform that action at this time.
0 commit comments