Jump to content
WalkingAway

Data aware component with transaction

Recommended Posts

Hi there

I have read pretty a lot topics about data-aware components.

There are a lot of even funny / useless examples (as examples I put here, found in internet, not mine code).

Thinkg about this panel component....

Is it possible to add master-detail feature? Basically, all I need is like cached update.

Short example: there are tables "Queries" and "Fields". If user adds / deletes / updates some fields, I want to save either all (both "Queries" and "Fields") or do nothing.

Because if user decided to cancel editing - there is no way to do it.

Is it possible?
Or may be somewhere is component already with suach an option?

What I can probably do for now - put all data to tlist, may be then for save I have to loop through manually...

 

Thanks.

uDBCalendarView.pas

uDBPanel.pas

Share this post


Link to post

You are talking about two completely different areas with completely different functionality.

 

A component is displaying / allowing to change a value, The source of said value is the dataset, which can behave in multiple different ways... either send the data to it's connection, use CachedUpdates or simply Cancel and revert to the unchanged state.

The connection will be the one deciding when the data will be written to the database by further caching and transactions.

 

You don't want to mix the functionality, especially if that functionality already exists. Spend that free time further improving your component, to display and change a value only 🙂

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×