我目前正在将应用程序从 JSF 1.2 和 Richfaces 3.3 升级到 JSF 2 和 Richfaces 4。
我在使用 JSF2 的新h:outputStylesheet组件让我的应用程序包含样式表时遇到问题
这是我的旧代码:
<a4j:loadStyle src="resource:///com/testing/test/html/css/style.xcss" />
Run Code Online (Sandbox Code Playgroud)
这是我的新代码(不起作用):
<h:outputStylesheet library="resource:///com/testing/test/html/css/" name="style.xcss" />
Run Code Online (Sandbox Code Playgroud)
我尝试过各种变体,但没有一个有效。使用 firebugs css 选项卡时,我收到一条消息,提示 RES_NOT_FOUND。
有任何想法吗?
谢谢
我正在使用 myfaces ExtensionFilter 上传文件,但该文件未设置到我的 bean 中以供进一步处理。
这是代码:
<h:form id="uploadFileForm" enctype="multipart/form-data">
<tom:inputFileUpload id="file"
value="#{paramUpload.uploadFile}">
<f:valueChangeListener type="com.bosch.de.plcd.plugin.ParamFileUpload" />
</tom:inputFileUpload>
<a4j:commandButton value="#{tpMsgs.upload}"
styleClass="button" action="#{paramUpload.uploadParamFile}"
onclick="javascript:updateParentScreen();">
</a4j:commandButton>
</h:form>
Run Code Online (Sandbox Code Playgroud)
web.xml配置如下
<filter>
<filter-name>Extensions Filter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Extensions Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
Run Code Online (Sandbox Code Playgroud)
由于UploadFile没有设置为 bean,我也尝试使用 ValueChangeListener,尽管如此,它不是 bean :)
豆码
public class ParamFileUpload implements ValueChangeListener {
private UploadedFile uploadFile;
public void uploadParamFile() {
if(uploadFile != null) {
LOGGER.info("File type: " + uploadFile.getContentType());
LOGGER.info("File name: " + uploadFile.getName());
LOGGER.info("File size: " + uploadFile.getSize() + " bytes");
} …Run Code Online (Sandbox Code Playgroud) 我在创建富有问题时遇到了问题:我做了如下组合框
<rich:comboBox selectFirstOnUpdate="false" defaultLabel="Enter some value">
<f:selectItems value="#{userregister.selectItems}" />
</rich:comboBox>
Run Code Online (Sandbox Code Playgroud)
在支持bean中,我创建了selectItems,如下所示
List<UISelectItem> selectItems;
UISelectItem uisi = new UISelectItem();
uisi.setItemLabel("label");
uisi.setValue("value");
selectItems.add(uisi);
Run Code Online (Sandbox Code Playgroud)
但我得到的异常是javax.servlet.ServletException: Value of tag <selectItems> attribute is incorrect.哪种正确的方法来创建具有动态值的组合框?
我的问题是RichFaces reRender不能在元素树中的当前元素下"工作"; 只有上层元素才会被重新渲染.
有没有办法用AJAX访问下层元素?
任何帮助,将不胜感激!丹尼尔
编辑我把这个问题编辑成更普遍的问题.如果对原始问题感兴趣,请参阅修订版.
我们有一个建立在seam/richfaces上的系统.这个网页是从动态上下文(来自多个不同的数据源,每个都使用不同的布局来表示基本相同的真实世界概念)呈现的.结果,这个表被绑定到一个bean,它的列/布局是从这个bean生成的.
现在我需要在特定列上添加命令链接,相当于
<a4j:commandLink value="#{actBean.Ids}" action="#{actBean.genDetails}">
<f:setPropertyActionListener target="#{actBean.Ref}" value="#{cont}"/>
</a4j:commandLink>
Run Code Online (Sandbox Code Playgroud)
在JSF页面中.
该表绑定到托管bean
HtmlDataTable dataTable = new HtmlDataTable();
HtmlColumn column = new Column();
//some code to setup column name, value etcs
dataTable.getChildren().add(column);
//What do I do here to bind a commandlink with a property action
//listener to column?
Run Code Online (Sandbox Code Playgroud)
我的问题是,我该如何以编程方式执行此操作?
谢谢!
richfaces(3.3.3.CR1)支持哪种版本的jquery.怎么找到它?
我面临与此处描述的相同的问题Rich modalpanel会自动关闭
我正在使用richfaces 3.3.0(包含在接缝2.12中).我试图找出问题所在,Firebug显示在modalpanel出现后,会生成对服务器的请求.面板在几毫秒后关闭.我为rich_modalPanel标签(在窗体外部)中的几个位置进行了多处理.
有任何想法吗?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a="http://richfaces.org/a4j"
xmlns:s="http://jboss.com/products/seam/taglib">
<head />
<body id="pgHome">
<f:view>
<div id="document">
<h:form id="login">
<fieldset>
<h:outputLabel id="UsernameLabel" for="username">Login Name</h:outputLabel>
<h:inputText id="username" value="#{identity.username}" style="width: 175px;" />
</fieldset>
<h:commandButton id="search2" value="modal"
onclick="#{rich:component('mp')}.show()" />
</h:form>
<rich:modalPanel id="mp" height="200" width="500">
<f:facet name="header">
<h:outputText value="Modal Panel Title" />
</f:facet>
</rich:modalPanel>
</div>
</f:view>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
编辑:
我终于使用了这个例子:
<rich:modalPanel id="modalPanelID">
<f:facet name="header">
<h:outputText value="header" />
</f:facet>
<a onclick="Richfaces.hideModalPanel('modalPanelID');" href="#">Hide</a>
</rich:modalPanel> …Run Code Online (Sandbox Code Playgroud) 我正在使用带有richfaces的JSF开发简单的应用程序.我想上传文件夹(仅限选择文件夹).
我试过,t:inputFileUpload和rich:fileUpload.
但这两个组件都只是支持文件.不支持选择文件夹.
可以选择文件夹.
帮我.提前致谢
我正在尝试使用richfaces日历设置宽度style="width:60px",但它不起作用.
<rich:calendar id="givenDate" name="givenDate"
enableManualInput="true" style="width:60px"
datePattern="MM/dd/yyyy" value="#{shotController.adminDate}"
immediate = "true" required="true"
requiredMessage="#{msg.requiredmsg}" popup="true" />
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?
是否可以(并且合理)在一个项目中将JSF与richfaces和bootstrap CSS样式结合使用.所以使用richfaces进行页面渲染,UI模型和ajax; 将样式留给bootstrap和自定义CSS.
有人试过这个吗?这是一种超大的方法吗?