Project

General

Profile

Actions

Feature #4898

closed

Bug with making changes to widgets in WWidget::render() during learned slot event

Added by Saif Rehman almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
Target version:
Start date:
05/07/2016
Due date:
% Done:

0%

Estimated time:

Description

When any changes made in WWidget::render() for a stateless slot, no changes are actually outputted to the browser. For example when a WMenu item is triggered() and render() updates a widget, nothing is changed in the browser.

I've uploaded a test file.


Files

bugreport-statelessSlotRender.C (3.82 KB) bugreport-statelessSlotRender.C Saif Rehman, 05/07/2016 11:56 AM
commit-67d3e2e.diff (3.06 KB) commit-67d3e2e.diff Saif Rehman, 05/09/2016 07:11 PM
bugreport-statelessSlotRender.C (3.97 KB) bugreport-statelessSlotRender.C Saif Rehman, 05/23/2016 12:37 PM
Actions #1

Updated by Koen Deforche almost 8 years ago

  • Tracker changed from Bug to Feature
  • Status changed from New to Feedback

Hey,

Indeed a stateless slot is limited to only the same 'effect' which can then be pre-learned. In your case, you cannot simply reimplement propagateSetVisible() as the effect of this function will be prelearned. The WMenuItem::triggered() signal however is safe to react to.

I do agree there is something lacking, namely the ability to indicate to Wt that a certain function will violate a stateless slot learning contract, which would then let Wt drop this client-side optimization, something like WWebWidget::isNotStateless() which simply invalidates the use of this function inside a stateless slot.

Regards,

koen

Actions #2

Updated by Saif Rehman almost 8 years ago

By "simply invalidates the use of this function inside a stateless slot" do you mean that updates will not be discarded in the case of such functions? I guess that would be a useful feature.

Could you suggest me an alternative. One alternative that I have in mind is to use a JSignal and track the changes with JavaScript, however, I was hoping to use a server side method

Btw I forgot that propagateSetVisible() is my own implementation so I've attached a diff file, its just a copy of propagateSetEnabled(). If you feel like Wt could use this function then feel free to apply it :)

Actions #4

Updated by Koen Deforche almost 8 years ago

  • Status changed from Feedback to InProgress
  • Assignee set to Roel Standaert
  • Target version set to 3.3.6

Ah, I didn't realize and confused propagateSetVisible() with propagateSetEnabled(). I think it might make sense in conjunction with the new feature to invalidate stateless slot learning.

Actions #5

Updated by Koen Deforche almost 8 years ago

  • Status changed from InProgress to Implemented @Emweb

A new function WObject::isNotStateless() was added for this.

Actions #6

Updated by Saif Rehman almost 8 years ago

Hey Koen, thanks for the fix. When will you push changes to GitHub?

Actions #7

Updated by Koen Deforche almost 8 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #8

Updated by Saif Rehman almost 8 years ago

Hey Koen and Roel, I tried using the isNotStateless() method and it still doesn't update. Please take a look. I've attached the updated test file.

Actions #9

Updated by Saif Rehman almost 8 years ago

Ok I get it, I should call isNotStateless() without any condition.

Actions #10

Updated by Koen Deforche almost 8 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF