Is there a 3rd party Web Picture Button?

Since I have now encountered the bug reported in Feedback as 65388 - WebImageView Pressed firing twice reported by AlbertoD in my ongoing attempt to use Web 2.0 to recreate an existing project, I thought I’d ask the community if anyone knows of an alternate Web 2 compatible plugin control available that would work like Einhugur’s desktop PictureButton? Or, if anyone has figured out a way to suppress the WebImageView Pressed Event from firing twice?

I added my own confirmation to the feedback case already. I’m just looking for an alternate solution that doesn’t require me to purchase the entire Grafitti Suite for one lousy feature.

2 Likes

If you want a picture display with a Pressed event, you can try GraffitiRectangle.

EDIT: Missed that you said that. Sorry for the noise.

Grrrrr… Canvas Pressed event has the same bug and fires twice. This is just not my day. :frowning:

For easy access:
65250 - WebCanvas control Pressed event fires twice for each single press
65388 - WebImageView Pressed firing twice

I hope they are fixed soon.

1 Like

Too bad this: BootstrapWebButton doesn’t do what I want. I really just want a transparent icon button that uses a bootstrap icon. Sigh. WebImageView works perfectly for that except for the firing twice bug.

Cheap and dirty:

  1. Add a WebButton.
  2. Change its Indicator property to Link
  3. In its Opening event, add the following:
me.Caption = "<raw><img src='" + wp.URL + "'></raw>"

wp is a WebPicture.

2 Likes

Hi @Tom_Dixon , I’m using WebImageViewer and setting a WebPicture.BootstrapIcon and having nothing but success (knock on wood!). Take a look at the toggle buttons I have on this page, is this the kind of functionality you’re looking for?

FLUIDLINK.IO Sign-Up

Actually looks and feels kind of akward :sweat_smile: When you click, it dissappears for a sec, then reappears with the new picture.

Looking more in to it, is worse that it looks like at glance. when you click:
a message is sent to the server
The DIV changes the visibility, so it dissappears (Did you make a .Visible = False?)
Server SENDS new SVG data
Browser sets DIV visible again
Asigns the SVG data as background…

And this repeats each button press… Yes, the SVG is sent to the browser EACH time you press the button…

As a tip, NEVER use Xojo events for something that requires user interaction like a button or a checkbox, your app will feel slow and no responsive, and that in the best scenario where your app has not many concurrent users…

It is a shame that xojo cant support coding for the browser side :slightly_frowning_face:

I’d be offended if I didn’t think there was a better way of going about this :wink:

Could you please expand on this? Isn’t the purpose of buttons and checkboxes (etc) for user interaction? I’m probably missing something

Of course, a normal CheckBox, when you click it, it changes instantly because the Browser handdles that graphical change, only after that change, it sends the event to the server, but the user saw an inmediate change.

BUT what William did, is a kind of custom check box, when clicked the browser first sends the event to the server, then the server sends an instruction to the browser to change the status of the button, so that roundtrip to the server just to make change the status of the button is what makes your UI/app look slow, unresponsive and that delay can cause that the user makes multiple clicks thinking that the first one was not registered.

Making some tests looking for a workaround, looks like the problem is not really on the Canvas or the WebImageView only… It goes deeper in to an unreliable framework :man_facepalming:t2:

Untitled Project

I used the example project from the feedback case NO CHANGES made, and the extra pressed event also happens when clicking other controls like the button.

So… Still not using Web 2 any time soon.

Hi @Tom_Dixon , I’m using WebImageViewer and setting a WebPicture.BootstrapIcon and having nothing but success (knock on wood!). Take a look at the toggle buttons I have on this page, is this the kind of functionality you’re looking for?

No. What you are doing is different from my application. I’m using the WebImageViewer with a bootstrap icon where the pressed event is used to open a dialog. When pressed it fires twice and opens two instances of the dialog.

Since I did not find a viable web picture button alternative I ended up moving the functionality to a Toolbar Menu. :Less intuitive, but works until the WebImageViewer Pressed event works.

solution

And this repeats each button press… Yes, the SVG is sent to the browser EACH time you press the button…

This is not necessarily true. You can preload the SVG into a WebPicture variable when the page loads so that it gets cached on the browser side.

As a tip, NEVER use Xojo events for something that requires user interaction like a button or a checkbox, your app will feel slow and no responsive, and that in the best scenario where your app has not many concurrent users…

I definitely don’t agree with this statement. UI elements are the primary purpose for developing a web application. In my case, all my web applications are hosted on a VM on a LAN for consistent user experience in a manufacturing environment, as opposed to deploying multiple copies of a desktop apps, but even if it was deployed on the worldwide web there are ways to make sure the design is responsive for UI elements and Xojo Web 2 has greatly improved the client side responsiveness. NEVER say NEVER do something. It’s the surest way for people to pile on and give you a valid reason why that kind of absolute statement is wrong or doesn’t apply to every use case.

I’m talking specifically of the example provided and what IT DOES now, not about the posibilities of doing differently.

Well, I’m NOT talking about the client side responsiveness either. Total oposite, I just said NEVER use the server side to make GUI behaviors, that is not responsive at all.

As a general rule most examples attached to feedback contain the minimal amount of code to demonstrate the issue being identified. Seldom would anyone go the the trouble of optimizing responsiveness in an example of a bug. YMMV

Not talking about anything of that either :thinking:. Did you know that when someone put a quote in its reply, that reply is usually about that specific quote?

Ahhh gotcha!