The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Disabled panels still allow edit
Posted: 12 Oct 07 3:54 PM
|
I have a simple little script:
if txtOppStatus.Text = "Closed - Won" or txtOppStatus.Text = "Closed - Lost" then pnlDetail.Enabled = False pnlContract.Enabled = False pnlContract2.Enabled = False pnlReferral.Enabled = False else pnlDetail.Enabled = True pnlContract.Enabled = True pnlContract2.Enabled = True pnlReferral.Enabled = True End If
The problem is that if a user is on an opportunity that IS enabled and leaves the cursor in one of these panels and uses the 'VCR' buttons to move to a closed deal, while the panels are disabled the cursor is live and active in the field and the user can enter data.
I'd like to avoid having to set all those fields to read-only. Any thoughts? This seems like a bug to me. (oh v6.2.6 ... for now) |
|
|
|
Re: Disabled panels still allow edit
Posted: 14 Oct 07 1:51 PM
|
So they can only edit a field in a disabled panel if they were in that field prior to moving between records. If they weren't in that particular field, they wouldn't be able to select it on a disabled panel, right? If that's the case, you could just set the focus to a different field in the WhenChange event of the form. Every time they would move between records, they would be forced out of the currently selected field and into another one that you would define.
|
|
|
| |
|
Re: Disabled panels still allow edit
Posted: 15 Oct 07 2:08 PM
|
Well I changed the focus but I had to create a field that was partially obscured and lead no where. The problem is that the form will have NO active fields when disabled, so there was nothing I could shift my focus to.
Is there an easy way to shift focus off the form all together, say to the Opportunity Description on the main detail view? |
|
|
|
Re: Disabled panels still allow edit
Posted: 15 Oct 07 2:47 PM
|
If I'm understanding correctly, shifting focus to Opportunity Description would just allow them to edit the value in Opportunity Description on a read-only record. I suppose you could set focus to a control which is not typed into, a command button for example, if present. |
|
|
|
Re: Disabled panels still allow edit
Posted: 15 Oct 07 3:14 PM
|
I just created a text field, removed the 3D, the border lines and made it the same color as the background and then folded it up on itself so you cant see the cursor blinking. It's a hack but it works. |
|
|
|
Re: Disabled panels still allow edit
Posted: 15 Oct 07 3:39 PM
|
I'm glad that worked for you. I wonder though, what if you just set the visible property of the txt field you are using to False? I would imagine that would have the same result with less steps. |
|
|
|
Re: Disabled panels still allow edit
Posted: 16 Oct 07 6:54 AM
|
Seems like alot of work. Does the user not need to see this value? If so then yes set the visible property to false. If they do need to see the value then put a lable under it and toggle visibility between them.
Mark |
|
|
|
Re: Disabled panels still allow edit
Posted: 16 Oct 07 8:18 AM
|
Problem is that you cannot set focus to an invisible item. It throws up an error.
I'd still like to change focus to the main opportunity detail form, if possible, but I have no clue how I'd do that. |
|
|
|
Re: Disabled panels still allow edit
Posted: 16 Oct 07 8:23 AM
|
Question, I may be missing the point but why would you want to set focus to either the detail panel or the invisible item. Focus is to be given to controls that are editable IMHO. Focus is provided to the next control in the tab order as defined. If you order the controls correctly then focus would go to the next editable control. If you are physically setting focus then I assume a condition around is visible will determine if you can give focus to the control or not. you might even give focus to the label instead. Give focus to the first control in the tab order and not the detail panel makes more sense I believe.
Mark |
|
|
|
Re: Disabled panels still allow edit
Posted: 16 Oct 07 8:29 AM
|
The problem is that focus remains on a field (any field on this form) after I've disabled the panel that those fields are sitting on. When the focus remains, it allows the user to edit the field, even though the panel is disabled. I want to move the focus off the form entirely so this situation does not occur. |
|
|
| |
|