-
1. Re: reRender the latest record in datatable
nbelaevski Dec 25, 2009 5:07 PM (in response to chun)Hi Stephen,
Page code looks ok, please check if getAdminRecordList() method returns updated data when table is re-rendered.
-
2. Re: reRender the latest record in datatable
chun Dec 25, 2009 9:16 PM (in response to nbelaevski)Hi Nick,
Thanks for your confirmation and reply.
I tried to print the records in the console, it shows the records are latest, but seems it couldn't reflect on the screen
public void doFilter() {
this.adminRecordList=null;
adminRecordList=this.getAdminRecordList();
for(int i=0; i<adminRecordList.size(); i++) {
System.out.println("Record" + i+ ": " + adminRecordList.get(i)); // print it inside console
}
} -
3. Re: reRender the latest record in datatable
nbelaevski Dec 27, 2009 3:47 PM (in response to chun)Please add a4j:log component to the page, press the button calling "doFilter()" action and post logger ourtput here. -
4. Re: reRender the latest record in datatable
chun Dec 27, 2009 10:36 PM (in response to nbelaevski)Hi Nick,
I got a finding by try-and-error. If I changed the scope from SESSION to CONVERSATION, it works...
I'm quite confused, coz an example in SEAM reference said:
The @DataModel annotation exposes an attibute of type java.util.List to the JSF page
as an instance of javax.faces.model.DataModel. This allows us to use the list in a JSF
<h:dataTable> with clickable links for each row. In this case, the DataModel is made
available in a session context variable named messageList.Why only CONVERSATION work? Actaully, I don't think my application needs to carry conversational state, so I tried to escape from it.\
Do I have some misunderstandings?
Anyway, I've still printouted the logs "a4j:log" for your reference:
Originally, it shows some error messages which are related to ModalPanels
debug[10:25:22,070]: search for elements by name 'script' in element spandebug[10:25:22,070]: Scripts in updated part count : 9debug[10:25:22,070]: Update part of page for Id: recordListPanel successfuldebug[10:25:22,070]: call selectSingleNode for id= ajax-view-statedebug[10:25:22,070]: Hidden JSF state fields:debug[10:25:22,070]: Namespace for hidden view-state input fields is undefineddebug[10:25:22,070]: search for elements by name 'input' in element spandebug[10:25:22,070]: Replace value for inputs: 22 by new values: 1debug[10:25:22,070]: Input in response: javax.faces.ViewStatedebug[10:25:22,070]: Found same input on page with type: hiddendebug[10:25:22,070]: Found same input on page with type: hiddendebug[10:25:22,070]: Found same input on page with type: hiddendebug[10:25:22,070]: search for elements by name 'INPUT' in element spandebug[10:25:22,070]: Replace value for inputs: 22 by new values: 0debug[10:25:22,070]: call selectSingleNode for id= _A4J.AJAX.focusdebug[10:25:22,070]: No focus information in responsedebug[10:25:22,211]: Evaluate script replaced area in document: //new Richfaces.Datascroller('editRecordListForm:sdpList:ds', function(event){if (function(event){Richfaces.showModalPanel('ProgressModalPanel',{param1:'Please wait...'}); return true;}(event)) {A4J.AJAX.Submit('editRecordListForm',event,{'ignoreDupResponses':true,'implicitEventsQueue':'editRecordListForm:sdpList:ds','oncomplete':function(request,event,data){Richfaces.hideModalPanel('ProgressModalPanel')},'similarityGroupingId':'editRecordListForm:sdpList:ds','parameters':{'editRecordListForm:sdpList:ds':event.memo.page,'ajaxSingle':'editRecordListForm:sdpList:ds'} } ); return false;}});//debug[10:25:22,211]: Script evaluation succeededdebug[10:25:22,211]: Evaluate script replaced area in document: //LOG.LEVEL = LOG.ALL;//debug[10:25:22,211]: Script evaluation succeededdebug[10:25:22,211]: Evaluate script replaced area in document: // function panelRevokeMesasge(messagevalue1, messagevalue2, messagevalue3) { document.getElementById('form2:message1').innerHTML=messagevalue1; document.getElementById('form2:message2').innerHTML=messagevalue2; document.getElementById('form2:message3').innerHTML=messagevalue3; } function panelSaveMesasge(messagevalue) { document.getElementById('form2:progressStatus').innerHTML=messagevalue; } function panelMesasge(messagevalue) { document.getElementById('form2:progressStatus2').innerHTML=messagevalue; } //debug[10:25:22,211]: Script evaluation succeededdebug[10:25:22,211]: Evaluate script replaced area in document: //new ModalPanel('form2:ProgressModalPanel', { width: 300, height: 150, minWidth: -1, minHeight: -1, resizeable: true, moveable: true, left: "auto", top: "auto", zindex: 100,onresize: '',onmove: '',onshow: function(event){javascript:panelSaveMesasge(event.parameters.param1)},onhide: '',onbeforeshow: '',onbeforehide: '', domElementAttachment: "", keepVisualState: false, showWhenRendered: false, selectBehavior: "disable", autosized: false, overlapEmbedObjects: false});//debug[10:25:22,227]: Script evaluation succeededdebug[10:25:22,227]: Evaluate script replaced area in document:error[10:25:22,227]: . Error message: 不正確的引數。(In english: invalid index)debug[10:25:22,227]: Evaluate script replaced area in document: //new ModalPanel('form2:rejectDlg', { width: 300, height: 150, minWidth: -1, minHeight: -1, resizeable: true, moveable: true, left: "auto", top: "auto", zindex: 100,onresize: '',onmove: '',onshow: function(event){javascript:panelMesasge(event.parameters.param1)},onhide: '',onbeforeshow: '',onbeforehide: '', domElementAttachment: "", keepVisualState: false, showWhenRendered: false, selectBehavior: "disable", autosized: false, overlapEmbedObjects: false});//debug[10:25:22,242]: Script evaluation succeededdebug[10:25:22,242]: Evaluate script replaced area in document:error[10:25:22,242]: . Error message: 不正確的引數。(In english: invalid index)debug[10:25:22,242]: Evaluate script replaced area in document: //new ModalPanel('form2:revokeDlg', { width: 300, height: 150, minWidth: -1, minHeight: -1, resizeable: true, moveable: true, left: "auto", top: "auto", zindex: 100,onresize: '',onmove: '',onshow: function(event){javascript:panelRevokeMesasge(event.parameters.param1, event.parameters.param2, event.parameters.param3)},onhide: '',onbeforeshow: '',onbeforehide: '', domElementAttachment: "", keepVisualState: false, showWhenRendered: false, selectBehavior: "disable", autosized: false, overlapEmbedObjects: false});//debug[10:25:22,258]: Script evaluation succeededdebug[10:25:22,258]: Evaluate script replaced area in document:error[10:25:22,258]: . Error message: 不正確的引數。(In english: invalid index)debug[10:25:22,258]: call selectSingleNode for id= org.ajax4jsf.oncompletedebug[10:25:22,258]: Call request oncomplete function after processing updatesdebug[10:25:22,305]: call selectSingleNode for id= _ajax:dataAfterward, I removed all ModalPanel in the xhtml, but the most updated record still CAN'T be reflected
debug[10:19:47,494]: search for elements by name 'script' in element spandebug[10:19:47,494]: Scripts in updated part count : 2debug[10:19:47,494]: Update part of page for Id: recordListPanel successfuldebug[10:19:47,494]: call selectSingleNode for id= ajax-view-statedebug[10:19:47,494]: Hidden JSF state fields:debug[10:19:47,509]: Namespace for hidden view-state input fields is undefineddebug[10:19:47,509]: search for elements by name 'input' in element spandebug[10:19:47,509]: Replace value for inputs: 11 by new values: 1debug[10:19:47,509]: Input in response: javax.faces.ViewStatedebug[10:19:47,509]: Found same input on page with type: hiddendebug[10:19:47,509]: Found same input on page with type: hiddendebug[10:19:47,509]: search for elements by name 'INPUT' in element spandebug[10:19:47,509]: Replace value for inputs: 11 by new values: 0debug[10:19:47,509]: call selectSingleNode for id= _A4J.AJAX.focusdebug[10:19:47,509]: No focus information in responsedebug[10:19:47,556]: Evaluate script replaced area in document: //new Richfaces.Datascroller('editRecordListForm:sdpList:ds', function(event){A4J.AJAX.Submit('editRecordListForm',event,{'ignoreDupResponses':true,'implicitEventsQueue':'editRecordListForm:sdpList:ds','similarityGroupingId':'editRecordListForm:sdpList:ds','parameters':{'editRecordListForm:sdpList:ds':event.memo.page,'ajaxSingle':'editRecordListForm:sdpList:ds'} } ); return false;});//debug[10:19:47,556]: Script evaluation succeededdebug[10:19:47,556]: Evaluate script replaced area in document: //LOG.LEVEL = LOG.ALL;//debug[10:19:47,556]: Script evaluation succeededdebug[10:19:47,556]: call selectSingleNode for id= org.ajax4jsf.oncompletedebug[10:19:47,556]: Processing updates finished, no oncomplete function to call -
5. Re: reRender the latest record in datatable
chun Dec 28, 2009 1:17 AM (in response to chun)Hi Nick,
Thanks for your kindly help... finally, i solved my stupid question. I believe ajax throws exception while I interrupt the value of DataModel, after erase the "set null"(as below), it works expectedly. However, can you tell me it works in CONVERSATION scope in the same case?
public void doFilter() {
this.adminRecordList=null;
adminRecordList=this.getAdminRecordList();
}