Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSource Field Prompt Localization Issue

    Hello ,

    We are trying to localize DataSource field prompts but for some reason that`s not working .

    Here is our datasource xml...
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <DataSource ID="calendar" xmlns:fmt="WEB-INF/" tableName="ops_calendar" inheritsFrom="system" serverType="generic">
        <fmt:bundle basename="dictionary" />
        <title><fmt:message key="ops_calendar.label" /></title>
        <pluralTitle><fmt:message key="ops_calendar.label.plural"/></pluralTitle>
        <fields>
            <field name="name" type="text" length="100" required="true">
                <title><fmt:message key="ops_calendar.name.label"/></title>
                <prompt>Hello</prompt>
            </field>
    
            <field name="comments" type="text" length="100" >
                <title><fmt:message key="ops_calendar.comments.label"/></title>
                <prompt><fmt:message key="ops_calendar.comments.hint"/></prompt>
            </field>
    ...
    So the hardcoded value for the field "name" works fine ( I can see "Hello" on Hover Over), but the localized value for the field "comments" doesn`t work .
    Please see attached screenshot.

    We are using SmartGWTEE3.1 //// Isomorphic SmartClient/SmartGWT Framework SNAPSHOT_v8.3d_2012-07-04

    Thanks.
    Attached Files

    #2
    Have you recently run a GWT compile to refresh the files under war/sc? Stale files there could cause this.

    As the DataSource is loaded what are you seeing in the server-side logs?

    Comment


      #3
      I`ve tried everything:
      -deleting sc folder and rerunning GWT compile
      -running in Firefox and IE
      -running in development and production mode but still no luck

      No errors in the server log as the DataSource is being loaded
      Code:
      === 2012-07-05 23:19:58,549 [l0-0] DEBUG XML - Parsed XML from C:\Users\SS\workspace\com.stonebranch.opswise-old\war\ds\calendar.ds.xml: 4ms
      Here is what I see in the Firebug
      Code:
      isc.DataSource.create({
          allowAdvancedCriteria:true,
          "fmt:bundle":{
              basename:"dictionary"
          },
          fmt:"WEB-INF/",
          operationBindings:[
              {
                  operationType:"custom",
                  operationId:"copy"
              }
          ],
          serverType:"generic",
          inheritsFrom:"system",
          title:"Calendar",
          ID:"calendar",
          pluralTitle:"",
          fields:[
              {
                  title:"Name",
                  name:"name",
                  length:100,
                  prompt:"Hello",
                  type:"text",
                  required:true
              },
              {
                  title:"Description",
                  name:"comments",
                  length:100,
                  prompt:{
                      "fmt:message":{
                          key:"ops_calendar.comments.hint"
                      }
                  },
                  type:"text"
              },
      ...
      Title and PluralTitle are resolved properly, it`s just the "prompt" that doesn`t work.

      Thanks

      Comment


        #4
        Ah, we see the issue. "prompt" is not actually a documented property of DataSourceField, it's a mild hack to set it in your .ds.xml vs in the individual components where it applies. Regardless we've made a change to allow this to work - it will be in the next 3.1d / 8.3d build.

        Comment


          #5
          Great...thanks

          Comment


            #6
            Unfortunately it`s still not working .Tested with the latest build (SmartGWT EE 3.1d / SNAPSHOT_v8.3d_2012-07-08/EVAL )

            Thanks

            Comment


              #7
              Run a GWT compile after installing new .jars. If its still not working, verify that war/sc/DataSourceField.ds.xml has a declaration of the "prompt" property - if it doesn't you have staleness somewhere.

              Comment


                #8
                I refreshed everything . Deleted old sc folder / run GWT compile and "prompt" is not working.
                I checked DataSourceField.ds.xml and it doesn`t have a declaration for the "prompt" property.
                I`ve also looked at smartgwt jars ( http://www.smartclient.com/builds/SmartGWT/3.1d/EnterpriseEval ) from 07/07,07/08 and 07/09...none of them have "prompt" declared in the DataSourceField.ds.xml.

                Thanks

                Comment


                  #9
                  Our mistake, it was added to ListGridField.ds.xml, which wouldn't fix your usage. This is corrected for the next build, but remember that a GWT compile will be needed.

                  In the meantime, adding the following <field> to DataSourceField.ds.xml would enable i18n for the "prompt" attribute.

                  Code:
                  		<field name="prompt" type="string" xmlAttribute="true"/>

                  Comment


                    #10
                    In the latest build I see you made a change...
                    Code:
                     
                    	<field name="prompt" type="string" xmlAttribute="true"/>
                    but it still doesn`t work .

                    It works if I change it to:
                    Code:
                    	<prompt type="string" xmlAttribute="true"/>

                    Comment


                      #11
                      Quite right, the format shown before is correct for ListGridField.ds.xml but not for DataSourceField.ds.xml, which is one of a handful of special files.

                      Comment


                        #12
                        Interesting. Is it the case then that I can use xmlAttribute="true" to get the new and improved i18n (i.e., datasource i18n without jsp trickery) on custom datasource properties?

                        Comment


                          #13
                          It's not actually the xmlAttribute="true", it's declaring the field to be string type (as opposed to the field not being declared at all).

                          But yes, you could modify DataSourceField.ds.xml in order to add some more properties and make them eligible for i18n.

                          Comment


                            #14
                            Oh, now I see. I had read something into this that wasn't there. Thanks.

                            Comment

                            Working...
                            X