Android Question B4XPlusMinus, Button, on a CLV

mfstuart

Active Member
Licensed User
Longtime User
Hi all,

How do I get the value from a B4XPlusMinus object when a button is clicked?
The user will change up/down the value in the B4XPlusMinus and then click the button to accept the changed value.
The B4XPlusMinus and the button are on a Panel on a CustomListView.
The CustomListView has more than one item/panel loaded into it.

So far I have this in code, but the btnAdmit_Click is not passing the syntax checker.
And I'm not sure if this is even the correct way to do it.


B4X:
Private Sub B4XPlusMinus1_ValueChanged(Value As Object)
    Log("PM Value: " & Value)
    Dim pm As B4XPlusMinus = Sender
    Dim idx As Int = clvCheckin.GetItemFromView(pm.mBase)
    Log("idx: " & idx)
End Sub

Private Sub btnAdmit_Click
    Dim btn As Button = Sender
    Dim btnparent As Panel
    btnparent = btn.Parent
    
    btn.Enabled = False
    
    Dim b4xPM As B4XPlusMinus = btnparent.GetView(13)       '<<========== fails syntax checker!
    Dim q As Int = b4xPM.SelectedValue
    Dim lblID as Label = btnparent.GetView(1)
    Dim id as String = lblID.Text

    Save_Data(id, q)
    
End Sub

Thanx,
Mark Stuart
 

Sagenut

Expert
Licensed User
Longtime User
Which error do you get?
 
Upvote 0

mfstuart

Active Member
Licensed User
Longtime User
You should attach your test project so that others can take a look.
The project is too big to attach.
I'd have to create an example.

Basically, how do you reference the B4XPlusMinus object from a button on a CustomListView?
 
Upvote 0

epiCode

Active Member
Licensed User
My 2 cents:
It will be slower to load a lot of B4Xplusminus in CLV along with a button and look extremely cluttered.
Just use a label to show a value and on click item event have a popup dialog which has plus minus to modify the value.
 
Upvote 0

mfstuart

Active Member
Licensed User
Longtime User
My 2 cents:
It will be slower to load a lot of B4Xplusminus in CLV along with a button and look extremely cluttered.
Just use a label to show a value and on click item event have a popup dialog which has plus minus to modify the value.
Hi mohsyn,
I was thinking of that, except this tablet app is for an employee at a gate, checking in guests to a theme park.
It has to have minimal interaction and be quick and snappy to work with.

I was thinking of only adding to the CLV the current scanned ticket or a yearly pass and them remove it when the next scan is done, and add the next scan. That way there would only be one entry in the CLV.
When a ticket (not a pass) is scanned, there can be more than one entry added to the CLV for each Adult, Child, and Infant group. Therefore, most likely only 3 entries would be added to the CLV - no more than say five in an unusual situation.

So performance in the CLV should not be an issue, but the minimal interaction is very important to process the guests in a timely manner.

Thank you all for your expert advice. It always comes forward in this very welcoming forum

Thanx,
Mark Stuart

ps: any other thoughts about gate scanning would be appreciated, as this app for the company is a new venture on tablets.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…