CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Item.Value not updating database value

by zsleo » 19 May 2016 04:36

I have a DB field that is data type integer.

I have 3 items. Item.Value(s) are 12, 99 & -1.

The value saved to the DB is the Item.ItemIndex ( not Item.Value)

If the DB field datatype is char then then DB field are saved correctly.

... how do I resolve this.

TIA
zsleo
 
Posts: 777
Joined: 03 Feb 2013 03:33

by Alexander Bulei » 19 May 2016 09:17

Hi,

The value saved to the DB is the Item.ItemIndex ( not Item.Value)


I have 3 items. Item.Value(s) are 12, 99 & -1.


And why are you using the ItemIndex instead Value?

ItemIndex is the item index in list (TCollection)

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by zsleo » 19 May 2016 14:17

I think you misunderstood.

I am not using grade that value. I have not injected any code.

What I am saying is Item.Value in NOT the value saved to the DB!
zsleo
 
Posts: 777
Joined: 03 Feb 2013 03:33

by Alexander Bulei » 19 May 2016 15:52

Hi,

So, I don't know what are you want...
Explain better the your objective and your problem.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by zsleo » 19 May 2016 21:08

As I said in my first post. The wrong value is saved to DB.

I have not added any extra code.
zsleo
 
Posts: 777
Joined: 03 Feb 2013 03:33

by Alexander Bulei » 20 May 2016 09:03

Hi zsleo,

Don't think this is something with our component.
Please debug and check the ItemIndex.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by zsleo » 20 May 2016 09:20

I have done and have had to write code around the components to solve the problem.
zsleo
 
Posts: 777
Joined: 03 Feb 2013 03:33

by sbsllc » 20 Sep 2019 01:32

I realize this is an old thread but I am running into the same issue as zsleo was. No matter what value I enter in the item.value it will save the itemindex value to the database instead.

I have two items configured. The value of the first item is set to -1 and the value of the second items is set to 0. Whenever an item is selected and the data is saved the value of the first item is always 0 and the value of the second item is always 1.

Isn't the value in the item.value property supposed to be the value saved?
sbsllc
 
Posts: 102
Joined: 01 Jul 2014 01:37

by Alexander Bulei » 23 Sep 2019 09:29

Hi sbsllc,

Can you submit the simple testcase?
I can't simulate that issue.

TIA
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by sbsllc » 14 Oct 2019 04:02

Hi Alexander,

I am very sorry for the delay. I got pulled away on another project.
I am attaching a test case using TClientDataSet.

To reproduce first click insert and select "Yes" then submit. If you then refresh the data in the grid you will see that the value saved was 0 even though I have 10 set for that items value. If you select "No" the value saved is 1 and not 20 which is that items value.

I hope this helps show what I am seeing. Thank you!
You do not have the required permissions to view the files attached to this post.
sbsllc
 
Posts: 102
Joined: 01 Jul 2014 01:37

Next

Return to JQRadioGroupEx

Who is online

Users browsing this forum: No registered users and 0 guests

Contact Us.