Skip to main content

UI Binding not updating

No replies
Anonymous

I have a form on which I modified the value contained in a bounded JTextField.
The data table contains only one row.
Before I attempt to save the data table I check the status of the dataRow and also check the status of the datacolumn that should have been updated. The results tell me that the dataRow is unchanged and dataColumn has been modified.

OK, now I am confused!

Below is the code used and the results from the System.out.println statments:

-------------------------------------------------- Code -------------------------------------------------------------------
System.out.println("Saving account record...");
DataRow row = acctTable.getRow(0);
System.out.println("Current row status: " + row.getStatus());

if (acctcontactBinding.isModified()) {
System.out.println("Account record column contact has been modified...");

for (DataRow row1 : acctTable.getRows()) {
//do what you want
System.out.println("Printing record before push... " );

for (DataColumn col1 : acctTable.getColumns()) {
System.out.println(col1.getName() + " = " + row.getValue(col1));

}
}

acctcontactBinding.push();

System.out.println("Current row status after push: " + row.getStatus());

for (DataRow row1 : acctTable.getRows()) {
//do what you want
System.out.println("Printing record after push... " );

for (DataColumn col1 : acctTable.getColumns()) {
System.out.println(col1.getName() + " = " + row.getValue(col1));

}
}

}

acctTable.save();

------------------------------------------------------- Results -------------------------------------------------------------------

Account table row count: 1
Saving account record...

Current row status: UNCHANGED
Account record column contact has been modified...

Printing record before push...

acctid = 1
acctcode = AAA
acctname = Triple A Automotive Assicoation
acctcontact = null
acctauthorization =
acctstatus = A
acctporequried = true
acctphone = (816) 233-4444
acctphoneext =
acctfax = (816) 233-5555
billaddress = 8234 S. Noland
billcity = Independence
billstate = MO
billzip = 64133
mailaddress = 8234 S. Noland
mailcity = Independence
mailstate = MO
mailzip = 64133
changedate = 2005-01-31
changetime = 12:00:00
changeby = Fred Cunningham
creationdatetime = 2005-01-31 12:00:00.0
createdby = Fred Cunningham

Current row status after push: UNCHANGED

Printing record after push...

acctid = 1
acctcode = AAA
acctname = Triple A Automotive Assicoation
acctcontact = null
acctauthorization =
acctstatus = A
acctporequried = true
acctphone = (816) 233-4444
acctphoneext =
acctfax = (816) 233-5555
billaddress = 8234 S. Noland
billcity = Independence
billstate = MO
billzip = 64133
mailaddress = 8234 S. Noland
mailcity = Independence
mailstate = MO
mailzip = 64133
changedate = 2005-01-31
changetime = 12:00:00
changeby = Fred Cunningham
creationdatetime = 2005-01-31 12:00:00.0
createdby = Fred Cunningham

------------------------------------------------------------------------------------------------------------------------

This the last piece in the Dataset/Binding puzzle for me!! What am I doing wrong?

Thanks

Fred Cunningham

[att1.html]