WebListBox CellPicture Does Not Show

  1. 5 weeks ago

    Christopher R

    Sep 12 Pre-Release Testers, Xojo Pro Warwick, NY

    I've run into an issue where an image loaded using WebListbox.CellPicture will show when using the RemoteDebuggerConsole but does not show in the compiled stand-alone web app. Using the same source WebPicture loads and displays without issue within a WebCanvas using the paint event.
    I've attempted a preload, changing permissions and owner of the source images, and using the source images elsewhere in the project.

    me.CellPicture(me.LastIndex,0)=Img1

    Any thoughts or suggestions are appreciated!

    Target: ARM
    Xojo 2019 r1.1

    I found the problem when working on another project. Same situation where running RemoteDebuggerConsole would work as expected but the compiled app would not draw the image into a WebListbox Cell. The problem was in the string being queried.

    The second project with this issue was reading output from NetworkManager, getting the signal strength of available networks. Runtime debugging showed the string as:

    "*  "
    "** "
    "*** "
    "****"

    I would assign a signal strength PNG accordingly.

    The compiled application, however, this is what the string was:

    "▂___"
    "▂▄__"
    "▂▄▆_"
    "▂▄▆█"
  2. Michel B

    Sep 13 Pre-Release Testers, Xojo Pro RubberViews.com

    Where do you put this code ?

  3. Christopher R

    Sep 13 Pre-Release Testers, Xojo Pro Warwick, NY

    I've tried 2 variations of code, first in ListBox1(Shown). I then tried moving the same code to ListBox1(Open). Both function in debugger.

    First Variation, Select Case:

    Select Case UsrLevel(6)
    
    Case "*"
    me.CellPicture(me.LastIndex,0)=Img1
    
    Case "**"
    me.CellPicture(me.LastIndex,0)=Img2
    
    Case "***"
    me.CellPicture(me.LastIndex,0)=Img3
    
    Case "****"
    me.CellPicture(me.LastIndex,0)=Img4
    
    End Select

    Second Variation:

    If UsrLevel(6).trim="*" then me.CellPicture(me.LastIndex,0)=Img1
    If UsrLevel(6).trim="**" then me.CellPicture(me.LastIndex,0)=Img2
    If UsrLevel(6).trim="***" then me.CellPicture(me.LastIndex,0)=Img3
    If UsrLevel(6).trim="****" then me.CellPicture(me.LastIndex,0)=Img4

    For the life of me, I can't figure out why (all of) the code variations work in the debugger but not in the compiled app.

  4. Michel B

    Sep 13 Pre-Release Testers, Xojo Pro RubberViews.com
    Edited 5 weeks ago

    If you dragged the pictures into the project, make sure that the pictures are in the Resources folder that must accompany the app and be uploaded with it.

  5. Christopher R

    Sep 13 Pre-Release Testers, Xojo Pro Warwick, NY

    Thanks Michel-
    I have tried both loading from the drive as well as dragging the images into my project- same results, unfortunately. I created a test project to isolate the code. All images render as expected, so there's something else going on.

    - loaded the images into a Canvas from the same webpicture property I call for cellpicture in the listbox. Canvas renders, cellpicture does not.

    This is what I've tried in addition to what I've listed previously. The same code/changes in the test project render as expected:

    • Deleted the listbox and created a new one.
    • Removed any/all styles tied to the listbox.
    • Altered the cell column width and row height to be much larger than needed.

    Anyone have additional ideas to isolate this issue that I haven't tried yet?

  6. Greg O

    Sep 14 Xojo Inc

    Make sure that the webpictures are created in the same session that you’re using them in or that their Session property is set to Nil.

  7. Michel B

    Sep 14 Pre-Release Testers, Xojo Pro RubberViews.com
    Edited 5 weeks ago

    This could be the issue: me.CellPicture(me.LastIndex,0)=Img1

    Perhaps by the time you do that, the code that creates the cell has not have time to create the cell.

    You may want to make sure to put this code after addrow has indeed completed. You could try using a timer.

  8. 4 weeks ago

    Christopher R

    Sep 18 Pre-Release Testers, Xojo Pro Answer Warwick, NY

    I found the problem when working on another project. Same situation where running RemoteDebuggerConsole would work as expected but the compiled app would not draw the image into a WebListbox Cell. The problem was in the string being queried.

    The second project with this issue was reading output from NetworkManager, getting the signal strength of available networks. Runtime debugging showed the string as:

    "*  "
    "** "
    "*** "
    "****"

    I would assign a signal strength PNG accordingly.

    The compiled application, however, this is what the string was:

    "▂___"
    "▂▄__"
    "▂▄▆_"
    "▂▄▆█"

or Sign Up to reply!