Bug #8204
REGRESSION: separator should not show in a new date editing browse shell for unknown value
100%
Related issues
History
#1 Updated by Vladimir Tsichevski 3 months ago
- Status changed from New to WIP
If a browse cell is of date type, and date format includes date component separators (e.g. 9999/99/99
), and an unknown date is used as the model, the separators should not be displayed (the cell should be displayed as blank instead of / /
for the format mentioned).
This behavior is different from that for date editing FILL-IN
s, where the separators should be visible.
This issue arises due to the fact that browser cells and FILL-IN
s use the same class DateFormat$DateBuf
to format dates.
As of trunk rev. 14925, this behavior is implemented in the DateBuf
constructor code as:
// Do not show delimiters for unknown value // with either no delimiters format or browse cell fill-in. if(isUnknown) { if(!hasFmtSeparator()) { return; } final EditableField fillIn = editableSource; if((fillIn instanceof FillInGuiImpl) && ((FillInGuiImpl)fillIn).isLinkedToBrowse()) { return; } } initScreen(screenValue, varDate);
Here an attempt is made to decide if we are inside a browse, but it fails when we are called from the following browse code:
public static String getCellText(BrowseColumnConfig columnConfig, BaseDataType var) throws DisplayFormatCheckException { if (var == null) { return ""; } return getDisplayFormat(columnConfig).fromVar(var).toScreenValue(); }
Here an temporary instance of DateBuf
is created by DateFormat.fromVar(var)
, which is not connected to any FILL-IN
.
#3 Updated by Vladimir Tsichevski 3 months ago
The proposed solution is to change the line:
if (var == null)
to:
if (var == null || var.isUnknown())
The common idea here is also: all code related to browse should reside in browse classes.
#4 Updated by Vladimir Tsichevski 3 months ago
- Related to Bug #8210: REGRESSION: separator should not show in date editing FILL-IN in ChUI when FILL-IN is cleared added
#5 Updated by Vladimir Tsichevski 3 months ago
- % Done changed from 0 to 50
Vladimir Tsichevski wrote:
The proposed solution is to change the line:
This change fixes the browse date cell display, so now all related ChUI tests are passing.
#7 Updated by Vladimir Tsichevski 3 months ago
- % Done changed from 50 to 100
- Status changed from WIP to Review
Greg Shah wrote:
Stanislav: Please review.
Vladimir: Please put the change in a branch. What remains in this task?
Done 8204a, rev. 14941, based on trunk rev. 14940.
This fixes some cases in ChUI test suite. We can merge this to trunk now or wait until all known regressions related to date editing are fixed.
#8 Updated by Stanislav Lomany 3 months ago
if (var == null || var.isUnknown())
Vladimir, your change should be limited to date
, datetime
and datetime-tz
. For the other types unknown value is rendered as a question mark.
#9 Updated by Vladimir Tsichevski 3 months ago
- Status changed from Review to WIP
- % Done changed from 100 to 90
Stanislav Lomany wrote:
if (var == null || var.isUnknown())
Vladimir, your change should be limited to
date
,datetime
anddatetime-tz
. For the other types unknown value is rendered as a question mark.
Thank you, Stanislav, will re-test and fix this...
#10 Updated by Vladimir Tsichevski 3 months ago
- % Done changed from 90 to 100
- File BrowseFWD.png added
- File BrowseOE.png added
- Status changed from WIP to Review
Stanislav Lomany wrote:
if (var == null || var.isUnknown())
Vladimir, your change should be limited to
date
,datetime
anddatetime-tz
. For the other types unknown value is rendered as a question mark.
The code changed to:
if (var == null || (var instanceof date && var.isUnknown())) { return ""; }
this fixes the problem for date
and sub-classes.
The program to test:
DEFINE TEMP-TABLE tt FIELD col1 AS DATE FIELD col2 AS DATETIME FIELD col3 AS DATETIME-TZ FIELD col4 AS CHARACTER FIELD col5 AS INTEGER FIELD col6 AS DECIMAL . CREATE tt. tt.col1 = ?. tt.col2 = ?. tt.col3 = ?. tt.col4 = ?. tt.col5 = ?. tt.col6 = ?. CREATE tt. CREATE tt. DEFINE QUERY q FOR tt SCROLLING. OPEN QUERY q FOR EACH tt. DEFINE BROWSE hBrowse QUERY q DISPLAY tt.col1 WIDTH 10 LABEL "Date" tt.col2 WIDTH 10 LABEL "Datetime" tt.col3 WIDTH 12 LABEL "DatetimeTZ" tt.col4 WIDTH 10 LABEL "Character" tt.col5 WIDTH 10 LABEL "Integer" tt.col6 WIDTH 10 LABEL "Decimal" ENABLE ALL WITH SIZE-CHARS 75 BY 5 TITLE "All-types BROWSE". DEFINE FRAME fr hBrowse WITH TITLE "Frame" SIZE 80 BY 10 NO-LABELS . ENABLE ALL WITH FRAME fr. WAIT-FOR WINDOW-CLOSE OF DEFAULT-WINDOW.
The screen in FWD Swing:
The same screen in OE:
The change committed to 8204a rev. 14942.
#12 Updated by Stanislav Lomany 3 months ago
I'm OK with the changes.
#14 Updated by Vladimir Tsichevski 3 months ago
Greg Shah wrote:
What testing is needed?
Running Majic tests is the only tests I can think of for now.
#15 Updated by Vladimir Tsichevski 3 months ago
- Status changed from Internal Test to Review
Another fixes are required:
- in
Browse.createEditingFillIn
the browse column must be set in the connectedFILL-IN
before initialize() is called for theFILL-IN
. Otherwise the FILL-IN does not know it belongs to a browse at the moment it initializes its screen value. This fixed in 8204a rev. 14943. - Also the
DateFormat.DateBuf(date)
constructor fixed: allow the "browse with no separators" feature in ChUI also. This fixed in 8204a rev. 14944.
Also some non-functional code clean-up added in rev. 14945.
Please, review.
#17 Updated by Stanislav Lomany 3 months ago
I'm OK with the changes. One minor typo correction: our fill-in has to know it belong so a browse *before* at the time initialize() is called
should probably be our fill-in has to know it belongs to a browse *before* the time initialize() is called
#18 Updated by Hynek Cihlar 3 months ago
Greg Shah wrote:
Stanislav/Hynek: Please review ASAP.
The changes look good.
#19 Updated by Vladimir Tsichevski 3 months ago
Stanislav Lomany wrote:
I'm OK with the changes. One minor typo correction:
our fill-in has to know it belong so a browse *before* at the time initialize() is called
should probably beour fill-in has to know it belongs to a browse *before* the time initialize() is called
Thanx. Fixed in rev. 14946.
#21 Updated by Vladimir Tsichevski 3 months ago
Greg Shah wrote:
What testing is needed?
I'd like to run Majic suite with 6667i, but the repo should be rebased to the latest trunk first. Shall I ask Tomasz to do that? Or, I can do this myself?
#25 Updated by Vladimir Tsichevski 3 months ago
Greg Shah wrote:
Please summarize the testing results here.
4 tests failed (3 original issues others are dependencies):
1. gso338: The screen has an unexpected extra line:
THIS RECORD HAS BEEN DELETED BY ANOTHER USER
According to Tomasz:
gso338_session2 - possibly problem with DirtyShare , badly reported record state
3. gso_453: REBALANCE ITEM QTY ALLOCATED TO JOB AND WIP
The client crashed.
2. tc_pay_emp_wr_rpt_002:
The unexpected lines:
WARNING: Export file /mnt/sdb1/majic/majic_xfer/output/Acct/NR10012009.EXP exists!
This is somehow related to test workflow iteself: the test output file was not deleted before the test body was executed.
#26 Updated by Vladimir Tsichevski 3 months ago
Greg Shah wrote:
I want this branch merged today unless there is an issue.
I am ready to merge.
#28 Updated by Vladimir Tsichevski 3 months ago
Greg Shah wrote:
In summary: there were some failures but they were unrelated to this task.
You can merge to trunk now.
Merged to trunk as rev. 14950.