Pictures in weblistbox cells

Is it possible to put pictures in a cell in the web listbox like we can in desktop?

I know the WebListboxTD control from Taylor Design can do this. I’ve not used it but you can check out the demo at http://webcustomcontrols.com.

Thanks Bob…I’m also having trouble with web styles on container controls and web dialogs…Have you had this problem? No matter what style I apply to them, when they show, it’s just white…

Apply the styles after you’ve put them on the WebPage. I believe that’s a known issue.

Not sure how to do that…

Are you adding the dialog at design time? Once you’ve placed them, THEN apply their style.

No, I’m adding the dialog at runtime…

I’ve tried everything and haven’t been able to get the web dialog’s background to another color no matter what I do…

Time to do a restart of the IDE.

tried that

Don’t know what to tell you. It does work for me. The dialog and container has to be on the Page first and then apply the style. Don’t bother adding it to the original object - only apply it to the instance on the page.

You can always try the “I’m batshitcrazy” fix. Close the IDE. Clear the plugin cache. Restart the computer. When things just don’t make sense I do that.

Then if that doesn’t work I go find a beer and look at it tomorrow. :slight_smile:

There are neither enough beers nor hours between now and tomorrow :S

Call it a starting point. :slight_smile:

This is what my wife always tells me when it’s getting late and she still finds me struggling with something like this. And most of the times, she is right, and the beer helps you leaving it till next day.

We put images in the list box by putting some marker text in the cell we want the image in and then do an ExecuteJavascript on the listbox to replace the marker text with an tag. E.g.: -

Dim S() AS String
Dim Cid As String

Cid = WebListBoxEx(Self).ControlID
S.Append “var L = document.getElementById(’” + Cid + “’).innerHTML;”

S.Append “L = L.replace(/Icon:RedWalk/g, '<img src=”""+Session.ConfigurationItems.Item.Value(“ImagePath”)+“RedWalk.png”">’); "

S.Append “document.getElementById(’” + Cid + “’).innerHTML = L;”
WebListBoxEx(Self).ExecuteJavaScript(Join(S, EndOfLine))

Hope that helps

Jim

Hi!

I’ve implemented this code:

dim i as integer
for i=0 to lbx.RowCount-1
dim strJS as string
strJS = “var toReplace = '” + varToReplace + “’; "
strJS = strJS + “var replaceWith =””<img "
strJS = strJS + “src=’” + pathToImage + “’>”";"
strJS = strJS + “document.body.innerHTML = document.body.innerHTML.replace(toReplace, replaceWith);”
lbx.ExecuteJavaScript(strJS)
next

its perfect! it works. i have the original tag changed by the image!

BUT, the CellClick and SelectionChanged does not work anymore…

Any idea?

Xojo 2015R4

[quote=252808:@Alexandre Cunha]Hi!

I’ve implemented this code:

dim i as integer
for i=0 to lbx.RowCount-1
dim strJS as string
strJS = “var toReplace = '” + varToReplace + “’; "
strJS = strJS + “var replaceWith =””<img "
strJS = strJS + “src=’” + pathToImage + “’>”";"
strJS = strJS + “document.body.innerHTML = document.body.innerHTML.replace(toReplace, replaceWith);”
lbx.ExecuteJavaScript(strJS)
next

its perfect! it works. i have the original tag changed by the image!

BUT, the CellClick and SelectionChanged does not work anymore…

Any idea?

Xojo 2015R4[/quote]

I tried that a while ago, but indeed, that freezes the WebListbox. See http://www.w3schools.com/css/css_background.asp

@Michel Bujardet

I read the w3schools but didn’t get if there is a way to fix it or not.

Alex

You did not read the page I pointed to. There are many on that site …

It tells you what to do.

@Michel Bujardet

Hi again. I’m sorry for my bad english. I really read the link:
http://www.w3schools.com/css/css_background.asp

But i didn’t find where / how i can fix the code.

Can you explain more?

Best regards,

Alex