Android Question [Solved] Passing enabled=false doesn't work for either FloatLabeledEditText or B4XFloatTextField

AymanA

Member
Licensed User
Hi All,

I am trying to disable access to FloatLabeledEditText which is loaded to b4xDialog, but seems nothing is working to disable the field.

enabled=false has no effect here::
private email as FloatLabeledEditText

diag.Initialize(barp)
....
Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 90%x, 400dip)
    p.LoadLayout("layout")
email.EditText.Enabled=False 'or using email.Enabled=False both doesn't work and I can edit the field which is not the desired outcome.
Wait For (diag.ShowCustom(p, "حفظ", "", "الغاء")) Complete (Result As Int)

....
Can anyone let me know if I am doing something wrong, I have researched the forum and can not find a solution for this - the only thing I have found is the below which doesn't fit the purpose for me:

Dim cbJO As JavaObject = email.EditText
cbJO.RunMethod("email",Array As Object(False))
 

mangojack

Well-Known Member
Licensed User
try this ...
B4X:
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 90%x, 400dip) 'set the content size
    p.LoadLayout("layout")
    Dim rs As ResumableSub = dialog.ShowCustom(p, "حفظ", "", "الغاء")
   
    email.EditText.Enabled = False 'Disable after loaded to Dialog.
   
    Wait For (rs) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
    '...............
 
Last edited:

AymanA

Member
Licensed User
try this ...
B4X:
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 90%x, 400dip) 'set the content size
    p.LoadLayout("layout")
    Dim rs As ResumableSub = dialog.ShowCustom(p, "حفظ", "", "الغاء")
  
    email.EditText.Enabled = False 'Disable after loaded to Dialog.
  
    Wait For (rs) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
    '...............
You are genius!! thank you so much for your help, I really appreciate it, this has worked perfectly, and I learnt new thing today thanks to you! :D
 
Top