Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363738 - RUI - cannot render UI with DojoCurrencyTextBox or DojoDateTextBox widgets
Summary: RUI - cannot render UI with DojoCurrencyTextBox or DojoDateTextBox widgets
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Huang Ji Yong CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-14 14:23 EST by Paul Hoffman CLA
Modified: 2017-02-23 14:16 EST (History)
4 users (show)

See Also:


Attachments
Test projects (282.32 KB, application/x-zip-compressed)
2011-11-14 14:24 EST, Paul Hoffman CLA
no flags Details
Fix (1.25 KB, patch)
2011-11-17 03:28 EST, Huang Ji Yong CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hoffman CLA 2011-11-14 14:23:44 EST
Am trying to test migrated RUI with DB tutorial application.

Handler PaymentFileMaintenance will not render with DojoCurrencyTextBox widget on UI (also DojoDateTextBox).     Page will render if widgets are replace with a DojoTextField.

Load projects from zip file and try to open the handler.

Here are the widget declarations:

//   selectedPayment_amount_textBox DojoTextField {
//      layoutData = new GridLayoutData { row = 4, column = 2} };

   selectedPayment_amount_textBox DojoCurrencyTextBox { 
      currency = "USD", value = selectedPayment.amount, width = 166, 
      errorMessage="Amount is not valid.", 
      layoutData = new GridLayoutData { row = 4, column = 2} };


//   selectedPayment_dueDate_textBox DojoTextField {
//      layoutData = new GridLayoutData { row = 6, column = 2} };
      
   selectedPayment_dueDate_textBox DojoDateTextBox { 
      formatLength = DojoLib.DATEBOX_FORMAT_LONG, 
      value = selectedPayment.dueDate, 
      layoutData = new GridLayoutData { row = 6, column = 2} };
Comment 1 Paul Hoffman CLA 2011-11-14 14:24:35 EST
Created attachment 206982 [details]
Test projects
Comment 2 Huang Ji Yong CLA 2011-11-15 08:26:48 EST
This problem happens because the value for DojoCurrencyTextBox & DojoDateTextBox is null.
Shall we generate a default value for it or just throw a NullValueException.

Brian,
What's you opinion?
Comment 3 Brian Svihovec CLA 2011-11-15 17:03:21 EST
I looked at the generated code, and it is failing on this line:

this.selectedPayment_amount_textBox.setValue(egl.eglx.lang.EString.fromEDecimal(this.selectedPayment.amount,"d10:2;")); 

where this.selectedPayment.amount is null.

I believe the amount field of "paymentRec" should be changed to remove the "?",
or a default value should be specified, either in the record or the RUIHandler.
Comment 4 Huang Ji Yong CLA 2011-11-15 20:43:03 EST
Brian,
I agree that the test case has to be changed.
But at the same time, I think we have to throw a NullValueException in this test case for user to identify the problem easily.
What do you think?
Comment 5 Huang Ji Yong CLA 2011-11-15 21:15:12 EST
Paul,
Please change the sample first to bypass this problem.
Thanks.
Comment 6 Brian Svihovec CLA 2011-11-16 13:49:58 EST
Using this testcase:

var1 Decimal(10,2)?;
var2 String? = null;
	
function start()
  var1 = var2;
end

I spoke with Matt about this, and the conversion of a null string to a decimal should result in a null decimal.  Since var1 is nullable, the assignment should complete and var1 should be null.

This is also the behavior of Java.
Comment 7 Huang Ji Yong CLA 2011-11-17 03:28:12 EST
Created attachment 207127 [details]
Fix
Comment 8 Huang Ji Yong CLA 2011-11-17 03:30:07 EST
Support assign null to nullable type
Comment 9 Paul Hoffman CLA 2012-03-30 16:10:32 EDT
Issue fixed.