Here's the code example (from edited showcase):
As you can see I added SelectItem with faked DataSource.
If you click on this item you will see ALWAYS English string "No items to show". This happened in all languages.
The string is coming from:
SmartGwtMessages.properties file:
I checked the same string in SmartGwtMessages_fr.properties
it exist there as well as in Portuguese - Brasil : SmartGwtMessages_pt_BR.properties
As well I checked German and Dutch - the string exist in all languages translation, but somehow only English text is used for the SelectItem.
See the attached image for the outlook.
SmartClient Version: v9.0p_2014-04-23/PowerEdition Deployment (built 2014-04-23)
Code:
/* * Isomorphic SmartGWT web presentation layer * Copyright 2000 and beyond Isomorphic Software, Inc. * * OWNERSHIP NOTICE * Isomorphic Software owns and reserves all rights not expressly granted in this source code, * including all intellectual property rights to the structure, sequence, and format of this code * and to all designs, interfaces, algorithms, schema, protocols, and inventions expressed herein. * * If you have any questions, please email <sourcecode@isomorphic.com>. * * This entire comment must accompany any portion of Isomorphic Software source code that is * copied or moved from this file. */ package com.smartgwt.sample.showcase.client.dataintegration.java.hibernate.relations; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.types.ListGridEditEvent; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.sample.showcase.client.PanelFactory; import com.smartgwt.sample.showcase.client.ShowcasePanel; import com.smartgwt.sample.showcase.client.SourceEntity; public class HBIncludeFrom extends ShowcasePanel { private static final String DESCRIPTION = "You can include fields from related data sources. Just declare a field with \"includeFrom\" " + "property pointing to field in related data source. Target field can be included from another " + "data srouce. For example City DS includes field \"continentNam\" from Country DS which is " + "included from Continent DS." + "<p/>" + "You can specify a different field name or you can omit it. In this case field name will default " + "to the name of the included field."; public static class Factory implements PanelFactory { private String id; public Canvas create() { HBIncludeFrom panel = new HBIncludeFrom(); id = panel.getID(); return panel; } public String getID() { return id; } public String getDescription() { return DESCRIPTION; } } protected boolean isTopIntro() { return true; } public Canvas getViewPanel() { final ListGrid listGrid = new ListGrid(); listGrid.setDataSource(DataSource.get("cityIncludeFromHB")); listGrid.setWidth(700); listGrid.setHeight(224); listGrid.setShowFilterEditor(true); listGrid.setAlternateRecordStyles(true); listGrid.setAutoFetchData(true); listGrid.setDataPageSize(50); listGrid.setCanEdit(true); listGrid.setEditEvent(ListGridEditEvent.CLICK); listGrid.setFields(new ListGridField("cityName", "City"), new ListGridField("country", "Country") {{ setDisplayField("countryName"); setEditorType(new ComboBoxItem() {{ setValueField("countryId"); setOptionDataSource(DataSource.get("countryIncludeFromHB")); }}); }}, new ListGridField("continent", "Continent")); //Here's the probem ================= DataSource dataSource = new DataSource(); dataSource.setID("fakeId"); dataSource.setClientOnly(true); final SelectItem test = new SelectItem( "MyName", "My english title"); test.setRequired(true); test.setOptionDataSource(dataSource); DynamicForm form = new DynamicForm(); form.setItems(test); //================================== VLayout layout = new VLayout(15); layout.addMember(listGrid); layout.addMember(form); return layout; } public String getIntro() { return DESCRIPTION; } public SourceEntity[] getSourceUrls() { // Do not remove commented lines. // Forces GenerateSourceFiles to generate DataURLRecords for both data sources. // Generated DataURLRecords are used in 'View source' window for showing data source configuration. // DataSource.get("cityIncludeFromHB"); // DataSource.get("countryIncludeFromHB"); // DataSource.get("continentIncludeFromHB"); return new SourceEntity[]{ new SourceEntity("CityManyToOneSimple.java", JAVA, "source/beans/CityManyToOneSimple.java.html", true), new SourceEntity("CountryManyToOneSimple.java", JAVA, "source/beans/CountryManyToOneSimple.java.html", true), new SourceEntity("ContinentManyToOneSimple.java", JAVA, "source/beans/ContinentManyToOneSimple.java.html", true) }; } }
If you click on this item you will see ALWAYS English string "No items to show". This happened in all languages.
The string is coming from:
SmartGwtMessages.properties file:
Code:
listGrid_emptyMessage=No items to show.
Code:
listGrid_emptyMessage=Aucune donn\u00e9e \u00e0 afficher.
Code:
listGrid_emptyMessage=N\u00e3o existem itens para mostrar.
See the attached image for the outlook.
SmartClient Version: v9.0p_2014-04-23/PowerEdition Deployment (built 2014-04-23)
Comment