New Project, Spin Box, css settings
Added by Mark Petryk over 7 years ago
I've got a simple app with a few simple line-edit and one with a spin-box. But the spin-box doesn't have any decorations, to indicate it can be spun. I think this is a css issue, but this always gets me throwed off on a new application deployment.
The SpinBox actually does respond to mouse-clicks as if the decorations are on the widget, they are just not 'visible'
(see attached image)
192.168.1.33 - - [2017-Nov-11 07:15:53.261] "GET /resources/themes/bootstrap/3/bootstrap.css HTTP/1.1" 404 85
192.168.1.33 - - [2017-Nov-11 07:15:53.266] "GET /resources/themes/bootstrap/3/wt.css HTTP/1.1" 404 85
192.168.1.33 - - [2017-Nov-11 07:15:53.266] "GET /resources/moz-transitions.css HTTP/1.1" 404 85
[2017-Nov-11 07:15:53.266] 3235 - [info] "Wt: session created (#sessions = 2)"
[2017-Nov-11 07:15:53.266] 3235 [/ xNofmLSFFzUDG1Eq] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
192.168.1.33 - - [2017-Nov-11 07:15:53.267] "GET /resource/themes/bootstrap/3/bootstrap-theme.min.css HTTP/1.1" 200 2261
[2017-Nov-11 07:15:53.267] 3235 - [info] "WebRequest: took 0.779 ms"
128 MyApp( const Wt::WEnvironment & env )
129 : Wt::WApplication( env ),
130 m_session("crm.sqlite")
131 {
132 auto bootstrapTheme = std::make_shared<Wt::WBootstrapTheme>();
133 bootstrapTheme-> setVersion( Wt::BootstrapVersion::v3 );
134 bootstrapTheme-> setResponsive(true);
135 setTheme( bootstrapTheme );
136 useStyleSheet("resource/themes/bootstrap/3/bootstrap-theme.min.css");
Replies (7)
RE: New Project, Spin Box, css settings - Added by Bruce Toll over 7 years ago
It looks like there is an inconsistency with regards to the location of resources. The explicit useStyleSheet path starts with "resource/" and the GET request for the associated resource succeeds. The GET requests for the other css files attempt to access paths starting with "resources/" and fail with 404 errors. If you want to stay with the default of "resources/", then update the useStyleSheet path and make sure that the "resources" directory is accessible from your docroot.
RE: New Project, Spin Box, css settings - Added by Mark Petryk over 7 years ago
Ah, got it, so I should be looking at the "404" to realize it's a failure.
right here ---------------------------------------------------------------------------------------------+
|
V
192.168.1.33 - - [2017-Nov-11 07:15:53.261] "GET /resources/themes/bootstrap/3/bootstrap.css HTTP/1.1" 404 85
Thank you!
RE: New Project, Spin Box, css settings - Added by Mark Petryk over 7 years ago
Ok, I have all that patched up, no resource errors, but the SpinBox still will not decorate. And, looking at the trace below, it almost seems like every resource that's being requested is causing another session to be created, and I think that's an issue also...
[2017-Nov-12 11:21:51.188] 447 - [info] "Wt: session created (#sessions = 2)"
[2017-Nov-12 11:21:51.189] 447 [/ qZpI9PgSi55Bu3MV] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
192.168.1.6 - - [2017-Nov-12 11:21:51.190] "GET /resources/themes/bootstrap/3/bootstrap.css HTTP/1.1" 200 2252
[2017-Nov-12 11:21:51.190] 447 - [info] "WebRequest: took 1.634 ms"
[2017-Nov-12 11:21:51.194] 447 - [info] "Wt: session created (#sessions = 3)"
[2017-Nov-12 11:21:51.194] 447 [/ gh3I0x9nVvZE5Lwp] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
[2017-Nov-12 11:21:51.194] 447 - [info] "Wt: session created (#sessions = 4)"
[2017-Nov-12 11:21:51.195] 447 [/ VU1vMnVu9Sa0QYSA] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
192.168.1.6 - - [2017-Nov-12 11:21:51.196] "GET /resources/themes/bootstrap/3/wt.css HTTP/1.1" 200 2254
[2017-Nov-12 11:21:51.196] 447 - [info] "WebRequest: took 1.603 ms"
192.168.1.6 - - [2017-Nov-12 11:21:51.196] "GET /resources/moz-transitions.css HTTP/1.1" 200 2238
[2017-Nov-12 11:21:51.196] 447 - [info] "WebRequest: took 1.647 ms"
[2017-Nov-12 11:21:51.197] 447 - [info] "Wt: session created (#sessions = 5)"
[2017-Nov-12 11:21:51.198] 447 [/ 9ErZryz5oH6gegiL] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
192.168.1.6 - - [2017-Nov-12 11:21:51.199] "GET /resources/themes/bootstrap/3/bootstrap-theme.min.css HTTP/1.1" 200 2260
[2017-Nov-12 11:21:51.199] 447 - [info] "WebRequest: took 1.665 ms"
RE: New Project, Spin Box, css settings - Added by Bruce Toll over 7 years ago
It looks like you might have your resources under the deploy-path. Are you using the ---deploy-path option? If so, can you try testing without it?
RE: New Project, Spin Box, css settings - Added by Mark Petryk over 7 years ago
This is all I have:
./dbo --docroot="docroot;resources" --http-listen 0.0.0.0:8070
Prior I had
./dbo --docroot="/docroot;resources" --http-listen 0.0.0.0:8070
RE: New Project, Spin Box, css settings - Added by Mark Petryk over 7 years ago
Koen had explained to me once the significance of calling out resource on the command line, and getting the session to return the resources from the same session... it's lost on me now.
RE: New Project, Spin Box, css settings - Added by Mark Petryk over 7 years ago
Ok I got it now:
192.168.1.6 - - [2017-Nov-12 15:38:41.799] "GET /?wtd=jy5tEBy0pTTnZOtP&sid=1354153235&webGL=true&scrW=1600&scrH=900&tz=-360&htmlHistory=true&deployPath=%2F&request=script&rand=1215228335 HTTP/1.1" 200 39518
[2017-Nov-12 15:38:41.799] 8078 - [info] "WebRequest: took 1233.23 ms"
192.168.1.6 - - [2017-Nov-12 15:38:41.895] "GET /resources/moz-transitions.css HTTP/1.1" 200 6277
192.168.1.6 - - [2017-Nov-12 15:38:41.899] "GET /resources/themes/bootstrap/3/bootstrap-theme.min.css HTTP/1.1" 200 23409
192.168.1.6 - - [2017-Nov-12 15:38:41.908] "GET /resources/themes/bootstrap/3/wt.css HTTP/1.1" 200 20179
192.168.1.6 - - [2017-Nov-12 15:38:41.924] "GET /resources/themes/bootstrap/3/bootstrap.css HTTP/1.1" 200 146010
192.168.1.6 - - [2017-Nov-12 15:38:42.079] "GET /resources/themes/bootstrap/3/spin-buttons.png HTTP/1.1" 200 557
192.168.1.6 - - [2017-Nov-12 15:38:42.160] "POST /?wtd=jy5tEBy0pTTnZOtP HTTP/1.1" 200 50
[2017-Nov-12 15:38:42.161] 8078 - [info] "WebRequest: took 0.434 ms"
From this:
./dbo --docroot="docroot;/resources" --http-listen 0.0.0.0:8070
...and I also moved the "resources" directory to be underneath docroot.
Thanks for the help.