首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >什么是f: jelly中的optionalBlock

什么是f: jelly中的optionalBlock
EN

Stack Overflow用户
提问于 2018-05-28 15:39:55
回答 1查看 414关注 0票数 0

我看过一个包含f:optional块的jelly文件

代码语言:javascript
复制
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler">
    <j:choose>
        <j:when test="${instance == null}">
            <f:entry title="${%File}" field="file">
                <input type="file" name="file" size="40" jsonAware="yes"/>
            </f:entry>
        </j:when>
        <j:otherwise>
            <f:invisibleEntry>
                <f:textbox field="fileName"/>
            </f:invisibleEntry>
            <f:invisibleEntry>
                <f:textbox field="secretBytes"/>
            </f:invisibleEntry>
            <f:optionalBlock title="${%upload(instance.fileName)}" inline="true">
                <f:entry title="${%File}" field="file">
                    <input type="file" name="file" size="40" jsonAware="yes"/>
                </f:entry>
            </f:optionalBlock>
        </j:otherwise>
    </j:choose>
    <st:include page="id-and-description" class="${descriptor.clazz}"/>
</j:jelly>

可选块在这里做什么,我的意思是它在这里的意义是什么?

EN

回答 1

Stack Overflow用户

发布于 2018-09-28 12:55:38

Jelly代码可以在内部转换为简单的HTML和JavaScript代码。<f:optionalBlock>块用于显示复选框。单击此复选框时,复选框内的字段将显示在UI上。在您的示例中,文件参数将显示在UI上。我们可以使用<f:optional>块的inlinechecked属性

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50561396

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档