get a selected row content and send it to a uilabel ?

Home Forums General Programming get a selected row content and send it to a uilabel ?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #22175
    zeoka
    Participant
      • Topics: 73
      • Replies: 466
      • Total: 539
      • ★★★

      Using what() I saw :
      flipRowSelection , selectRangeOfRows ,deselectRow,getSelectedRows ,getNumSelectedRows,
      updateContent,selectRow,getLastRowSelected,deselectAllRows,isRowSelected,
      getTextForValue

      Tried getSelectedRow ,getLastRowSelected
      getLastRowSelected gives an INT

      is it possible ?

      #22230
      zeoka
      Participant
        • Topics: 73
        • Replies: 466
        • Total: 539
        • ★★★

        Tried split() function to transform uiListBoxContent to an array but it fails
        a = mod:getComponent():getProperty(“uiListBoxContent”)
        b = split(a,”\n”)
        text:setText(b[newValue + 1])
        ->attempt to call split (a nil value)
        I could also use getLastSelectedRow() but how I extract text from it ?
        Any help Would be much appreciated
        thank you

        #22284
        atom
        Keymaster
          • Topics: 159
          • Replies: 2945
          • Total: 3104
          • ★★★★★

          When you “get” a selected row a selection of rows you only get their indexes (numbers), it’s up to you to map those numbers to meaningful text, you hold the data that’s passed to the ListBox, the components itself is not aware of the text it’s displaying.

          I don’t know what “split()” does, i guess it’s a Lua function, if you wish to call it make sure you call it on a string, and also make sure that you shouldn’t call it like “string.split()”

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 108 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr