Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020324
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminorhave not tried2012-04-23 00:512012-05-13 20:51
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in Version3.0MP12
StatusclosedFix in branchpiFixed in SCM revision.
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Merge Request Status
Review Assigned To
OBNetwork customerNo
Web browser
ModulesCore
Support ticket
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0020324: [SC Upgrade] click on column header does not change sorting

DescriptionWhen clicking multiple times on a column header then the sorting is not changed from asc to desc or vice versa.
This only seems to happen for foreign key columns.

Changing the sort direction through the column header context menu works.
Steps To Reproduce1) goto sales order window
2) header tab
3) click several times on the business partner column header
4) notice that the first time the sorting is done, but after that the sort direction does not change
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0048050)
mtaal (viewer)
2012-04-26 17:15

Analysis by David:



I have debugged it and I found why it crashes, but not been able to fix it. I am going to explain you my progress just to avoid you the initial pain:

The problem is in Smartclient isomorphic/client/widgets/ListGrid.js in function "setSort"
I am going to focus in "Sales Order" -> "Organization" column

There is a "sortSpecifiers" array. For this case, the first time you click the column, "sortSpecifiers.property" is "organization" and the next times is "organization$_identifier"

With this, at line 35516 it does a
  field = this.getUnderlyingField(item.property), --> item.property ==== sortSpecifiers.property for this particular column, so "organization$_identifier" the second time you click it

This "getUnderlyingField" tries to get a
item = isc.Class.getArrayItem(fieldId, this.fields, this.fieldIdProperty);
being "fieldIdProperty" === "name" (string).
Since "name" in the column array is just "organization" it doesn't return anything, because we are passing "organization$_identifier", so the previous said "field" variable is null

Then, it uses this "field" value inside an if statement to do more things.

Until here, the behavior is the same in Smartclient 8.1 and 8.3. In both cases the second click has a null "field" variable value. The point is that this "setSort" column in 8.1 continues doing another things with the "sortSpecifiers" and at the end it obtains the correct result.

In 8.3, after the if statement involving the "field" variable, in line 35573 it does
  this._sortSpecifiers = newSpecifiers;
and this "newSpecifiers" is obtained inside the "field" if statement, so from here, in 8.3, "this._sortSpecifiers" is null and it can not obtain things.

If you just replace this line with "this._sortSpecifiers = sortSpecifiers || [];", what is at the end what has been done in 8.1 (although in this case it is being done some lines before), the thing works ok.


So the "easy" solution from our side could be ensure this "sortSpecifiers.property" be just "organization" instead of "organization$_identifier".

If it is not possible, we should ask Smartclient why are they doing that: have an if statement just if "fields" exists, and then base the rest of the function code in things that have been obtained inside this if statement.
(0048055)
mtaal (viewer)
2012-04-26 17:22

Asked on the smartclient forum:
http://forums.smartclient.com/showthread.php?p=85461#post85461 [^]
(0048595)
mtaal (viewer)
2012-05-13 20:50

.
(0048596)
mtaal (viewer)
2012-05-13 20:50

Fixed through smartclient upgrade
(0048597)
mtaal (viewer)
2012-05-13 20:51

Works

- Issue History
Date Modified Username Field Change
2012-04-23 00:51 mtaal New Issue
2012-04-23 00:51 mtaal Assigned To => dbaz
2012-04-23 00:51 mtaal Modules => Core
2012-04-23 00:51 mtaal OBNetwork customer => No
2012-04-24 20:41 dbaz Type defect => design defect
2012-04-26 17:15 mtaal Note Added: 0048050
2012-04-26 17:22 mtaal Note Added: 0048055
2012-04-26 17:27 mtaal Assigned To dbaz => mtaal
2012-05-13 20:50 mtaal Status new => scheduled
2012-05-13 20:50 mtaal Note Added: 0048595
2012-05-13 20:50 mtaal fix_in_branch => pi
2012-05-13 20:50 mtaal Note Added: 0048596
2012-05-13 20:50 mtaal Status scheduled => resolved
2012-05-13 20:50 mtaal Fixed in Version => 3.0MP12
2012-05-13 20:50 mtaal Fixed in SCM revision => .
2012-05-13 20:50 mtaal Resolution open => fixed
2012-05-13 20:51 mtaal Note Added: 0048597
2012-05-13 20:51 mtaal Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker