Css for panel
I have a component that extends panel. I need to add css customization to this panel. I can include the css in the over all site CSS, but I like to separate the CSS for this panel. For example, MyPanel.java MyPanel.html MyPanel.css I like to have MyPanel.css included in the header of the html when ever MyPanel is used. How do I do this with wicket 6.0 ?? Thank you. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Css for panel
Hi Actually I am pretty new with Wicket, but I give it a shot... :-) @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.renderCSSReference(YOUR_CSS_REF); } private static final ResourceReference YOUR_CSS_REF = new PackageResourceReference(... -Original Message- From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] Sent: 29 August 2012 19:20 To: users Subject: Css for panel I have a component that extends panel. I need to add css customization to this panel. I can include the css in the over all site CSS, but I like to separate the CSS for this panel. For example, MyPanel.java MyPanel.html MyPanel.css I like to have MyPanel.css included in the header of the html when ever MyPanel is used. How do I do this with wicket 6.0 ?? Thank you. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Css for panel
Thank you all. On Wed, Aug 29, 2012 at 1:49 PM, Paul Bors p...@bors.ws wrote: See Including CSS resources at: https://cwiki.apache.org/WICKET/including-css-resources.html This is also covered by all of the books on Wicket: http://wicket.apache.org/learn/books/ You should invest into such a Book. Personally I suggest Wicket in Action since its authors are Wicket developers and you see their names in many of the replies on those mailing lists :) http://wicket.apache.org/learn/books/wia.html ~ Thank you, Paul Bors -Original Message- From: ronny.v...@consult.nordea.com [mailto:ronny.v...@consult.nordea.com] Sent: Wednesday, August 29, 2012 1:31 PM To: users@wicket.apache.org Subject: RE: Css for panel Hi Actually I am pretty new with Wicket, but I give it a shot... :-) @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.renderCSSReference(YOUR_CSS_REF); } private static final ResourceReference YOUR_CSS_REF = new PackageResourceReference(... -Original Message- From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] Sent: 29 August 2012 19:20 To: users Subject: Css for panel I have a component that extends panel. I need to add css customization to this panel. I can include the css in the over all site CSS, but I like to separate the CSS for this panel. For example, MyPanel.java MyPanel.html MyPanel.css I like to have MyPanel.css included in the header of the html when ever MyPanel is used. How do I do this with wicket 6.0 ?? Thank you. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: IHeaderContributor#renderHead does not inject CSS on panel swap
I was not able to reproduce this with CSS and realized that the problem might be with injecting JavaScript on swapping. i also noticed the following errors in the log files: org.apache.wicket.protocol.http.PageExpiredException: No behaviors attached to component [MarkupContainer [Component id = mainMenuItemLink]] at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105) What could have caused these? I also inspected the page that has this problem in production with Firebug and noticed this in the head section: script id= src_=../../resources/ce/dealbook2.js $(document).ready(function() { $(a.fancy).fancybox({ 'width' : '75%', 'height' : '90%', 'autoScale' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'fade', 'type' : 'iframe' }); }); ; Wicket.functionExecuterCallbacks['script1'](); delete Wicket.functionExecuterCallbacks['script1']; /script The top of the file was written by us, but the last line was appended by Wicket. Could you explain what this is doing? Thanks, Alec On Thu, Sep 15, 2011 at 9:21 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: that should work, please create a quickstart. -igor On Thu, Sep 15, 2011 at 8:06 PM, Alec Swan alecs...@gmail.com wrote: Hello, Our app uses panel swapping as a tabbing implementation. I noticed that if I inject CSS using component.add(CSSPackageResource.getHeaderContribution(resourceRef, media)) during panel construction, then the CSS is included correctly and takes effect after the panel swap. However, if I inject the same CSS in IHeaderContributor#renderHead() using response.renderCSSReference(resourceRef, media) then CSS is not included after the panel swap and hence does not take effect. How can I get CSS injection to work in IHeaderContributor#renderHead()? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
IHeaderContributor#renderHead does not inject CSS on panel swap
Hello, Our app uses panel swapping as a tabbing implementation. I noticed that if I inject CSS using component.add(CSSPackageResource.getHeaderContribution(resourceRef, media)) during panel construction, then the CSS is included correctly and takes effect after the panel swap. However, if I inject the same CSS in IHeaderContributor#renderHead() using response.renderCSSReference(resourceRef, media) then CSS is not included after the panel swap and hence does not take effect. How can I get CSS injection to work in IHeaderContributor#renderHead()? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: IHeaderContributor#renderHead does not inject CSS on panel swap
that should work, please create a quickstart. -igor On Thu, Sep 15, 2011 at 8:06 PM, Alec Swan alecs...@gmail.com wrote: Hello, Our app uses panel swapping as a tabbing implementation. I noticed that if I inject CSS using component.add(CSSPackageResource.getHeaderContribution(resourceRef, media)) during panel construction, then the CSS is included correctly and takes effect after the panel swap. However, if I inject the same CSS in IHeaderContributor#renderHead() using response.renderCSSReference(resourceRef, media) then CSS is not included after the panel swap and hence does not take effect. How can I get CSS injection to work in IHeaderContributor#renderHead()? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Dynamically injecting CSS on panel swap
Hello, I have a page with multiple tabs which I implemented using AJAX-based panel-swapping approach. The CSS files are injected in the constructor of each panel using add(CSSPackageResource.getHeaderContribution(resourceRef, media)). This works for the first tab rendered. However, when another tab is selected the CSS file for that tab does not get dynamically injected and the tab uses the CSS file of the previous tab. What is the best way to swap CSS files in this situation? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamically injecting CSS on panel swap
Sounds like a bug. The expected behavior is to have the selected panel CSS dynamically injected. Please send us a quickstart reproducing the problem. On Mon, Apr 18, 2011 at 12:00 AM, Alec Swan alecs...@gmail.com wrote: Hello, I have a page with multiple tabs which I implemented using AJAX-based panel-swapping approach. The CSS files are injected in the constructor of each panel using add(CSSPackageResource.getHeaderContribution(resourceRef, media)). This works for the first tab rendered. However, when another tab is selected the CSS file for that tab does not get dynamically injected and the tab uses the CSS file of the previous tab. What is the best way to swap CSS files in this situation? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: Contributing CSS with Panel components?
On Jun 17, 2008, at 7:07 PM, Matej Knopp wrote: Wicket detects the CSS being rendered and should load the CSS on fly using ajax. Of course you will not see the css link in the page source because it has been added later (and you only see the initial source). Aha. Thanks, that was it. I had expected to see a link similar to those generated earlier in the page tree. -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Contributing CSS with Panel components?
Hmm, Google is not being helpful. Is there a way to contribute CSS when a Panel is added to a page? I like the idea of keeping the CSS with the related class and html file, but have not figured out if it is possible to add CSS at render time for components contained in the page. IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and UserDetailsPanel.css. If I include the panel in an AjaxTabbedPanel(), with UserDetailsPanel.java containing a HeaderContributor.forCss() pointing to UserDetailsPanel.css, the rendered page does not contain the css link. Frankly, this is what I would expect, given that the page header has already been rendered. Is this a circumstance in which I will need to contribute the CSS earlier in the process, or is there a mechanism that can be used to do this when the panel is rendered? -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Contributing CSS with Panel components?
Mind showing us some code? The pattern you are describing here is very common and it should work quite well. -Matej On Wed, Jun 18, 2008 at 12:55 AM, David Nedrow [EMAIL PROTECTED] wrote: Hmm, Google is not being helpful. Is there a way to contribute CSS when a Panel is added to a page? I like the idea of keeping the CSS with the related class and html file, but have not figured out if it is possible to add CSS at render time for components contained in the page. IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and UserDetailsPanel.css. If I include the panel in an AjaxTabbedPanel(), with UserDetailsPanel.java containing a HeaderContributor.forCss() pointing to UserDetailsPanel.css, the rendered page does not contain the css link. Frankly, this is what I would expect, given that the page header has already been rendered. Is this a circumstance in which I will need to contribute the CSS earlier in the process, or is there a mechanism that can be used to do this when the panel is rendered? -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Contributing CSS with Panel components?
how do you know css is not contributed after ajax? do you not see it applied or do you not see the link tag when you view source in the browser? what version of wicket? what version of browser? -igor On Tue, Jun 17, 2008 at 3:55 PM, David Nedrow [EMAIL PROTECTED] wrote: Hmm, Google is not being helpful. Is there a way to contribute CSS when a Panel is added to a page? I like the idea of keeping the CSS with the related class and html file, but have not figured out if it is possible to add CSS at render time for components contained in the page. IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and UserDetailsPanel.css. If I include the panel in an AjaxTabbedPanel(), with UserDetailsPanel.java containing a HeaderContributor.forCss() pointing to UserDetailsPanel.css, the rendered page does not contain the css link. Frankly, this is what I would expect, given that the page header has already been rendered. Is this a circumstance in which I will need to contribute the CSS earlier in the process, or is there a mechanism that can be used to do this when the panel is rendered? -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Contributing CSS with Panel components?
Wicket detects the CSS being rendered and should load the CSS on fly using ajax. Of course you will not see the css link in the page source because it has been added later (and you only see the initial source). You can try replacing AjaxTabbedPanel with the regular one to see if the styling works. If it does it might be problem with Ajax header contribution. -Matej On Wed, Jun 18, 2008 at 1:04 AM, Matej Knopp [EMAIL PROTECTED] wrote: Mind showing us some code? The pattern you are describing here is very common and it should work quite well. -Matej On Wed, Jun 18, 2008 at 12:55 AM, David Nedrow [EMAIL PROTECTED] wrote: Hmm, Google is not being helpful. Is there a way to contribute CSS when a Panel is added to a page? I like the idea of keeping the CSS with the related class and html file, but have not figured out if it is possible to add CSS at render time for components contained in the page. IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and UserDetailsPanel.css. If I include the panel in an AjaxTabbedPanel(), with UserDetailsPanel.java containing a HeaderContributor.forCss() pointing to UserDetailsPanel.css, the rendered page does not contain the css link. Frankly, this is what I would expect, given that the page header has already been rendered. Is this a circumstance in which I will need to contribute the CSS earlier in the process, or is there a mechanism that can be used to do this when the panel is rendered? -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]