我正在使用JSF2.1.
是什么beetween的区别execute="@form",并this.submit()在下面的代码?
<f:ajax execute="@form" render="@form"/>
Run Code Online (Sandbox Code Playgroud)
和:
<h:form onkeypress="if (event.keyCode == 13) this.submit();">
Run Code Online (Sandbox Code Playgroud)
前者似乎提交值并重新呈现表单,而后者则导致页面刷新.当在表单中按下回车键时,有没有办法使用ajax?我正在尝试检测inputText框中按下的回车键.我尝试过这样的事情:
<h:inputText value="#{a.name}" >
<f:ajax execute="@this" />
</h:inputText>
Run Code Online (Sandbox Code Playgroud)
但这只会导致在您点击其他内容时提交值(在valueChange之后).
有什么方法可以将curl输出重定向到while循环吗?
while read l; do
echo 123 $l;
done < curl 'URL'
Run Code Online (Sandbox Code Playgroud)
还是有更好的方法来做到这一点?我只需要阅读页面的内容,并在每行之前添加一些内容,然后将其保存到文件中即可。
这合法吗?
<h:form id="status${a.myID}" >
// ...
</h:form>
Run Code Online (Sandbox Code Playgroud)
其中“ a”是备用bean中的对象。似乎有些工作,但是当我查看呈现的HTML时,我看到的id为::0:status例如,而不是:status0我期望的那样。我的主要问题是尝试引用中的ID <f:ajax render=...。我几乎可以想到的每个组合都包含“包含未知ID ...”。是否可以可靠地使用来自支持bean的值来设置id?