iOS Question Problem with TextView click

jai

Active Member
Licensed User
Longtime User
I am using TextView boxes on a ScrollView to input data items. Upon click on any box the click event gets fired. It works fine for all TextView clicks but only the first time. Any subsequent click on a box that was clicked before does not fire the click event even when the TextView is not in focus.

The representative statements are-
B4X:
Dim txt1(10) As TextView
..draw 5 boxes on a scroll panel with specific tags..
Each box is initialized as it is placed on the ScrollView with -
B4X:
 txt1(m1).Initialize("txt1")
Clicks are captured in-
B4X:
Sub txt1_Click
    Dim edt As TextView
    Dim row1 As Int
    edt = Sender
    row1 = edt.Tag
    Log("Clicked box is “ & row1)
End Sub

This sub gets fired only on the first click on the box. Click on the once-clicked item remain ignored at all other times. I need the click to fire each time when any box is clicked.

How can I resolve this issue while using TextView?
 

jai

Active Member
Licensed User
Longtime User
I need recurring click event to get the tag of the text box clicked to properly account for the data entered. Current implementation of TextView does not trigger the click event and thus does not permit identification of the text box of data revision after the initial entry.
 
Last edited:
Upvote 0

jai

Active Member
Licensed User
Longtime User
Switching to TextField may not be appropriate in this situation.

App data input in these TextView boxes is designed for two different formats depending on whether the user Clicks or LongClicks. I had tried using the TextField earlier but it could not properly delineate between a Click and a LongClick. We had reviewed this issue of the inability of TextField and BeginEdit to serve the needed purpose.

I was suggested to use TextView in order to account for Clicks & LongClicks separately which works fine.

The TextView has served the above purpose well. All first-time clicks fire as expected. The delineation and accounting of all input works fine except when a TextView box is reclicked. In such case there is no way to know which textbox was clicked without the Click event. All that is needed is some way to identify the click of a TextView object that has been clicked before with _Click event or some other way of looking at its Tag.
 
Upvote 0
Top