Announcement

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

    RPCManager.loadScreen: HeaderContextMenu and UTF8 bug

    Using:
    SmartClient Version: v8.3_2012-11-20/Pro Deployment (built 2012-11-20)
    Browsers: IE9, FF19 or Chrome

    I'm having two problems with the RPCManager.loadScreen methods:
    1) I can't render some characters (like "á ã ú ü ô").
    2) I can't click on the Listgrid HeaderContextMenu. It don't show up when I hover my mouse over where it shoud be. But when I hover over the field text it show up.

    When I use a VisualBuilder screen like this one ("test.ui.xml"):
    Code:
    <ToolStripButton ID="ToolStripButtonAdd" autoDraw="false">
        <title>Chars: á ã ú ü ô</title>
        <click>
        	<target>ListGridAbertura</target>
        	<name>startEditingNew</name>
        	<title>Start Editing New</title>
        </click>
    </ToolStripButton>
    
    
    <ToolStrip ID="ToolStrip1" autoDraw="false">
        <members><Canvas ref="ToolStripButtonAdd"/>
        </members>
        <visibilityMode>multiple</visibilityMode>
    </ToolStrip>
    
    
    <ListGrid autoFetchData="false" ID="ListGridTest" autoDraw="false">
        <fields>
            <ListGridField name="Field1" title="Field1"/>
        </fields>
        <showFilterEditor>true</showFilterEditor>
        <canEdit>true</canEdit>
        <canRemoveRecords>true</canRemoveRecords>
    </ListGrid>
    
    
    <VLayout ID="test" autoDraw="false">
        <members><Canvas ref="ToolStrip1"/><Canvas ref="ListGridTest"/>
        </members>
    </VLayout>
    
    
    <DataView ID="DataViewTest" width="100%" height="100%" overflow="hidden" autoDraw="true">
        <members><Canvas ref="test"/>
        </members>
        <modulesDir>modules/</modulesDir>
    </DataView>
    I'm using the java code:
    Code:
        public void onModuleLoad() {
    
            final VLayout mainCanvas = new VLayout();
            mainCanvas.setHeight100();
            mainCanvas.setWidth100();
            
            final Dialog dummyDialog = new Dialog();
    
    
            com.smartgwt.client.widgets.Button loadScreenButton = new com.smartgwt.client.widgets.Button("Load Screen");
            mainCanvas.addMember(loadScreenButton);
            loadScreenButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                @Override
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                    SC.askforValue("Load Screen View", "Type ScreenView Name (<screenView>.ui.xml or <screenView>.js)", "test", new ValueCallback() {
                        @Override
                        public void execute(final String value) {
                            RPCManager.loadScreen(value, new LoadScreenCallback() {
                                @Override
                                public void execute() {
                                    Canvas c = Canvas.getById(value);
    
                                    if (c == null) {
                                        SC.say("Screen not found: [" + value + "]");
                                    } else {
                                        mainCanvas.addMember(c);
                                    }
                                }
                            }, new String[]{value});
                        }
                    }, dummyDialog);
                }
            });
    
            mainCanvas.draw();
    
        }
    It does happens only if I add the <screen>.ui.xml file contents under a Layout.

    NOTE: it also happens with SmartGWT4 Pro.
    Attached Files

    #2
    Answering my own question about the Listgrid HeaderContextMenu:

    I could fix it changing the autodraw property of the ListGrid to false:
    Code:
    <DataView ID="DataViewTest" width="100%" height="100%" overflow="hidden" autoDraw="false">

    Comment


      #3
      On the i18n issue, take a look at the Internationalization overview in the docs. There's a bunch of advice there about how to make sure your file the servlet engine uses UTF8.

      Comment


        #4
        Isomorphic,

        is it possible to configure the ScreenLoaderServlet with the same parameters used in the DataSourceLoader?

        Something like:
        Code:
         <servlet>
           <servlet-name>DataSourceLoader</servlet-name>
           <servlet-class>com.isomorphic.servlet.DataSourceLoader</servlet-class>
           <init-param>
             <param-name>encoding</param-name>
             <param-value>some-other-encoding</param-value>
           </init-param>
         </servlet>

        Comment


          #5
          There's no need to do this, because it defaults to UTF8 already. See the Internationalization overview.

          Comment

          Working...
          X