Hello Antonio,
This is indeed a bug.
When all children are removed with clear(), Wt takes a shortcut rather than
removing every child separately (in WWebWidget.C,
element.removeAllChildren()), that wrongly removes the title of the
groupbox too.
Can you file a bug in redmine for this issue?
Best regards,
Wim.
2014-01-23 Antonio Mancina <amanc...@mbigroup.it>
> Hi all,
>
> still on wt-3.3.1, I've just found a small issue.
>
> When populating a groupbox and then using the
>
> clear()
>
> call, to make it empty, the groupbox title as well is
> removed. A further setTitle() call to try to recreate
> it results in a wt javascript error given back by the
> browser.
>
> Koen, Wim, can you confirm this? Or am I doing something
> wrong?
>
> A simple test case follows:
>
> ============= wtapp.h =================
> #ifndef WTAPP_H_
> #define WTAPP_H_
>
> #include <Wt/WApplication>
> #include <Wt/WGlobal>
>
> class WtApp : public Wt::WApplication {
> public:
> WtApp( const Wt::WEnvironment& env);
> ~WtApp() {}
>
> private: // methods
> void eraseElements();
>
> private: // members
> Wt::WGroupBox* const theGroupBox;
> };
> #endif /* WTAPP_H_ */
> =========================================
>
> ============= wtapp.cpp =================
> #include "wtapp.h"
>
> #include <Wt/WGroupBox>
> #include <Wt/WPushButton>
> #include <Wt/WText>
>
> WtApp::WtApp(const Wt::WEnvironment& env)
> : Wt::WApplication(env),
> theGroupBox(new Wt::WGroupBox("Parameters", root())) {
>
> theGroupBox->addWidget(new Wt::WText("New Text"));
>
> Wt::WPushButton* const myButton = new Wt::WPushButton("Erase");
> myButton->clicked().connect(this, &WtApp::eraseElements);
>
> theGroupBox->addWidget(new Wt::WBreak);
> theGroupBox->addWidget(myButton);
>
> }
>
>
> void WtApp::eraseElements() {
> theGroupBox->clear();
>
> // theGroupBox->setTitle("Parameters");
> }
> ==========================================================
>
>
> Thanks all,
> Antonio
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends. Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest