Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 62E9B9876 for ; Wed, 17 Dec 2014 11:13:36 +0000 (UTC) Received: (qmail 55907 invoked by uid 500); 17 Dec 2014 11:13:35 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 55865 invoked by uid 500); 17 Dec 2014 11:13:35 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 55852 invoked by uid 99); 17 Dec 2014 11:13:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2014 11:13:33 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of francois.meillet@gmail.com does not designate 212.27.42.6 as permitted sender) Received: from [212.27.42.6] (HELO smtp6-g21.free.fr) (212.27.42.6) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2014 11:13:29 +0000 Received: from [192.168.1.100] (unknown [88.166.6.100]) by smtp6-g21.free.fr (Postfix) with ESMTP id BFE31822A5 for ; Wed, 17 Dec 2014 12:12:23 +0100 (CET) From: Francois Meillet Content-Type: multipart/alternative; boundary="Apple-Mail=_D9E2215A-6281-4BE8-AAFC-4881FBF4644D" Message-Id: <6D119055-B73A-41CB-B479-2D1D1EFB38CE@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: submenu in NavbarDropDownButton Date: Wed, 17 Dec 2014 12:13:06 +0100 References: To: users@wicket.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1878.6) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_D9E2215A-6281-4BE8-AAFC-4881FBF4644D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 which is ? Fran=C3=A7ois Meillet Formation Wicket - D=C3=A9veloppement Wicket Le 17 d=C3=A9c. 2014 =C3=A0 12:11, Hasan =C3=87elik = a =C3=A9crit : > there is a compile error on the first image.. >=20 >=20 >=20 > Web Sitesi : www.ab-hibe.com > E-mail: hasancelik@berkadem.com > E-mail: info@ab-hibe.com > Gsm1: 0 544 640 96 25 > Adres : 1271. Sokak 33/14 Sabri Mermutlu =C4=B0=C5=9F Merkezi Balgat = Ankara >=20 > On 17 December 2014 at 13:03, Francois Meillet = > wrote: >>=20 >> What is the error, any stacktrace ? >>=20 >> Fran=C3=A7ois Meillet >> Formation Wicket - D=C3=A9veloppement Wicket >>=20 >>=20 >>=20 >>=20 >>=20 >> Le 17 d=C3=A9c. 2014 =C3=A0 11:55, Hasan =C3=87elik = a =C3=A9crit : >>=20 >>> Thanks Martin, >>>=20 >>> I am newbie for wicket... It may be easy error for you but I didn't >> understand...Why am I getting this error? Which dependencies should I = add >> in pom.xml ? >>>=20 >>>=20 >>>=20 >>> If I change the codes like that, I am getting error, >>> =E2=80=8B >>>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>> Web Sitesi : www.ab-hibe.com >>> E-mail: hasancelik@berkadem.com >>> E-mail: info@ab-hibe.com >>> Gsm1: 0 544 640 96 25 >>> Adres : 1271. Sokak 33/14 Sabri Mermutlu =C4=B0=C5=9F Merkezi Balgat = Ankara >>>=20 >>> On 17 December 2014 at 10:13, Martin Grigorov >> wrote: >>> I guess his code just uses Wicket's CookieUtils class. >>> See >>>=20 >> = https://github.com/apache/isis/blob/master/component/viewer/wicket/ui/src/= main/java/org/apache/isis/viewer/wicket/ui/components/widgets/themepicker/= ThemeChooser.java#L94-L105 >>> for example. >>>=20 >>> Martin Grigorov >>> Wicket Training and Consulting >>> https://twitter.com/mtgrigorov >>>=20 >>> On Wed, Dec 17, 2014 at 10:05 AM, Hasan =C3=87elik = >> wrote: >>>>=20 >>>> Thanks for reply, >>>>=20 >>>> Can you give detail about getCookieUtils() and >> CCA_LANGUAGE_COOKIE_NAME in >>>> your CcaWebApplication class >>>>=20 >>>> Regards, >>>>=20 >>>>=20 >>>>=20 >>>> On 17 December 2014 at 09:06, Richter, Marvin < >>>> Marvin.Richter@freenetdigital.com> wrote: >>>>>=20 >>>>> Hey, I have something like that implemented in the following way: >>>>>=20 >>>>> @Override >>>>> protected List = newSubMenuButtons(String >>>>> buttonMarkupId) { >>>>> List languages =3D new >>>>> ArrayList(); >>>>> languages.add(newLanguageOption(buttonMarkupId, >>>> "de")); >>>>> languages.add(newLanguageOption(buttonMarkupId, >>>> "en")); >>>>> return languages; >>>>> } >>>>>=20 >>>>> And the newLanguageOption method looks like this: >>>>>=20 >>>>> private Link newLanguageOption(final String buttonMarkupId, >> final >>>>> String localeString) { >>>>> Link languageOptionLink =3D new >> Link(buttonMarkupId) { >>>>>=20 >>>>> private static final long serialVersionUID =3D >>>>> -1704794810431937803L; >>>>>=20 >>>>> @Override >>>>> public void onClick() { >>>>> Locale locale =3D new Locale(localeString); >>>>>=20 >>>>>=20 >>>>=20 >> = CcaWebApplication.get().getCookieUtils().save(CcaWebApplication.CCA_LANGUA= GE_COOKIE_NAME, >>>>> locale.toString()); >>>>> getSession().setLocale(locale); >>>>> } >>>>>=20 >>>>> @Override >>>>> public void onComponentTagBody(MarkupStream >> markupStream, >>>>> ComponentTag openTag) { >>>>> replaceComponentTagBody(markupStream, openTag, >>>>> getString(localeString)); >>>>> } >>>>> }; >>>>> return languageOptionLink; >>>>> } >>>>>=20 >>>>> Hope that helps. >>>>>=20 >>>>> Best, >>>>> Marvin >>>>>=20 >>>>> -----Original Message----- >>>>> From: Hasan =C3=87elik [mailto:hsnclk1985@gmail.com] >>>>> Sent: Wednesday, December 17, 2014 7:46 AM >>>>> To: users@wicket.apache.org >>>>> Subject: submenu in NavbarDropDownButton >>>>>=20 >>>>> Hi, >>>>>=20 >>>>> I have a question about usage of navbar components.. I tried to = make >>>>> Multilingual website, actually I did... when I put language = buttons >> in a >>>>> wicket panel, It works...In this example I try to put these = language >>>>> buttons into dropdown submenu.. First I did one Multilanguage = class >> and >>>>> this class was taking a parameter...This parameter was about = Locale >>>>> String(like "en")..In this way I didn't succeed to take parameter = in >> the >>>>> submenu declaration,like that >>>>>=20 >>>>> subMenu.add(new MenuBookmarkablePageLink(new >>>>> MultiLanguage("en"), >>>>> Model.of("Turkish")).setIconType(GlyphIconType.refresh)); >>>>>=20 >>>>> I know that declaration (new MultiLanguage("en")) is wrong but I >> wanted >>>> to >>>>> do like that...Anyway After that I have changed the method >> construction >>>> as >>>>> the following.. But in this way I have to create different >> Multilanguage >>>>> class for every diffent language. My question is, Is there a way = to >>>> create >>>>> construction for submenu declaration like that..(*subMenu.add(new >>>>> MenuBookmarkablePageLink(new >>>>> MultiLanguage("en"), >>>>> Model.of("Turkish")).setIconType(GlyphIconType.refresh));*) >>>>>=20 >>>>>=20 >>>>> DropDownButton dropdown =3D new = NavbarDropDownButton(Model.of("Choose >>>>> Language")) { >>>>> @Override >>>>> public boolean isActive(Component item) { >>>>> return false; >>>>> } >>>>>=20 >>>>> @Override >>>>> protected List newSubMenuButtons(final String >>>>> buttonMarkupId) { >>>>> final List subMenu =3D new >> ArrayList(); >>>>> subMenu.add(new >>>>> MenuBookmarkablePageLink(MultiLanguage.class, >>>>> Model.of("Turkish")).setIconType(GlyphIconType.*flag*)); >>>>> subMenu.add(new >>>>> MenuBookmarkablePageLink(MultiLanguage2.class, >>>>> Model.of("English")).setIconType(GlyphIconType.*flag*)); >>>>>=20 >>>>> return subMenu; >>>>> } >>>>> }.setIconType(GlyphIconType.book); >>>>>=20 >>>>> navbar.addComponents(new ImmutableNavbarComponent(dropdown, >>>>> Navbar.ComponentPosition.RIGHT)); >>>>>=20 >>>>> return navbar; >>>>>=20 >>>>>=20 >>>>> -------------------------------------------------- >>>>>=20 >>>>>=20 >>>>> public class MultiLanguage extends BasePage2 { >>>>> public MultiLanguage(){ >>>>> super(new PageParameters()); >>>>> changeUserLocaleTo("en"); >>>>> } >>>>> private void changeUserLocaleTo(String localeString) { >>>>> getSession().setLocale(new Locale(localeString)); >>>>>=20 >>>>> Cookie languageCookie =3D new >>>>> Cookie(WicketApplication.LANGUAGE_COOKIE_NAME, localeString); >>>>>=20 >> languageCookie.setMaxAge(WicketApplication.LANGUAGE_COOKIE_AGE); >>>>> ((WebResponse)getResponse()).addCookie(languageCookie); >>>>> } >>>>> } >>>>>=20 >>>>> public class MultiLanguage1 extends BasePage2 { >>>>> public MultiLanguage(){ >>>>> super(new PageParameters()); >>>>> changeUserLocaleTo("tr"); >>>>> } >>>>> private void changeUserLocaleTo(String localeString) { >>>>> getSession().setLocale(new Locale(localeString)); >>>>>=20 >>>>> Cookie languageCookie =3D new >>>>> Cookie(WicketApplication.LANGUAGE_COOKIE_NAME, localeString); >>>>>=20 >> languageCookie.setMaxAge(WicketApplication.LANGUAGE_COOKIE_AGE); >>>>> ((WebResponse)getResponse()).addCookie(languageCookie); >>>>> } >>>>> } >>>>>=20 >>>>> = --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org >>>>> For additional commands, e-mail: users-help@wicket.apache.org >>>>>=20 >>>>>=20 >>>>=20 >>=20 >>=20 --Apple-Mail=_D9E2215A-6281-4BE8-AAFC-4881FBF4644D--