Project

General

Profile

Feature #2583

WTableView is not refreshed after clear() if create in the constructor and not init - see example (not sure if it is really a bug)

Added by Michael Vilsker over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/21/2014
Due date:
% Done:

0%

Estimated time:

Description

public class AppTableWidget extends FormView{

private WTableView t = new WTableView();

private WPushButton b = new WPushButton();

private WPushButton c = new WPushButton();

public AppTableWidget(){

super(tr("test"), null);

init();

}

private void init(){

clear();

bindWidget("t", t); // t will not work b will work.

bindWidget("c", c);

c.clicked().addListener(this, new Signal.Listener() {

@Override

public void trigger() {

init();

}

});

}



${t}${c}

#1

Updated by Michael Vilsker over 8 years ago

Michael Vilsker wrote:

> public class AppTableWidget extends FormView{
> 
>   private WTableView t = new WTableView();
>   private WPushButton b = new WPushButton();
>   private WPushButton c = new WPushButton();
> 
>   public AppTableWidget(){
>       super(tr("test"), null);
>       init();
>   }
> 
>   private void init(){
>       clear();
>       
>       bindWidget("t", t); // t will not work b will work.
>       bindWidget("c", c);
> 
>       c.clicked().addListener(this, new Signal.Listener() {
>           @Override
>           public void trigger() {
>               init();
>           }
>       });
> }
> 
> 
> 
> 
>       <message id="test">
>           ${t}${c}
>       </message>
#2

Updated by Koen Deforche over 8 years ago

  • Status changed from New to InProgress

Hey,

My understanding of this is that clear() will "delete" the bound widgets. While "delete" doesn't really exist in Java, the remove() will have side effects that might ruin its state. But perhaps this can be rectified in JWt.

koen

#3

Updated by Koen Deforche over 8 years ago

  • Tracker changed from Bug to Feature
  • Project changed from Wt to JWt
  • Status changed from InProgress to New
  • Assignee deleted (Koen Deforche)

Also available in: Atom PDF