.java文件中:
public void pageBeginRender(PageEvent event) {
if (getUser()==null) {
getRequestCycle().activate("Home");
}
//
if (!getRequestCycle().isRewinding()){ !!如果这行不注释掉,就会出现这个错误,注释掉这行就可以正常运行,是为什么啊?
List<KhItem> itemList=getKhImpl().getKhTodo(getUser().getUserID());
for(int i=0;i<itemList.size();i++)
itemList.get(i).setOrderNum(i+1);
setTodoList(itemList);
//}
}
在.page文件中;
<property name="todoList" />
<component id="toDoTable" type="contrib:Table">
<binding name="source" value="todoList"/>
<binding name="columns" value="literal:orderNum,khCategaryName,khBegintime,khEndtime,employeeName,todo"/>
<binding name="pageSize" value="30"/>
<binding name="tableSessionStateManager"
value="new org.apache.tapestry.contrib.table.model.common.FullTableSessionStateManager()"/>
</component>
在.html文件中:
<table class="ForrestTable" cellspacing="1" cellpadding="4" jwcid="toDoTable">
<tr><th></th><th></th><th></th><th></th><th></th><th></th></tr>
<tr >
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td jwcid="todoColumnValue@Block" >
<input jwcid="@Submit" listener="listener:khDetail" parameters="ognl:components.toDoTable.tableRow" value="去评 "/>
</td>
</tr>
</table>
错误:
org.apache.hivemind.ApplicationRuntimeException |
Either the tableModel parameter or both source and columns parameters must be specified by component Role/toDoTable.tableView |
Stack Trace: |
- org.apache.tapestry.contrib.table.components.TableView.getTableModel(TableView.java:220)
- org.apache.tapestry.contrib.table.components.TableView.validateValues(TableView.java:465)
- org.apache.tapestry.contrib.table.components.TableView.renderComponent(TableView.java:497)
- $TableView_86.renderComponent($TableView_86.java)
- org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
- org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
- org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
- org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
- org.apache.tapestry.components.IfBean.renderComponent(IfBean.java:86)
- $IfBean_71.renderComponent($IfBean_71.java)
- org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
- org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
- org.apache.tapestry.form.FormSupportImpl.rewind(FormSupportImpl.java:573)
- org.apache.tapestry.form.Form.renderComponent(Form.java:226)
|