Simplicty and flexibility!


Application that Showcase how you can write-protect and search with paste in a Form.

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

Application that Showcase how you can write-protect and search with paste in a Form.

Download Sample!



In the attached sample we use SetState(), Custom Menu and Custom Toolbar to "force" the user to use our functionality correctly.

SetState() is made to cascade i.e. if you hide/disable etc. a group object (Form,Tab,Subform etc.) it will do the same to all the children.

So to disable the entire form you simply need to disable the main record (always called Record1 and is the first one in the object three).

We simply make a virtual field in the form that say:

SetState("Record1",2) 

Now you have disabled all fields and all button actions on the form including subforms etc.

You will still be able to search and crucially use PASTE to search.

In our sample we have done a little more, we have also re-enabled buttons that we want to use (Search) and given some messages.

SetState("Record1",2)+SetState("Search",3)+SetState("Manip",0)+SetStyle("Button1","Normal")+SetLabelText("Heading","Searchable (with paste) Read-only form")

The crucial change in mindset here is that when  you start "programming" you are in charge and are responsible, so you need to set and reset the functionality according to state etc. 

In DE8 you can get DE to do whatever you like, but you need to take responsibility and exploit standard functionality i.e. if you change it, don't expect to get it both ways ;-)

Since we haven't really disabled the form, just the controls the effect will not retain in Table view which isn't a Real DataEase form, so if you don't want the user to be able to save changes, delete etc, simply disable those features in the form altogether.

To be honest, it is something that should be done much more extensively in DE apps, as the default toolbars/menus give users a lot of frustration and confusion if they are there but don't work etc.




Simply delete the Menu entries and Short-Cuts for the functions you don't want and the user will not be able to do things they shouldn't.


DataEase default functionality should be kept on a minimum rather than a maximum which has been a tendency throughout DFW. Only the obviously beneficiary default functionalities should be "enforced", but even them need to be over-rideable. 

So much good functionality in DFW has been "wasted" because it was too restrictive or too inflexible. Functions should always only do one thing and a combination of functions the wanted functionality.

Also called: Programming.


Written by DataEase 20/03/15 at 10:47:38 Dataease [{8}]FIVE