J jai Active Member Licensed User Longtime User Dec 28, 2015 #1 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- Code: 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 - Code: txt1(m1).Initialize("txt1") Clicks are captured in- Code: 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?
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- Code: 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 - Code: txt1(m1).Initialize("txt1") Clicks are captured in- Code: 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?
Erel B4X founder Staff member Licensed User Longtime User Dec 29, 2015 #2 The click is handled internally by the view. What do you need the click event for? Upvote 0
J jai Active Member Licensed User Longtime User Dec 29, 2015 #3 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: Dec 30, 2015 Upvote 0
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.
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2015 #4 If you switch to TextField instead of TextView then you could use the BeginEdit event for this. Upvote 0
J jai Active Member Licensed User Longtime User Dec 30, 2015 #5 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
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.
Erel B4X founder Staff member Licensed User Longtime User Dec 31, 2015 #6 As you see it is problematic to rely on the click events as they are consumed by the control itself. You need to use a different UI solution. Upvote 0
As you see it is problematic to rely on the click events as they are consumed by the control itself. You need to use a different UI solution.
narek adonts Well-Known Member Licensed User Longtime User Dec 31, 2015 #7 Change the delegate of TextView and use beginedit Upvote 0