Return-Path: X-Original-To: apmail-myfaces-commits-archive@www.apache.org Delivered-To: apmail-myfaces-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1973011BEF for ; Wed, 2 Jul 2014 11:36:41 +0000 (UTC) Received: (qmail 88374 invoked by uid 500); 2 Jul 2014 11:36:41 -0000 Delivered-To: apmail-myfaces-commits-archive@myfaces.apache.org Received: (qmail 88309 invoked by uid 500); 2 Jul 2014 11:36:40 -0000 Mailing-List: contact commits-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list commits@myfaces.apache.org Received: (qmail 88300 invoked by uid 99); 2 Jul 2014 11:36:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 11:36:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 11:36:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 771C52388B1B; Wed, 2 Jul 2014 11:36:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1607323 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-example: tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ tobago-exam... Date: Wed, 02 Jul 2014 11:36:19 -0000 To: commits@myfaces.apache.org From: lofwyr@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140702113619.771C52388B1B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lofwyr Date: Wed Jul 2 11:36:18 2014 New Revision: 1607323 URL: http://svn.apache.org/r1607323 Log: example: no default locale may set Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java?rev=1607323&r1=1607322&r2=1607323&view=diff ============================================================================== --- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java (original) +++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java Wed Jul 2 11:36:18 2014 @@ -117,7 +117,7 @@ public class ClientConfigController { // If the default is already in the list, don't add it. // Background: Must the default be in the supported list? Yes or No? // This question is not specified explicit and different implemented in the RI and MyFaces - if (!defaultInList) { + if (!defaultInList && defaultLocale != null) { localeItems.add(0, createLocaleItem(defaultLocale)); } return localeItems; Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java?rev=1607323&r1=1607322&r2=1607323&view=diff ============================================================================== --- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java (original) +++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java Wed Jul 2 11:36:18 2014 @@ -86,11 +86,20 @@ public class ClientConfigController { final Locale defaultLocale = application.getDefaultLocale(); final Iterator supportedLocales = application.getSupportedLocales(); + boolean defaultInList = false; final List localeItems = new ArrayList(); - localeItems.add(createLocaleItem(defaultLocale)); while (supportedLocales.hasNext()) { final Locale locale = (Locale) supportedLocales.next(); localeItems.add(createLocaleItem(locale)); + if (locale.equals(defaultLocale)) { + defaultInList = true; + } + } + // If the default is already in the list, don't add it. + // Background: Must the default be in the supported list? Yes or No? + // This question is not specified explicit and different implemented in the RI and MyFaces + if (!defaultInList && defaultLocale != null) { + localeItems.add(0, createLocaleItem(defaultLocale)); } return localeItems; } Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml?rev=1607323&r1=1607322&r2=1607323&view=diff ============================================================================== --- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml (original) +++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml Wed Jul 2 11:36:18 2014 @@ -31,18 +31,23 @@ - + - + - + + + + + +