AjaxDateTimePicker as ajax target in page does not find header css files

17 views
Skip to first unread message

Oliver Becherer

unread,
Jul 26, 2017, 10:29:25 AM7/26/17
to wicket-jquery-ui
hi,

i'm using wicket-kendo ui 7.4.0 in a project where ajax date time picker(s) are not visible at initial page render time.

Based on an AjaxLink click, a panel containing the pickers gets visible along with the kendo components. ( ajaxtarget is only the panel, not the complete page...)

my problem :

The CSS from page header is not applied as long as not the whole page is rendered.

Is there a workaround for this issue?

Best regards

Oliver

Martin Grigorov

unread,
Jul 26, 2017, 10:32:30 AM7/26/17
to wicket-j...@googlegroups.com
Hi,

There must be another problem.
A .css file which is already loaded in the page should affect all HTML elements, no matter whether they are added with the page or later with Ajax.

--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-ui+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wicket-jquery-ui/b81a4086-9bff-45cd-9281-3459d99b815e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sebastien

unread,
Jul 26, 2017, 10:51:05 AM7/26/17
to wicket-j...@googlegroups.com
Hi Oliver,

Agree with Martin.
Just a couple of questions: are you hardcoding the css ref in the HTML header ? Because you use a custom theme ?
If you are using a builtin theme, can you give a try to the maven theme dependency instead (like wicket-kendo-ui-theme-default) ?


Oliver Becherer

unread,
Jul 28, 2017, 3:24:52 AM7/28/17
to wicket-jquery-ui
hi all,

thanks for your feedback.

@ Sebastien :  i am using wicket-kendo-ui-theme-default as dependency and the CSS files are not added static in the header - it seems as if they are contributed during components render phase ( so if they are not visible initially, the page header
contribution takes place as soon as these components are rendered - but that seems to be to late, since not the complete page is in ajaxtarget...)

@Martin  : that seems to be the problem. When Page is rendered, no AjaxDateTimePicker is rendered, no header css. When setting AjaxDateTimePickers to visible ( surrounding panel ), Page itself is not in ajax target and components dont seem
to find the css files in header.

Is there a possibility to contribute the theme css files to the header programatically, so they are already rendered bevor the components get visible?

Best regards and thanks for your support!


Oliver

Martin Grigorov

unread,
Jul 28, 2017, 3:36:05 AM7/28/17
to wicket-j...@googlegroups.com
Hi,

I just quickly checked [Ajax]DateTimePicker (both local and non-local) versions and they do not have #renderHead() overridden to contribute their dependencies.
Maybe I've missed some Behavior that does this for them...
But if a Wicket component is rendered, no matter whether it is Ajax request or not, then #renderHead() is executed and the CSS/JS contributions are added to page's <head>.

I'm sure Sebastien will either explain what I've missed or will provide a solution in no time! :-)

--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-ui+unsubscribe@googlegroups.com.

Sebastien

unread,
Jul 28, 2017, 4:01:22 AM7/28/17
to wicket-j...@googlegroups.com
Hi Olivier & Martin,

@Olivier, this seems not logical at all... Could it be a javascript error you didn't saw yet? (that could prevent the widget to not render properly). Could you please double check using the dev tools? Still using the dev tool (or the ajax debug window), please give me the response of the ajax call (or best create a quickstart so I can have a better look)

@Martin,
The rendering of a widget is performed by its underlying behavior

The core:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-core/src/main/java/com/googlecode/wicket/jquery/core/JQueryAbstractBehavior.java#L101

For Kendo UI widgets
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-kendo-ui/src/main/java/com/googlecode/wicket/kendo/ui/KendoUIBehavior.java#L80


Oliver Becherer

unread,
Jul 28, 2017, 1:36:01 PM7/28/17
to wicket-jquery-ui
Hi,

i'll try to reproduce this in a quickstart and post it on weekend.

best regards and thanks for your advice!

O
Reply all
Reply to author
Forward
0 new messages