Page 1 of 1

Selected value not saving to database

PostPosted: 04 Feb 2019 21:26
by sbsllc
I have a RadioGroupEX setup with two items. "Yes" and "No". "Yes" has a value of 0 and "No" a value of 1.
When I select "Yes" and then save the data nothing is saved to the database. Before anything saves to the database I need to select the second item "No" save the data then go back and select "Yes" before that "Yes" value ever saves.

Re: Selected value not saving to database

PostPosted: 05 Feb 2019 10:22
by Alexander Bulei
Hi sbsllc,
Please provide more information about the problem.
Do you use the DataLink? How do you save the data? In which event...?
Or provide the simple testcase.

Best Regards

Re: Selected value not saving to database

PostPosted: 05 Feb 2019 12:25
by sbsllc
Hi Alexander,

Yes, I am using a DataLink.
I am posting the data in a JQButtonOptionsClick event. Something like this:

procedure TfrmApplication.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
AParams: TStringList);
begin
qryApplication.Post;
end;

Re: Selected value not saving to database

PostPosted: 06 Feb 2019 10:36
by Alexander Bulei
Hi sbsllc.

Please send me the simple testcase project, I'm not able to reproduce this issue.

Best Regards.

Re: Selected value not saving to database

PostPosted: 06 Feb 2019 15:53
by sbsllc
I am attaching a test case using TClientDataSet. It's not pretty but it should show the issue I am having.

To reproduce first click insert and select "Yes" then submit. If you then refresh the data in the grid you will the value is null.
If you then click edit and select "No" then submit and refresh the value will be 0.
Edit again and select "Yes' then submit and refresh and the value will be 1.

It's that first select of "Yes" and then posting the data that results in a null value.
If I try to show the selected value using IWCGJQRadioGroupEx1.Items.Items[IWCGJQRadioGroupEx1.ItemIndex].Value I get an Argument out of range error that first time.

I am using version 4.1.0.152

Re: Selected value not saving to database

PostPosted: 08 Feb 2019 17:05
by Alexander Bulei
Hi sbsllc.
Thank you for your testcase.
It's a bug with DataLink, and I've already fixed it for next beta release.
Thank you.

Best Regards.