Avatar of soozh
Flag for Sweden asked on

MVC property binding question


I am an old Delphi/intraweb programmer that is now project leading an MVC project.

In this project we have an underlying database and some simple forms that are used to modify the database tables.  For example we have a Users Form and a Users table.

In the Users Form its possible to create new, modify and delete users.   We have a set of commands (New, Modify, Save, Delete, Regret) as buttons.  The states of these buttons changes depending on the state of the form.

Its not so complicated.  For example when the user opens the form the New button is enabled, but the others are disabled.  When the user selects an existing record the the Edit button is enabled.  Fairly standard stuff!

In my Delphi days I would connect the command buttons state (enabled or disabled) to the state of the underlying dataset.

So for example when it was empty only the New button was enabled.  And when it contained data then the Modify button would be enabled.  The button states were directly bound to the state of the underlying dataset.

In the MVC application my programs say that they must write some javascript to handle the button states and there must be other server side code to handle the dataset.

My wish is that we use ajax calls for the onClick events of the command buttons so that all of the logic can be placed server side and hopefully the button states can be bound to the dataset.

Is this possible?  Are the any ways of binding visible control properties to dataset status - or any other property for that matter?

Web FrameworksAJAX

Avatar of undefined
Last Comment

8/22/2022 - Mon

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck