B4J Question Listview item loaded with layout of checkbox, textfield, button addressability

Discussion in 'B4J Questions' started by Mahimahi, Feb 14, 2019.

Tags:
  1. Mahimahi

    Mahimahi Member Licensed User

    I am testing loading a listview items of a layout "subLvLayout" containing a checkbox, a textfield and a button, all looks fine. (please see picture)

    My question is how can these individual listview item's checkbox, textfield and button be addressed? e.g. click action, textfields' text, checkbox checked or not individually

    Can someone please help give some pointers or an example? Thanks a lot in advance.
     

    Attached Files:

  2. moore_it

    moore_it Active Member Licensed User

    use the events
    for example :

    Code:
    Sub Button_Action
    dim bt as button = sender
    ..
    ..
    end sub
    the bt is the checked button if you use the tags yoe will be able to get the index of row in the list.
     
  3. Mahimahi

    Mahimahi Member Licensed User

    Thanks moore_it. I assume by using tags to track index of row in the list, I would have to dim, initialize the individual controls e.g. checkbox, textfield, button in code vs. doing it in a layout/designer. Am I correct?

    In a basic listview setup, an array of strings would be added and they can be addressed via ListView1.SelectedItem when a row is selected. When we are adding a few nodes like checkbox, textfield, button in the listview as an item, are we able to get all properties of nodes without user's action? e.g. without user clicking on a button or checking/unchecking a checkbox. i.e. I like to be able to go through all items on listview, get checkbox state, textfield text. Is that possible?

    Please kindly advise. Thanks a lot.
     
  4. moore_it

    moore_it Active Member Licensed User

  5. Mahimahi

    Mahimahi Member Licensed User

    Can you help give an example of how to go through all items on listview, and get the checkbox state, textfield text? Thanks a lot.
     
  6. moore_it

    moore_it Active Member Licensed User

    Ok one moment
     
  7. moore_it

    moore_it Active Member Licensed User

    That's all
     

    Attached Files:

  8. Mahimahi

    Mahimahi Member Licensed User

    Thanks for the example. Although I still don't know how I can go through all items on listview, and get the checkbox state, textfield text?

    If I have a button outside of listview, when clicked, I want to be able to go from listview index 0 to x where x is the number of items -1 in listview, and foreach item, I want to list out checkbox state, label text, datepicker date, etc. Your example shows event from node by getting node's parent (e.g. button), which is the pane's tag, which I understand. Can I go from listview's event "_selectedIndexChanged" and find out all child or children node's info?

    Please advise. Thanks.
     
  9. moore_it

    moore_it Active Member Licensed User

    i hope this is the solution
     

    Attached Files:

  10. Mahimahi

    Mahimahi Member Licensed User

    Thank you very much moore_it. Your help and example is much appreciated. I am sure others can benefit a lot from your example, like I did.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice