EditText Clearing.

badal405

Member
Licensed User
Longtime User
Dear Erel,

I have a parent panel.
In the parent panel i also have 24 child panel and each child panel have many edit text. I want after saving data all text will be clear.
It should work. Infect not working.
Could you please tell me why the below code not clear the text field?

B4X:
For answ=0 To pnlA.NumberOfViews-1
   If pnlA.GetView(answ) Is Panel Then
      Dim pnl As Panel
      pnl=pnlA.GetView(answ)
      For i=0 To pnl.NumberOfViews-1
         If pnl.GetView(answ) Is EditText Then
            Dim txt As EditText
            txt=pnl.GetView(answ)
            txt.Text=""
         End If

         If pnl.GetView(answ) Is Spinner Then
            Dim spi As Spinner
            spi=pnl.GetView(answ)
            spi.SelectedIndex=0
         End If
      Next
   End If
Next
:sign0085:
Waiting for your reply.
Thanks and regards.
 

stevel05

Expert
Licensed User
Longtime User
You need to change the index within the inner loop to i, not answ.

-------------------
Sent via Tapatalk
 
Upvote 0
Top