這幾天一直在用Richfaces, 現在使用的是3.3的版本,碰到不少問題,先一條條記錄下來,以后逐步完善:
1.rich:scrollableDataTable 在Firefox中不能顯示標題,這是richefaces的一個bug,還沒有解決,只能暫時使用rich:extendedDataTable來代替以達到scrollalbe效果。
2.richfaces所帶的drag-and-drop在jboss部署時可能碰到問題,需要將jboss-service.xml 中的UseJBossWebLoader設置為true。否則都會出現Method not found錯誤,提示找不到dropListener方法。 參考: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4032847#4032847
3.使用rich:modalPanel時,如果要在彈出的panel中使用表單功能,一定要確保兩點:
(1)<rich:modalPanel> 一定要放在主頁面中form的外部。
(2)在<rich:modalPanel>中要包含自己的form。
4.當你遇到 Property 'xxxx' not found on type org.javassist.tmp.java.lang.Object 時,請查看一下是否已經將該變量的setter和getter方法在local interface中定義。如果沒有定義將會報類似這樣的錯誤。
5.要使用richfaces,頁面最好使用facelet實現。
6.在使用各個組件時,如果要在外圍加div或panel,id一定注意最好不要用‘XXXContainer’,因為richfaces默認將一些組件解析成html的時候會加一些id類似這樣的層。例如:
<rich:panel id="abcContainer" style="display:none;" rendered="true">
<rich:modalPanel id="abc">
afdsasdfs
</rich:modalPanel>
</rich:panel>
這種情況下,這個modalPanel就不會顯示出來,而是在原頁面出現一個空框。原因就是richfaces自動生成一個id也為 abcContainer的層,跟外圍的panel的id相同,所以modalPanle中的東西沒有顯示,只是將原來的panel顯示出來了。
7.使用<a4j:status>時,如果一個頁面內有多個status組件,就可能報錯: “duplicate Id for a component _viewRoot“。
解決方法,將status組件的forceId設置為true. 例如:
<a4j:status forceId="true" id="xxStatus">
xxx
</a4j:status>
8.Property 'XXX' not found on type org.jboss.seam.jsf.ListDataModel.當使用一個DataModel時,如果引用其中的屬性,可能會報這個錯誤。我是在使 用rich:tree的時候碰到這個問題的,但使用DataModel時,如果在tree里面因為節點的子屬性就會報這個錯誤。
解決方法:將@DataModel改為@Out(required=false)并將對應的數據集合設置為一個@Factory.
1.rich:scrollableDataTable 在Firefox中不能顯示標題,這是richefaces的一個bug,還沒有解決,只能暫時使用rich:extendedDataTable來代替以達到scrollalbe效果。
2.richfaces所帶的drag-and-drop在jboss部署時可能碰到問題,需要將jboss-service.xml 中的UseJBossWebLoader設置為true。否則都會出現Method not found錯誤,提示找不到dropListener方法。 參考: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4032847#4032847
3.使用rich:modalPanel時,如果要在彈出的panel中使用表單功能,一定要確保兩點:
(1)<rich:modalPanel> 一定要放在主頁面中form的外部。
(2)在<rich:modalPanel>中要包含自己的form。
4.當你遇到 Property 'xxxx' not found on type org.javassist.tmp.java.lang.Object 時,請查看一下是否已經將該變量的setter和getter方法在local interface中定義。如果沒有定義將會報類似這樣的錯誤。
5.要使用richfaces,頁面最好使用facelet實現。
6.在使用各個組件時,如果要在外圍加div或panel,id一定注意最好不要用‘XXXContainer’,因為richfaces默認將一些組件解析成html的時候會加一些id類似這樣的層。例如:
<rich:panel id="abcContainer" style="display:none;" rendered="true">
<rich:modalPanel id="abc">
afdsasdfs
</rich:modalPanel>
</rich:panel>
這種情況下,這個modalPanel就不會顯示出來,而是在原頁面出現一個空框。原因就是richfaces自動生成一個id也為 abcContainer的層,跟外圍的panel的id相同,所以modalPanle中的東西沒有顯示,只是將原來的panel顯示出來了。
7.使用<a4j:status>時,如果一個頁面內有多個status組件,就可能報錯: “duplicate Id for a component _viewRoot“。
解決方法,將status組件的forceId設置為true. 例如:
<a4j:status forceId="true" id="xxStatus">
xxx
</a4j:status>
8.Property 'XXX' not found on type org.jboss.seam.jsf.ListDataModel.當使用一個DataModel時,如果引用其中的屬性,可能會報這個錯誤。我是在使 用rich:tree的時候碰到這個問題的,但使用DataModel時,如果在tree里面因為節點的子屬性就會報這個錯誤。
解決方法:將@DataModel改為@Out(required=false)并將對應的數據集合設置為一個@Factory.