disable record selection in edit mode?

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

disable record selection in edit mode?

Postby charles huff » Fri Jan 09, 2009 8:19 am

I am studying the servoy example crm. The navigation panel on the left has a customer list. clicking on the customer name in that list navigates to that customer record. I would like to disable this only during record edits. I have tried something like forms.Names.controller.enabled = false; but that locked up my test file. also elements.tabs_460.enabled = false; did not work. this is the enclosing tab panel. I also played around with if(!globals.isEditing()) but that got me nowhere. Can this be done? When editing any table the selection of another record or table will still work and I think this could be confusing to users. When the color of the fields changes to indicate edit mode I want to prevent the user from leaving that record.

On another note, the example crm does not seem to use radio buttons? What is the best way to get the radio buttons to work like the fields/combo boxes in the example? The regular fields change color to indicate they are editable, what is the correct way to handle radio buttons in this case?

Thanks
Charles
charles huff
 
Posts: 41
Joined: Fri Aug 15, 2008 1:24 am

Re: disable record selection in edit mode?

Postby rafig » Fri Jan 09, 2009 1:47 pm

Hi,

charles huff wrote:I am studying the servoy example crm. The navigation panel on the left has a customer list. clicking on the customer name in that list navigates to that customer record. I would like to disable this only during record edits. I have tried something like forms.Names.controller.enabled = false; but that locked up my test file. also elements.tabs_460.enabled = false; did not work. this is the enclosing tab panel. I also played around with if(!globals.isEditing()) but that got me nowhere. Can this be done? When editing any table the selection of another record or table will still work and I think this could be confusing to users. When the color of the fields changes to indicate edit mode I want to prevent the user from leaving that record.


I had the same issue, using the Servoy 3 Sample CRM.
You just need to put this into the 'doEdit' method on each form you want to protect
Code: Select all
//doEdit();

// disable solution navigation
forms.lst_solution_navigation.controller.enabled = false ;



On another note, the example crm does not seem to use radio buttons? What is the best way to get the radio buttons to work like the fields/combo boxes in the example? The regular fields change color to indicate they are editable, what is the correct way to handle radio buttons in this case?

Thanks
Charles


I didn't have a problem with radio buttons. If you place them on a layout and prefix their names [name property] with 'fld_', they change colour like everything else. You have to do this for any element you want to be editable (including tab panels, portals etc.)

Hope that helps,

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 704
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: disable record selection in edit mode?

Postby charles huff » Sat Jan 10, 2009 3:10 am

Thanks very much that did the trick. I also used forms.lst_tsNames.controller.enabled = true ;
in the save and cancel button methods... now to try out changing rb_ to fld_

Thanks again.

Charles
charles huff
 
Posts: 41
Joined: Fri Aug 15, 2008 1:24 am


Return to How To

Who is online

Users browsing this forum: No registered users and 7 guests