我已经考虑了一段时间 - 没有得到一个好主意.
这就是问题.我将不得不在文本框中或作为输出文本显示文本.如何在JSF中使用布尔变量来执行此操作?
我不想做一个h:inputText和disable/make只读,它基于布尔值,我想显示一个干净的标签或输出文本.
建议?
我正在使用没有tomahawk和其他库的JSF Myfaces Impl 1.2:
我使用不同的样式+图像来显示JSF错误消息,在下面找到一个示例.
<h:panelGroup rendered="${adminBean.showErrorIcon==2}">
<table width="375" align="center" class="InfoMsg" border="1"
cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="375" align="center" class="InfoMsg" border="0">
<tr>
<td width="50"><img src="static/images/info_icon.gif"
width="40" height="40" border="0" /></td>
<td width="325" align="left"><h:messages layout="table"
errorClass="InfoMsg" /></td>
</tr>
</table>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
基于Backing Bean的int变量,我在屏幕上显示差异图像和相应的FacesMessage - 只有2个案例 - 错误或信息.
我使用下面的代码来设置Backing Bean的变量
//Checking if there are messages!
log.debug("Checking if there are messages to be shown ]");
if(getShowErrorIcon()==99){//Set only if the value is still the default :
log.debug("getShowErrorIcon was DEFAULT - Changing it ]");
Iterator<FacesMessage> …Run Code Online (Sandbox Code Playgroud) 如果我在一个表单中有许多输入控件(这些输入控件中的每一个都有单独的验证器 - 如所需、长度等),则有一个命令按钮可以提交表单并调用操作方法。要求是 - 尽管输入控件值是,比如说,单独可以 - 这些值的组合应该可以在表单提交后一起处理它们 - 我在哪里放置代码来一起验证它们?
1) 我可以为命令按钮添加自定义验证器并一起验证组合吗?喜欢 validate(FacesContext arg0, UIComponent arg1, Object value)但即便如此,除了命令按钮/组件的值之外,我也不会拥有其他输入控件的值,对吗?
2) 我可以在 action 方法中验证组合并使用FacesMessage?
或者您有其他建议吗?
谢谢你的时间。
当Apache My Faces JSF 1.2实现在幕后呈现HTML页面时,甚至可以设置/编码将有条件地显示纯HTML表/ DIV(而不是jsf组件)的东西.当我搜索时,我看到了,使用h:panelGroup是一个解决方案,但我还没有尝试过,在这里发布任何更好的方法或方法.
它几乎想要说 - 在java中编写一个javascript代码并在呈现HTML时注入它 - 是否可能?
谢谢,
我试图像下面那样增加堆大小
C:\Data\Guru\Code\Got\adminservice\adminservice>java -Xms512m -Xmx512m
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and …Run Code Online (Sandbox Code Playgroud) 我正在使用JSF 1.2 - My Faces Implementation.我有一个表单,我使用h:inputText来显示几个值.有2个输入框不应编辑但显示给用户,并应在提交单击时提交给服务器.我试过readonly ="true"和disabled ="true",两者都没有解决目的!有什么建议?