Still working on my 3 level nested listgrids. In the code below I am trying to simulate the 'related' mode between the top level 'topic' grid (a.k.a. OnlineAgendaGrid) and the 'issueSubGrid'.
My method:
My problem is in step 2.2. Below is the code.
Below is the end of the developer console. It dumps the currentTopicRecord, which was taken from the current ListGridRecord. Passed to expandRecord it gets TypeError: _6 is undefined.
There is no reflection in the server log. It just shows the last fetch activity.
I'll keep bumping around. Any thoughts on how I am creating this error would be appreciated.
Rick
P.S. I am running SmartClient Version: v8.2p_2013-01-14/EVAL Development Only on Mozilla Firefox 12.0 with Firebug using Windows XP Pro 32 bit.
My method:
Code:
1. populate the topic grid 2. for each topic 2.1 filter my issues for this topic 2.2 create expansion related grid under this topic (issueSubGrid) 2.3 populate issueSubGrid with filtered issues (setData) 3. draw everything
Code:
Log.setPriority("Log", 5); Log.logDebug("**** ProjectIssue version****************** OnlineMeetingButton.Click"); if (!window.OnlineMeetingForm) { var message = "Component ID \"OnlineMeetingForm\", target of action \"Edit rec\" does not exist"; isc.Log.logWarn(message); if (isc.designTime) { isc.say(message); } } OnlineMeetingWindow.autoDraw = false; OnlineMeetingForm.setValue("MeetingName", Application.currentMeetingName); OnlineMeetingForm.setValue("TeleconferenceInfo", Application.currentTeleconferenceInfo); OnlineAgendaGrid.autoDraw = false; OnlineAgendaGrid.canExpandRecords=true; OnlineAgendaGrid.canExpandMultipleRecords=false; OnlineAgendaGrid.expansionMode="related"; OnlineAgendaGrid.childExpansionMode="related"; //OnlineAgendaGrid.detailDS="ProjectIssue"; //OnlineAgendaGrid.expansionRelatedProperties = { autoFetchData:true, autoFetchTextMatchStyle:"exact", canExpandRecords:true, canExpandMultipleRecords:false, detailDS:"IncompleteTask", height:"200", overflow:"visible"}; var issueArray = []; issueArray = ProjectIssue.cacheData; Log.logDebug("************ ProjectIssue.cacheData record count: " + issueArray.length); if (!OnlineAgendaGrid) {Log.logDebug("************ OnlineAgendaGrid is undefined.");} MeetingTopic.fetchData( { "MeetingTypeID" : Application.currentMeetingTypeID }, function (dsResponse, data, dsRequest) { Log.logDebug("************meeting topic records fetched: " + this.echo(dsResponse)); if (dsResponse.status >= 0) { if (dsResponse.totalRows > 0) { OnlineAgendaGrid.setData(data); var totalTopics = dsResponse.totalRows; for (var currentTopicIndex = 0; currentTopicIndex < totalTopics; currentTopicIndex++) { var currentTopicRecord = {}; currentTopicRecord = OnlineAgendaGrid.data[currentTopicIndex]; //var currentTopicMember = OnlineAgendaGrid.getMember(currentTopicIndex); Log.logDebug("************ currentTopicRecord: " + this.echo(currentTopicRecord)); if (currentTopicRecord.SearchEnabled) { var issueCriteria = { }; if (!(typeof currentTopicRecord.IssueTypeID === "undefined")) { issueCriteria.IssueTypeID = String(currentTopicRecord.IssueTypeID); } if (!(typeof currentTopicRecord.CategoryID === "undefined")) { issueCriteria.CategoryID = String(currentTopicRecord.CategoryID) ; } if (!(typeof currentTopicRecord.ImpactID === "undefined")) { issueCriteria.ImpactID = String(currentTopicRecord.ImpactID) ; } var issueResults = ProjectIssue.applyFilter(issueArray, issueCriteria); Log.logDebug("************ ProjectIssue.applyFilter record count: " + issueResults.length + " for " + this.echo(issueCriteria)); var issueCount = issueResults.length; if (issueCount > 0) { Log.logDebug("************ ProjectIssue.applyFilter issueResults[zero]: " + this.echo(issueResults[0])); //Log.logDebug("************ issueResults[zero]: " + this.echo(issueResults[0])); //currentTopicRecord.canExpand(true); Log.logDebug("************ working with currentTopicRecord: " + this.echo(currentTopicRecord)); OnlineAgendaGrid.expandRecord(currentTopicRecord); var issueSubGrid = OnlineAgendaGrid.getExpansionComponent(currentTopicRecord); if (issueSubGrid === null) {Log.logDebug("************ issueSubGrid is null.");} issueSubGrid.canExpandRecords=true; issueSubGrid.canExpandMultipleRecords=false; issueSubGrid.expansionMode="related"; issueSubGrid.setData(issueResults); Log.logDebug("************ issueSubGrid: " + this.echo(issueSubGrid)); for (currentIssueIndex = 0; currentIssueIndex < issueCount; currentIssueIndex++) { var currentIssueRecord = {}; currentIssueRecord = issueResults[currentIssueIndex]; Log.logDebug("************ currentIssueIndex = " + currentIssueIndex + " of " + issueCount); Log.logDebug("************ currentIssueRecord = issueResults[" + currentIssueIndex + "]: " + this.echo(currentIssueRecord)); if (issueArray.remove(currentIssueRecord)) { Log.logDebug("************ IssueNumber: " + currentIssueRecord.IssueNumber + " removed from issueArray"); } else { Log.logDebug("************ Error removing issue: " + this.echo(currentIssueRecord)); } currentIssueGridRecord = issueSubGrid.getRecord(currentIssueIndex); currentIssueGridRecord.detailDS = "IncompleteTask"; } // end for loop } else { Log.logDebug("************ issueCount is zero"); //currentTopicRecord.setProperty("canExpand", false); } // end if issueCount is zero } else { Log.logDebug("************ searchEnabled is false"); // currentTopicRecord.setProperty("canExpand", false); } // end if currentTopicRecord.SearchEnabled } // end for currentTopicIndex Log.logDebug("************ done with all topics. Launching OnlineMeetingWindow"); OnlineMeetingWindow.setTitle("Project:" + Application.currentProjectNumber + " " + Application.currentMeetingName); OnlineMeetingWindow.markForRedraw("grids populated"); OnlineMeetingWindow.show(); } else { Log.logDebug("*********** No meeting topic records fetched for MeetingTypeID: " + Application.currentMeetingTypeID); isc.say("No meeting topic records fetched for MeetingTypeID: " + Application.currentMeetingTypeID); } // end if MeetingTopic.fetchData dsResponse.totalRows > 0 } else { Log.logDebug("*********** Error fetching meeting topic records for MeetingTypeID: " + Application.currentMeetingTypeID); isc.say("Error fetching meeting topic records for MeetingTypeID: " + Application.currentMeetingTypeID); } // end if MeetingTopic.fetchData dsResponse.status >= 0 OnlineMeetingWindow.markForRedraw("grids populated"); Log.logDebug("************ end MeetingTopic.fetchData function"); Log.logDebug("************ OnlineAgendaGrid: " + this.echo(OnlineAgendaGrid)); } // end MeetingTopic.fetchData function ); // end MeetingTopic.fetchData call Log.logDebug("************ done with MeetingTopic.fetchData call"); Log.logDebug("****END***END***END*** OnlineMeetingButton.Click");
Code:
10:44:44.091:TMR6:DEBUG:Log:************ working with currentTopicRecord: {TopicLeaderName: "Vicki Spencer", MeetingTypeID: 101, CommunityID: 101, TopicNumber: 1, MeetingTopicID: 101, ImpactName: "5-Catastrophic", SearchEnabled: true, TopicTitle: "All High Impact Issues", ImpactID: 101, Created: Date(01/30/2013), Modified: Date(07/23/2012), MeetingName: "Weekly Status Meeting", TopicLeaderID: 102, ProjectID: 101} 10:44:44.124:TMR6:WARN:Log:TypeError: _6 is undefined ListGrid.addEmbeddedComponent(_1=>{Obj}, _2=>{Obj}, _3=>0) ListGrid.expandRecord(_1=>{Obj}) unnamed({Obj}, [object Array], {Obj}) [c]Class.fireCallback(_1=>function (dsResponse, data, dsRequest), _2=>"dsResponse,data,dsRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) [c]Class.fireCallback(_1=>function (dsResponse, data, dsRequest), _2=>"dsResponse,data,dsRequest", _3=>[object Array]) DataSource.fireResponseCallbacks({Obj}, {Obj}, {Obj}, {Obj}) DataSource._completeResponseProcessing({Obj}, {Obj}, {Obj}, {Obj}, {Obj}) DataSource._handleClientOnlyReply({Obj}, {Obj}, {Obj}) [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array]) [c]RPCManager.fireReplyCallback(_1=>{Obj}, _2=>{Obj}, _3=>{Obj}, _4=>{Obj}) [c]RPCManager.fireReplyCallbacks(_1=>{Obj}, _2=>{Obj}) [c]RPCManager.performOperationReply(_1=>{Obj}, _2=>{Obj}) RPCManager._performTransactionReply(31) [c]Class.fireCallback(_1=>{Obj}, _2=>undef, _3=>[object Array], _4=>{Obj}, _5=>true) Timer._fireTimeout("$ir561") unnamed() unnamed() @
Code:
=== 2013-02-01 15:44:43,625 [sor2] DEBUG RPCManager - Processing 1 requests. === 2013-02-01 15:44:43,671 [sor2] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ }, operationConfig:{ dataSource:"MeetingTopic", operationType:"fetch" }, appID:"builtinApplication", operation:"MeetingTopic_fetch", oldValues:null } === 2013-02-01 15:44:43,687 [sor2] INFO IDACall - Performing 1 operation(s) === 2013-02-01 15:44:43,687 [sor2] DEBUG AppBase - [builtinApplication.MeetingTopic_fetch] No userTypes defined, allowing an yone access to all operations for this application === 2013-02-01 15:44:43,687 [sor2] DEBUG AppBase - [builtinApplication.MeetingTopic_fetch] No public zero-argument method na med '_MeetingTopic_fetch' found, performing generic datasource operation === 2013-02-01 15:44:43,687 [sor2] INFO SQLDataSource - [builtinApplication.MeetingTopic_fetch] Performing fetch operation with criteria: {} values: {} === 2013-02-01 15:44:43,687 [sor2] INFO SQLWhereClause - [builtinApplication.MeetingTopic_fetch] empty condition === 2013-02-01 15:44:43,687 [sor2] INFO SQLDataSource - [builtinApplication.MeetingTopic_fetch] derived query: SELECT $defa ultSelectClause FROM (MeetingType, MeetingTopic) LEFT JOIN TeamMember ON MeetingTopic.TopicLeaderID = TeamMember.TeamMemberI D LEFT JOIN Category ON MeetingTopic.CategoryID = Category.CategoryID LEFT JOIN IssueType ON MeetingTopic.IssueTypeID = Issu eType.IssueTypeID LEFT JOIN IssueImpact ON MeetingTopic.ImpactID = IssueImpact.ImpactID WHERE MeetingTopic.MeetingTypeID = MeetingType.MeetingTypeID AND ($defaultWhereClause) === 2013-02-01 15:44:43,687 [sor2] INFO SQLDataSource - [builtinApplication.MeetingTopic_fetch] Executing SQL query on 'Pla netProjectDB': SELECT MeetingTopic.CategoryID, Category.CategoryName, MeetingTopic.CommunityID, MeetingTopic.Created, Meetin gTopic.ExpectedResults, MeetingTopic.ImpactID, IssueImpact.ImpactName, MeetingTopic.IssueTypeID, IssueType.IssueTypeName, Me etingType.MeetingName, MeetingTopic.MeetingTopicID, MeetingTopic.MeetingTypeID, MeetingTopic.Modified, MeetingTopic.ProjectI D, MeetingTopic.SearchEnabled, MeetingTopic.SessionTime, MeetingTopic.SessionType, MeetingTopic.TopicLeaderID, TeamMember.Te amMemberName AS TopicLeaderName, MeetingTopic.TopicNumber, MeetingTopic.TopicTitle FROM (MeetingType, MeetingTopic) LEFT JOI N TeamMember ON MeetingTopic.TopicLeaderID = TeamMember.TeamMemberID LEFT JOIN Category ON MeetingTopic.CategoryID = Categor y.CategoryID LEFT JOIN IssueType ON MeetingTopic.IssueTypeID = IssueType.IssueTypeID LEFT JOIN IssueImpact ON MeetingTopic.I mpactID = IssueImpact.ImpactID WHERE MeetingTopic.MeetingTypeID = MeetingType.MeetingTypeID AND (('1'='1')) === 2013-02-01 15:44:43,687 [sor2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.MeetingTopic_fetch] DriverManage r fetching connection for PlanetProjectDB via jdbc url jdbc:mysql://localhost:3306/PUBLIC === 2013-02-01 15:44:43,687 [sor2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.MeetingTopic_fetch] Passing cred entials getConnection separately from JDBC URL === 2013-02-01 15:44:43,703 [sor2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.MeetingTopic_fetch] Returning po oled Connection === 2013-02-01 15:44:43,703 [sor2] DEBUG SQLTransaction - [builtinApplication.MeetingTopic_fetch] Started new PlanetProjectD B transaction "20245200" === 2013-02-01 15:44:43,703 [sor2] INFO SQLDriver - [builtinApplication.MeetingTopic_fetch] Executing SQL query on 'PlanetP rojectDB': SELECT MeetingTopic.CategoryID, Category.CategoryName, MeetingTopic.CommunityID, MeetingTopic.Created, MeetingTop ic.ExpectedResults, MeetingTopic.ImpactID, IssueImpact.ImpactName, MeetingTopic.IssueTypeID, IssueType.IssueTypeName, Meetin gType.MeetingName, MeetingTopic.MeetingTopicID, MeetingTopic.MeetingTypeID, MeetingTopic.Modified, MeetingTopic.ProjectID, M eetingTopic.SearchEnabled, MeetingTopic.SessionTime, MeetingTopic.SessionType, MeetingTopic.TopicLeaderID, TeamMember.TeamMe mberName AS TopicLeaderName, MeetingTopic.TopicNumber, MeetingTopic.TopicTitle FROM (MeetingType, MeetingTopic) LEFT JOIN Te amMember ON MeetingTopic.TopicLeaderID = TeamMember.TeamMemberID LEFT JOIN Category ON MeetingTopic.CategoryID = Category.Ca tegoryID LEFT JOIN IssueType ON MeetingTopic.IssueTypeID = IssueType.IssueTypeID LEFT JOIN IssueImpact ON MeetingTopic.Impac tID = IssueImpact.ImpactID WHERE MeetingTopic.MeetingTypeID = MeetingType.MeetingTypeID AND (('1'='1')) === 2013-02-01 15:44:43,703 [sor2] INFO DSResponse - [builtinApplication.MeetingTopic_fetch] DSResponse: List with 5 items === 2013-02-01 15:44:43,703 [sor2] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8 === 2013-02-01 15:44:43,703 [sor2] DEBUG SQLTransaction - Committing PlanetProjectDB transaction "20245200" === 2013-02-01 15:44:43,718 [sor2] DEBUG RPCManager - non-DMI response, dropExtraFields: false === 2013-02-01 15:44:43,718 [sor2] DEBUG SQLTransaction - Ending PlanetProjectDB transaction "20245200" === 2013-02-01 15:44:43,718 [sor2] INFO Compression - /isomorphic/IDACall: 1784 -> 496 bytes === 2013-02-01 15:44:48,421 [sor5] INFO Download - Returning 304: Not modified on conditional get of: D:\My Websites\Planet Project\isomorphic\skins\SilverWave\images\button\button_Focused_Over_stretch.png === 2013-02-01 15:44:48,421 [sor2] INFO Download - Returning 304: Not modified on conditional get of: D:\My Websites\Planet Project\isomorphic\skins\SilverWave\images\button\button_Focused_Over_start.png === 2013-02-01 15:44:48,421 [or12] INFO Download - Returning 304: Not modified on conditional get of: D:\My Websites\Planet Project\isomorphic\skins\SilverWave\images\button\button_Focused_Over_end.png
Rick
P.S. I am running SmartClient Version: v8.2p_2013-01-14/EVAL Development Only on Mozilla Firefox 12.0 with Firebug using Windows XP Pro 32 bit.
Comment