Results 1 to 2 of 2

Thread: [Answers] Listbox and ListView

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Listbox and ListView

    Q:
    is it possible to populate listbox and listview with more than one column ?
    A:
    Have you looked at the Canvas Section 'TreeGrid' control? Specify the text for the 'Header labels' and a SQL Select statement for 'List items'. In the 'click' event you can get x.CurrentItem.text, CurrentItem being the currently selected treeitem object.
    Or, in a Form Section, you can use the Grid gadget for multiple columns.
    A2:
    If there is a reason you HAVE to use a list instead of grid, you could concatenate the result of a query, but I don't recommend it.
    This would work, but it would look ugly unless you forced some blank characters in to align it.
    Code:
    select first_name+" "+last_name from example


    Q:
    LIST VIEW. I noticed that you can set text as items, can I populate it with table fields?
    A:
    I add the items by using additems().
    Like so.
    I named the listview gadget list1.
    Code:
    mylistview=Lianja.get("page1.section2.list1")
    mylistview.additems("select last_name from example")


    Q:
    tried this;

    field1 is in a canvas section with listbox
    testadress is the table.

    Code:
    proc page1_section1_field1_ready()
    x=Lianja.get("page1.section1.field1")
    x.additems="select name from testadress"
    endproc
    Also in Load or activate.
    Does'nt work, listbox won't populate, stay's empty.
    Tried it in Form section with List view, same result.
    A:
    Additems() is a method not a property.
    replace this
    Code:
    x.additems="select name from testadress"
    With this

    Code:
    x.additems("select name from testadress")


    Q:
    in which event additems method can be used to load initial value in the list or combo item when the app starts.
    A:
    Use the 'ready' event. During development in the Lianja App Builder, the 'ready' event is called when the App is loaded, so just save and reload the App to force the 'ready' event to be called and see your new code.



    An example of using a draggable list to visually reorder records.
    Lianja OrderedLists - https://youtu.be/9Vswi2GkcHw



    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...p?2717-Answers

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    In a custom vfp section with a listbox, I am trying to call an event when the user uses the arrow key to navigate in the listbox.
    I have tried to keypress and valid, but no luck.

    A:
    interactivechange() is called when you cursor in a listbox.




    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...ll=1#post12352

    These answers are also systematized on the site "Lianja developer": https://lianjadeveloper.wordpress.com/category/listbox-and-listview/

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us