I'm trying to use 'lazy' model initialization (with hibernate on the back)
for the t:dataTable with detailToggle, so that when I click 'Show Orders',
the actionListener would call methot which retrieves all necessary records
(I'm following the example on http://www.irian.at/myfaces/home.jsf):
<t:dataTable value="#{customers.list}"
id="data"
var="customer"
varDetailToggler="detailToggler"
preserveDataModel="true"
styleClass="customers"
headerClass="customersHeader" columnClasses="custid,name">
.....columns here and in one column this:
<h:commandLink rendered="#{!detailToggler.currentDetailExpanded}"
actionListener="#{customers.showOrders}"
action="#{detailToggler.toggleDetail}">
<h:outputText value="Show Orders" />
</h:commandLink>
... then a similar link with "Hide Orders"
... then <f:facet name="detailStamp"> with inner dataTable for details
customers Bean:
public void showOrders(ActionEvent e) {
UIComponent c = e.getComponent();
log.debug("showOrders : " + c.getId());
Customer row = list.get(getIndex(c));
if (row.getCustomerOrder() == null)
getOrders(row);
}
It seems that the custom tag requires detailes being initialized right away.
I see hibernate error in stack trace saying that it's trying to initialize
orders, when the session is already closed.
1. Am I missing some attribute that may be specified to help the matter????
2. In my commandLink I've added actionListener when action was already
specified, is it a valid technique??? All I need - call my bean to populate
model with required details some time early in the lifecycle prior to
executing "detailToggler.toggleDetail". Well, w/o resolving the first issue
I can't start playing with the second.
thanks
vlad
--
View this message in context:
http://www.nabble.com/Tomahawk%3A-dataTable-with-detailToggle-problem-tf3997193.html#a11352179
Sent from the MyFaces - Users mailing list archive at Nabble.com.