Hi Ilya,
unfortunatly switching from t:datatable to rich:datatable is not an option.
I have also found this in the log files.
Case of working link:
2009-01-28 13:20:47,828 DEBUG JaHi [org.apache.myfaces.webapp.MyFacesServlet::service(102)] MyFacesServlet service start
2009-01-28 13:20:47,828 DEBUG JaHi [javax.faces.webapp.FacesServlet::service(146)] service begin
2009-01-28 13:20:47,828 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(89)] entering RESTORE_VIEW(1) in org.apache.myfaces.lifecycle.LifecycleImpl
2009-01-28 13:20:47,828 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::beforePhase(102)] Process before phase RESTORE_VIEW(1)
2009-01-28 13:20:47,828 DEBUG JaHi [org.apache.myfaces.lifecycle.DefaultRestoreViewSupport::calculateViewId(111)] Calculated viewId '/organization.jsf' from request servlet path
2009-01-28 13:20:47,828 DEBUG JaHi [org.apache.myfaces.lifecycle.RestoreViewExecutor::execute(83)] Request is a postback
2009-01-28 13:20:47,828 DEBUG JaHi [org.apache.myfaces.application.DefaultViewHandlerSupport::applyDefaultSuffix(213)] view id after applying the context suffix: /organization.xhtml
2009-01-28 13:20:47,828 DEBUG JaHi [apache.myfaces.shared_impl.util.StateUtils::findAlgorithm(464)] Using algorithm DES
2009-01-28 13:20:47,828 DEBUG JaHi [apache.myfaces.shared_impl.util.StateUtils::findAlgorithmParams(437)] Using algorithm paramaters ECB/PKCS5Padding
2009-01-28 13:20:47,828 DEBUG JaHi [apache.myfaces.shared_impl.util.StateUtils::symmetric(366)] decrypting w/ DES/ECB/PKCS5Padding
2009-01-28 13:20:47,828 DEBUG JaHi [org.ajax4jsf.application.AjaxStateHolder::getInstance(49)] Request for a view states holder instance
2009-01-28 13:20:47,828 DEBUG JaHi [org.richfaces.component.UIComponentControl::setParent(135)] Called setParent for AjaxSupport component with parent : javax.faces.component.html.HtmlPanelGroup
2009-01-28 13:20:47,828 DEBUG JaHi [org.richfaces.component.UIComponentControl::setParent(144)] Detect newly created component
2009-01-28 13:20:47,828 DEBUG JaHi [org.ajax4jsf.component.AjaxRegionBrige::restoreState(243)] Restore State of UIAjaxComponent with Id _viewRoot
2009-01-28 13:20:47,844 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::afterPhase(69)] Process after phase RESTORE_VIEW(1)
2009-01-28 13:20:47,844 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(118)] exiting RESTORE_VIEW(1) in org.apache.myfaces.lifecycle.LifecycleImpl
2009-01-28 13:20:47,844 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(89)] entering APPLY_REQUEST_VALUES(2) in org.apache.myfaces.lifecycle.LifecycleImpl
2009-01-28 13:20:47,844 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::beforePhase(102)] Process before phase APPLY_REQUEST_VALUES(2)
2009-01-28 13:20:47,844 DEBUG JaHi [org.ajax4jsf.renderkit.RendererBase::decode(71)] Start decoding of component _viewRoot with class org.ajax4jsf.component.AjaxViewRoot
2009-01-28 13:20:47,844 DEBUG JaHi [org.ajax4jsf.renderkit.AjaxContainerRenderer::doDecode(150)] Decode ajax request status for _viewRoot
2009-01-28 13:20:47,844 DEBUG JaHi [org.ajax4jsf.component.AjaxRegionBrige::setSubmitted(188)] Submitted AJAX request - Queue Event to AjaxListeners
2009-01-28 13:20:52,485 DEBUG JaHi [org.ajax4jsf.renderkit.RendererBase::decode(71)] Start decoding of component customersForm:bupas:2:a4j-selectDetails with class org.ajax4jsf.component.html.HtmlAjaxCommandLink
2009-01-28 13:20:52,485 DEBUG JaHi [org.ajax4jsf.renderkit.AjaxCommandRendererBase::isSubmitted(133)] Decode submit of the Ajax component customersForm:bupas:2:a4j-selectDetails
2009-01-28 13:20:52,485 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::afterPhase(69)] Process after phase APPLY_REQUEST_VALUES(2)
2009-01-28 13:20:52,485 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(118)] exiting APPLY_REQUEST_VALUES(2) in org.apache.myfaces.lifecycle.LifecycleImpl
Case or broken Link:
2009-01-28 13:22:25,237 DEBUG JaHi [org.apache.myfaces.webapp.MyFacesServlet::service(102)] MyFacesServlet service start
2009-01-28 13:22:25,237 DEBUG JaHi [javax.faces.webapp.FacesServlet::service(146)] service begin
2009-01-28 13:22:25,237 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(89)] entering RESTORE_VIEW(1) in org.apache.myfaces.lifecycle.LifecycleImpl
2009-01-28 13:22:25,237 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::beforePhase(102)] Process before phase RESTORE_VIEW(1)
2009-01-28 13:22:25,253 DEBUG JaHi [org.apache.myfaces.lifecycle.DefaultRestoreViewSupport::calculateViewId(111)] Calculated viewId '/organization.jsf' from request servlet path
2009-01-28 13:22:25,253 DEBUG JaHi [org.apache.myfaces.lifecycle.RestoreViewExecutor::execute(83)] Request is a postback
2009-01-28 13:22:25,253 DEBUG JaHi [org.apache.myfaces.application.DefaultViewHandlerSupport::applyDefaultSuffix(213)] view id after applying the context suffix: /organization.xhtml
2009-01-28 13:22:25,253 DEBUG JaHi [apache.myfaces.shared_impl.util.StateUtils::findAlgorithm(464)] Using algorithm DES
2009-01-28 13:22:25,253 DEBUG JaHi [apache.myfaces.shared_impl.util.StateUtils::findAlgorithmParams(437)] Using algorithm paramaters ECB/PKCS5Padding
2009-01-28 13:22:25,253 DEBUG JaHi [apache.myfaces.shared_impl.util.StateUtils::symmetric(366)] decrypting w/ DES/ECB/PKCS5Padding
2009-01-28 13:22:25,253 DEBUG JaHi [org.ajax4jsf.application.AjaxStateHolder::getInstance(49)] Request for a view states holder instance
2009-01-28 13:22:25,253 DEBUG JaHi [org.richfaces.component.UIComponentControl::setParent(135)] Called setParent for AjaxSupport component with parent : javax.faces.component.html.HtmlPanelGroup
2009-01-28 13:22:25,253 DEBUG JaHi [org.richfaces.component.UIComponentControl::setParent(144)] Detect newly created component
2009-01-28 13:22:25,253 DEBUG JaHi [org.ajax4jsf.component.AjaxRegionBrige::restoreState(243)] Restore State of UIAjaxComponent with Id _viewRoot
2009-01-28 13:22:25,253 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::afterPhase(69)] Process after phase RESTORE_VIEW(1)
2009-01-28 13:22:25,253 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(118)] exiting RESTORE_VIEW(1) in org.apache.myfaces.lifecycle.LifecycleImpl
2009-01-28 13:22:25,253 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(89)] entering APPLY_REQUEST_VALUES(2) in org.apache.myfaces.lifecycle.LifecycleImpl
2009-01-28 13:22:25,253 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::beforePhase(102)] Process before phase APPLY_REQUEST_VALUES(2)
2009-01-28 13:22:25,253 DEBUG JaHi [org.ajax4jsf.renderkit.RendererBase::decode(71)] Start decoding of component _viewRoot with class org.ajax4jsf.component.AjaxViewRoot
2009-01-28 13:22:25,253 DEBUG JaHi [org.ajax4jsf.renderkit.AjaxContainerRenderer::doDecode(150)] Decode ajax request status for _viewRoot
2009-01-28 13:22:25,253 DEBUG JaHi [org.ajax4jsf.component.AjaxRegionBrige::setSubmitted(188)] Submitted AJAX request - Queue Event to AjaxListeners
2009-01-28 13:22:33,534 DEBUG JaHi [org.ajax4jsf.event.AjaxPhaseListener::afterPhase(69)] Process after phase APPLY_REQUEST_VALUES(2)
2009-01-28 13:22:33,534 DEBUG JaHi [org.apache.myfaces.lifecycle.LifecycleImpl::executePhase(118)] exiting APPLY_REQUEST_VALUES(2) in org.apache.myfaces.lifecycle.LifecycleImpl
also using a modified version of
javax.faces.component (see code below) shows, that the application gets confused with the ids.
I've added this method at line 147 in the
invokeOnComponent method
public boolean invokeOnComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback) throws javax.faces.FacesException
{
//java.lang.NullPointerException - if any of the arguments are null
if(context == null || clientId == null || callback == null)
{
throw new NullPointerException();
}
//searching for this component?
showMeWhatsGoingOn(clientId, this.getClientId(context)); //<- inserted by me
boolean found = clientId.equals(this.getClientId(context));
if(found)
{
try
{
callback.invokeContextCallback(context, this);
} catch(Exception e)
{
throw new FacesException(e);
}
return found;
}
//Searching for this component's children/facets
for (Iterator<UIComponent> it = this.getFacetsAndChildren(); !found && it.hasNext();){
found = it.next().invokeOnComponent(context, clientId, callback);
}
return found;
}
private void showMeWhatsGoingOn(String paramClientId, String contextClientId) {
// TODO Auto-generated method stub
try {
FileWriter writer = new FileWriter("C:\\test-jsf.log", true);
writer.append(paramClientId + ", " + contextClientId + "\n");
writer.flush();
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
This code produces the following log (in the real application):
NOT working:
customersForm:bupas:1:a4j-selectDetails, customersForm:bupas:2:j_id81
customersForm:bupas:1:a4j-selectDetails, customersForm:bupas:j_id82
customersForm:bupas:1:a4j-selectDetails, customersForm:bupas:j_id83
customersForm:bupas:1:a4j-selectDetails, customersForm:bupas:2:a4j-selectDetails <-- searching for the wrong one!!
customersForm:bupas:1:a4j-selectDetails, customersForm:bupas:2:j_id84
customersForm:bupas:1:a4j-selectDetails, customersForm:bupas:2:j_id85
customersForm
working:
customersForm:bupas:15:a4j-selectDetails, customersForm:bupas:15:j_id81
customersForm:bupas:15:a4j-selectDetails, customersForm:bupas:j_id82
customersForm:bupas:15:a4j-selectDetails, customersForm:bupas:j_id83
customersForm:bupas:15:a4j-selectDetails, customersForm:bupas:15:a4j-selectDetails <-- founr the right one
customersForm:bupas:15:a4j-selectDetails, _viewRoot