Project

General

Profile

Actions

Bug #1802

closed

WPushButton for URL fails with WBootstrapTheme when button is initially hidden (and rendered) prior to setLInk

Added by Bruce Toll about 11 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
04/01/2013
Due date:
% Done:

0%

Estimated time:

Description

When using the new 3.3.0 BootstrapTheme, if you create a hidden WPushButton without a setLink and then subsequently display the WPushButton after a setLink, it is rendered as a non-functional button --- rather than an anchor.

I'm not sure if this is intended as a valid use case, but a similar sequence works with the "default" and "polished" themes.

Attached is a small test program that demonstrates the problem. By default, it will demonstrate the issue. Just click on the button "Click here for options" to get a non-functional button labeled "Click for external link".

With a URL parameter of "polished" or "default", the test program demonstrates the working button behavior provided by the "default" and "polished" themes, respectively.

With a URL parameter of "workaround" the test program does a setLink(Wlink("/")) on the WPushButton when it is initially created. The WPushButton then works as expected when it subsequently has its link updated and is unhidden.

Hope this helps. Thanks for all the great work on Wt!


Files

bootstrap_button_bug_20130331a.cc (1.5 KB) bootstrap_button_bug_20130331a.cc Bruce Toll, 04/01/2013 01:24 PM
Actions #1

Updated by Bruce Toll about 11 years ago

Tested Wt version was from github (git describe ---tags => 3.3.0-rc4-1-g9536c9f)

Actions #2

Updated by Koen Deforche about 11 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.3.1

Hey Bruce,

Indeed this will fail. In bootstrap we actually can switch to an anchor as implementation because visually the button is entirely guided by CSS, but this is not the case in the default CSS theme (although it could be done in polished, I guess).

What should happen is that the button is rerendered as an anchor. This shouldn't be too hard, so I'ld like to solve this for 3.3.1

Regards,

koen

Actions #3

Updated by Bruce Toll about 11 years ago

Hi Ken,

Thanks for the clear explanation and rapid resolution of the other issues reported.

Regards,

Bruce

Actions #4

Updated by Koen Deforche over 10 years ago

  • Target version deleted (3.3.1)

This is harder than expected --- in fact, I wonder whether it's worth the trouble since workarounds are easily done (e.g. recreating the widget).

Actions #5

Updated by Bruce Toll over 10 years ago

Hi Koen,

Thanks for following-up on this. I agree that the workaround is fine --- and a developer should find the problem in testing.

Perhaps a note could be added to the setLink() method with the limitation/workaround. If it's easy to implement, it might even be worth logging a warning, e.g. "WPushButton::setLink Cannot use setLink to set external URL on WPushButton after render with this theme. See documentation."

---Bruce

Actions #6

Updated by Koen Deforche about 10 years ago

  • Status changed from InProgress to Resolved
  • Target version set to 3.3.2

Hey Bruce,

Good idea, the note. We've added it.

Regards,

koen

Actions #7

Updated by Koen Deforche about 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF