如何將新行添加到列表末尾的extendedDataTable?有一些解決方案嗎?RICH:dataTable - 添加新行
JSF表例如:
你能幫助我嗎?
UPDATE:
我可以在使用例如豐富的添加新項:popupPanel,但不是在數據表中創建一個新的行。我想說的是,我可以保存但不像使用BalusCs JSF guide那樣優雅。 XHTML的
部分:BEAN的
<rich:extendedDataTable
id="tableDetail"
value="#{myBdeCheck.dataListBde}"
var="bdeItem">
<rich:column width="80px">
<f:facet name="header">
<h:outputText value="Směna" />
</f:facet>
<h:outputText value="#{bdeItem.dayShift}"/>
</rich:column>
<rich:column width="70px">
<f:facet name="header">
<h:outputText value="Karta" />
</f:facet>
<h:outputText value="#{bdeItem.bdeno}"/>
</rich:column>
部分: 包常見;
@ViewScoped
@ManagedBean(name="myBdeCheck")
public class MyBdeCheck extends Tools
{
/**/
private static final long serialVersionUID = -6586004426692130933L;
private Session session;
private List<BDE> dataListBde; //= new ArrayList<BDE>();
private int currentIndexDetail; // index for BDEDetail datatable
private BDECheckView editedWork; // one item of BdeCheckView
private BDE BDEItem; // one item of BdeData
// Constructor
public MyBdeCheck()
{
editedWork = new BDECheckView();
BDEItem = new BDE();
}
/** GET DATA FROM BDEData *******************
* @param personalNum, dayShift [whole day: YYYY-MM-DD%]
*/
private void criteriaCheck()
{
try
{
Criteria criteria = session.createCriteria(BDE.class);
{some restrictions}
dataListBde = criteria.list();
}
catch (Exception e) {...}
}
public void saveBde()
{
try
{
DaoCrud.update(dataListBde, 'R'); // ulozeni do dtb
}
catch {...}
}
public void saveNew() {...}
// and GETTERS AND SETTERS
}
什麼RichFaces的/ JSF的版本? – 2011-05-18 12:48:37
JSF 2,RichFaces 4 ... – gaffcz 2011-05-18 12:51:17
你可以添加一個新元素到支持dataTable的集合然後reRender組件嗎? – 2011-05-18 13:02:13