Link to home
Start Free TrialLog in
Avatar of soozh
soozhFlag for Sweden

asked on

MVC property binding question

Hello,

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?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of frmqit
frmqit
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial