Project

General

Profile

Help with refresh

Added by fedya fedyakov about 11 years ago

Hello folks,

Can anybody please explain me how to handle refresh?

When I set reload-is-new-session to false, pressing refresh button on browser lead to

empty screan (in fact only navigation bar is displayed). I use wt 3.3.0rc3 is there something

special about handling refresh event?


Replies (4)

RE: Help with refresh - Added by Koen Deforche about 11 years ago

Hey,

I could not reproduce this with the widget gallery ... Could you be more specific of what widgets are not behaviour correctly on refresh ?

Regards,

koen

RE: Help with refresh - Added by fedya fedyakov about 11 years ago

Structure of my application is as follows:

class app_t: public Wt::WApplication {

public:

app_t(Wt::WEnvironment const& env, io_processor::io_handler::s_ptr handler, dao::survey_dao_t::s_ptr db)

: WApplication(env)

{

setTitle(Wt::WString::fromUTF8("blabalabla"));

setTheme(new Wt::WBootstrapTheme);

messageResourceBundle().use(appRoot() + "p_ctl");

root()->setPadding(10);

root()->resize(Wt::WLength::Auto, Wt::WLength::Auto);

view_ = gui::create_main_view(handler, db, root());

useStyleSheet("p_ctl.css");

}

protected:

void refresh() override {

WApplication::refresh();

setInternalPath("/"); // this has no effect

}

private:

gui::main_view_t* view_;

};

namespace gui {

class main_view_t : public Wt::WContainerWidget {

public:

main_view_t(Wt::WContainerWidget * = 0);

virtual ~main_view_t() = 0;

};

main_view_t* create_main_view(

io_processor::io_handler::s_ptr, dao::survey_dao_t::s_ptr, Wt::WContainerWidget*);

}

inside main_view_t instance there is a WStackWidget which handles instances just like main_view_t

( instances of abstract classes are derived from Wt::WContainerWidget) the WStackedWidget' instance is handled

by an instance of WNavigationBar (menus with links to different internal paths).

RE: Help with refresh - Added by fedya fedyakov about 11 years ago

btw, koen, do you have any suggestion about how to cope with a very long

response of a WTableView on a mouse click? you can observe this (mis)behaviour

on the widget gallery page. I'm very new to Wt, so I have only subtle guesses about

the root of the problem and absolutelly no idea on how to fix that issue.

RE: Help with refresh - Added by Koen Deforche about 11 years ago

Hey,

I can't see anything that would be wrong with your application. The starting point for us to fix the issue you observe is for us to reproduce it --- can you narrow it down to a test case ?

The slow response of WTableView (or any other widget) to a mouse click is caused by having both double-click and single-click listeners. The single click then requires waiting for a timeout.

Unfortunately, by default WTableView (WAbstractItemView) configures double click as the edit trigger.

Regards,

koen

    (1-4/4)