Re: Line breaks and label
hmm...sorry, i don't understand what you mean. Here a small example how to implement this. HTML-Template: span wicket:id=myspan class=nowrap/span CSS: .nowrap {white-space:nowrap;} Java: add(new Label(myspan, new ModelString(Some long Text...)); Hope it helps. :) Witold Am Thu, 22 Jul 2010 22:42:23 -0700 (PDT) schrieb Nii Amon Dsane jaz...@gmail.com: Hi Witold, I noticed something. When I was using tags to embed strings in to the markup, the CSS wasn't applied but when I tried it with a div the styles were applied. Is this expected behaviour? nii amon - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Line breaks and label
This is not a wicket problem, but rather a browser rendering issue. Use nbsp; instead of whitespace. Martijn On Thu, Jul 22, 2010 at 5:47 AM, Nii Amon Dsane jaz...@gmail.com wrote: Hello, I have a label that's displayed on a page. The label displays but with a linebreak and this breaks the sentence that I am writing. How do I get rid of the line break after the label? My code is below (the problematic label is svcName): List list = getServices(); ListView listview = new ListView(servicesList, list) { protected void populateItem(ListItem item) { Service svc = (Service) item.getModelObject(); final String svcUrl = svc.svcUrl(); String svcName = svc.getName(); String count = Hits: + svc.count(); Link svcLink = new Link(svcUrl) { @Override public void onClick() {} @Override protected void onComponentTag(final ComponentTag tag) { tag.put(href, svcUrl); } }; svcLink.add(new Label(svcName, svcName)); item.add(svcLink); item.add(new Label(svcHits, count)); } }; add(listview); And this is my HTML view (the problematic label is svcName): ul class=projects li wicket:id=servicesList a wicket:id=svcUrlspan wicket:id=svcName//a span a href=/svcStatsspan wicket:id=svcHits//a | a href=/svcEditEdit/a | a href=/svcStatToggleDeactivate/a | a href=/svcDelDelete/a /span /li /ul Many thanks nii amon I never see what has been done; I only see what remains to be done - Buddha -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Line breaks and label
Or use in CSS: white-space:nowrap; Witold Am Thu, 22 Jul 2010 11:56:57 +0200 schrieb Martijn Dashorst martijn.dasho...@gmail.com: This is not a wicket problem, but rather a browser rendering issue. Use nbsp; instead of whitespace. Martijn On Thu, Jul 22, 2010 at 5:47 AM, Nii Amon Dsane jaz...@gmail.com wrote: Hello, I have a label that's displayed on a page. The label displays but with a linebreak and this breaks the sentence that I am writing. How do I get rid of the line break after the label? My code is below (the problematic label is svcName): List list = getServices(); ListView listview = new ListView(servicesList, list) { protected void populateItem(ListItem item) { Service svc = (Service) item.getModelObject(); final String svcUrl = svc.svcUrl(); String svcName = svc.getName(); String count = Hits: + svc.count(); Link svcLink = new Link(svcUrl) { @Override public void onClick() {} @Override protected void onComponentTag(final ComponentTag tag) { tag.put(href, svcUrl); } }; svcLink.add(new Label(svcName, svcName)); item.add(svcLink); item.add(new Label(svcHits, count)); } }; add(listview); And this is my HTML view (the problematic label is svcName): ul class=projects li wicket:id=servicesList a wicket:id=svcUrlspan wicket:id=svcName//a span a href=/svcStatsspan wicket:id=svcHits//a | a href=/svcEditEdit/a | a href=/svcStatToggleDeactivate/a | a href=/svcDelDelete/a /span /li /ul Many thanks nii amon I never see what has been done; I only see what remains to be done - Buddha - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Line breaks and label
Hi Martijn, many thanks for the response. The linebreaks are not being applied on whitespaces. I am using spans with wicket:id to write out some strings in my markup. The strings are displayed alright but I notice that the linebreaks are applied before and after the string. For instance, I have a label: item.add(new Label(svcHits, count)); // count is some string When I display this is in my markup: /svcStats it writes a linebreak before and after so that the svcHits string appears on a line by itself. So I cannot use nbsp to fix it. nii amon -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Line-breaks-and-label-tp2298095p2298886.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Line breaks and label
Hi Witold, I must be doing something very wrong because the CSS doesn't work on any tag that has wicket:id! I checked the Pro Wicket book and apparently if you put your CSS files into the head of the markup file, the styles are going to apply. In my case the styles apply to all tags which do not have the wicket:id set on them. Quite strange! nii amon -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Line-breaks-and-label-tp2298095p2298899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Line breaks and label
Hi Witold, I noticed something. When I was using tags to embed strings in to the markup, the CSS wasn't applied but when I tried it with a div the styles were applied. Is this expected behaviour? nii amon -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Line-breaks-and-label-tp2298095p2299726.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Line breaks and label
Hello, I have a label that's displayed on a page. The label displays but with a linebreak and this breaks the sentence that I am writing. How do I get rid of the line break after the label? My code is below (the problematic label is svcName): List list = getServices(); ListView listview = new ListView(servicesList, list) { protected void populateItem(ListItem item) { Service svc = (Service) item.getModelObject(); final String svcUrl = svc.svcUrl(); String svcName = svc.getName(); String count = Hits: + svc.count(); Link svcLink = new Link(svcUrl) { @Override public void onClick() {} @Override protected void onComponentTag(final ComponentTag tag) { tag.put(href, svcUrl); } }; svcLink.add(new Label(svcName, svcName)); item.add(svcLink); item.add(new Label(svcHits, count)); } }; add(listview); And this is my HTML view (the problematic label is svcName): ul class=projects li wicket:id=servicesList a wicket:id=svcUrlspan wicket:id=svcName//a span a href=/svcStatsspan wicket:id=svcHits//a | a href=/svcEditEdit/a | a href=/svcStatToggleDeactivate/a | a href=/svcDelDelete/a /span /li /ul Many thanks nii amon I never see what has been done; I only see what remains to be done - Buddha