PDA

View Full Version : Hide/unhide edit field and button


KVanhuffel
09-19-2007, 09:14 AM
Hi,

I'm having problems to manipulate an edit field's visibility, based on ctrl messages.

This is what i would like to do:

My form contains two edit field, each one with a (browse) button.
As long as the first field is empty a second field must be disabled or invisible. As soon as the first edit field contains some text, the second field (and it's button) must be enabled or become visible .

This is what I tried:
if e_CtrlID == CTRL_EDIT_01 then
if e_Details.Text ~= "" then
DlgEditField.SetProperties(CTRL_EDIT_02, {Enabled = true , Visible = true});
DlgButton.SetProperties(CTRL_BUTTON_02, {Enabled = true , Visible = true});
end
end

The result is: As soon I put some text in the first edit field, the GUI is totally messed up. The edit fields disappear and I see a gray square.

The second problem is:
When the first edit field becomes empty, the second field must become invisible or disabled.

This is what I tried:
if e_CtrlID == CTRL_EDIT_01 then
if e_Details.Text == "" then
DlgEditField.SetProperties(CTRL_EDIT_02, {Enabled = false , Visible = false});
DlgButton.SetProperties(CTRL_BUTTON_02, {Enabled = false , Visible = false});
end
end

Te result is: When I came into this screen my application crashed.

Can somebody please help me.
(I have the latest updates of SF7.0.6.1)

Adam
09-19-2007, 01:26 PM
It appears as though you have found a bug in the software REF: 16485

Here is the code that I wrote and I came to the same conclusion:


if e_CtrlID == CTRL_EDIT_01 then
tblEdit1Props = DlgEditField.GetProperties(CTRL_EDIT_01);
if tblEdit1Props.Text == "" then
DlgEditField.SetProperties(CTRL_EDIT_02, {Visible=false});
DlgButton.SetProperties(CTRL_BUTTON_02, {Visible=false});
else
DlgEditField.SetProperties(CTRL_EDIT_02, {Visible=true});
DlgButton.SetProperties(CTRL_BUTTON_02, {Visible=true});
end
end


Adam Kapilik

KVanhuffel
09-21-2007, 04:16 AM
Do you have any more information yet on this bug?

Where can I follow up this bug reference?