内容简介:翻译自:https://stackoverflow.com/questions/3933921/generating-commented-out-content-with-wicket
注释中.
输出将是……
<!-- <div wicket:id="foo"> 1234 </div> -->
…其中“1234”是一些有趣的,动态创建的信息.
我试过,但无济于事:
><! -<div wicket:id =“foo”></ div> – > →Wicket抱怨HTML页面中缺少id为“foo”的元素
>封闭在<wicket:remove> →此类部分不能包含带wicket的元素:id
> label.setVisible(false)→Wicket根本不输出标签
> new Label(“foo”,“<! - ”foo“ - >”)→ 逃脱和>
那么,你可以用Wicket(轻松)做到这一点,还是我应该忘掉它?
这个怎么样?
class CommentOutModifier extends AbstractBehavior {
private static final long serialVersionUID = 1L;
@Override
public void beforeRender(Component component) {
component.getResponse().write("<!--");
}
@Override
public void onRendered(Component component) {
component.getResponse().write("-->");
}
}
add(new Label("tohide", "Hi, can you see me?").add(new CommentOutModifier()));
然后,放:
<span wicket:id="tohide"></span>
在您的标记中将产生:
<!--<span>Hi, can you see me?</span>-->
翻译自:https://stackoverflow.com/questions/3933921/generating-commented-out-content-with-wicket
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Data Structures and Algorithms in Java
Michael T. Goodrich、Roberto Tamassia / Wiley / 2010-01-26 / USD 177.41
* This newest edition examines fundamental data structures by following a consistent object-oriented framework that builds intuition and analysis skills of data structures and algorithms * Presents ne......一起来看看 《Data Structures and Algorithms in Java》 这本书的介绍吧!