触摸UI对话框中的defaultValue-AEM / CQ [英] defaultValue in Touch UI dialogs - AEM/CQ

查看:68
本文介绍了触摸UI对话框中的defaultValue-AEM / CQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于经典UI,有一个选项可以为字段设置 defaultValue ,这是在用户首次拖动组件后打开对话框时向用户显示的。如果用户清除对话框中的值并保存,则在编辑对话框时,字段的值不会再次显示。

For classic UI there is a option to set defaultValue for fields, this is shown to user when user first time opens the dialog after dragging the component. If user clears the value in dialog and saves, on editing the dialog, value of field is not shown again.

对于触摸UI对话框,找不到与之等效的值。 defaultValue 。有以下选项

For touch UI dialog, couldn't find the equivalent of defaultValue. There are following options


  1. emptyText -但这是一种占位符文本。如果用户要保存表单而不输入值,则没有用。

  2. -这是第一次输入值时显示的值开放创作。但是如果用户清除值并保存。从JCR结构中删除该值。但是,如果用户打开对话框进行编辑,则该值会再次显示在字段中,但该字段应为空。

  1. emptyText - But this is kind of placeholder text. If user wants to save form without entering value, this is not useful.
  2. value - This shows the value when first time component is opened for authoring. But if user clears the value and saves. From the JCR structure the value is removed. But if user opens the dialog for editing, the value is again shown in the field, while this should be empty.

如果存在等效于 defaultValue 的触摸界面对话框或其他任何处理方式(可能是侦听器或其他方法)

If there a equivalent of defaultValue in touch UI dialog or any other way of handling this (may be listeners or something else)

推荐答案

而不是使用 defaultValue value ,我觉得您应该使用 cq:template 节点。您可以通过在组件下添加 cq:template 名称的 nt:unstructured 类型的节点来实现。像这样:

Instead of using defaultValue or value, I feel like you should be using cq:template node. You can achieve this by adding nt:unstructured type of node with cq:template name under the component. Like this:

_cq_template / .content.xml

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0"
    xmlns:jcr="http://www.jcp.org/jcr/1.0"
    xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="nt:unstructured"
    sampleProperty="Default value of sampe property">

这篇关于触摸UI对话框中的defaultValue-AEM / CQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆