Announcement

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

    Skinning issues (moved from SmartClient Technical Q&A)

    First of all, I would like to thank Isomorphic Software for such a great development platform! Your hard work is evident is its quality, in the support you provide on this forum, and your professionalism in general! Also, I extend special appreciation to Sanjiv for his commitment to open source and expert contribution to GWT-based APIs! Thank you all very much time and again!

    Now turning to my questions on SmartGWT:

    1. One of the requirements for our application is a uniform font across all UI controls. Is there a way to achieve this by a global setting similar to the way custom scroll bars are turned off in load_skin.js? If not, what would you suggest to achieve this effect? I have tried placing the following CSS rule in skin_style.css:

    * { font-family: Arial, serif;font-size: 13px; }

    but it has only partially effect and only for non-UI fonts. For example, ListGrid headers are unaffected but rows (records) are affected only in font-size and not in font-family. Also, this rule works only if I bring up GWT Host Page manually as opposed to Hosted Mode.

    2. Setting a custom setErrorMessage string (unicode or ascii) does not show the error message upon validation but only shows a small exclamation mark icon. I do know it works in a Showcase that is online but it did not work for me neither in Hosted Mode nor in plain HTML, nor in a Showcase (build 1 or 2) that is downloaded. I had tried setting error message directly on form items and also setting up validators with their custom message and binding them to a DataSource but it simply does not appear before/after exclamation mark icon. Here is one variant of my code:
    Code:
            final DynamicForm form1 = new DynamicForm();
            TextItem textItem1 = new TextItem();
            textItem1.setTitle("Text");
            textItem1.setRequired(true);
            textItem1.setErrorOrientation(FormErrorOrientation.RIGHT);
            textItem1.setErrorMessage("Wrong input!");
    Also, a direct copy-paste from Showcase does not work:

    Code:
        public void onModuleLoad() {  
      
            final DynamicForm form = new DynamicForm();  
            form.setWidth(250);  
            form.setTitleOrientation(TitleOrientation.TOP);  
      
            ToolbarItem toolbarItem = new ToolbarItem();  
              
            IButton button = new IButton("First");          
            IButton button2 = new IButton("Second");          
            toolbarItem.setButtons(button, button2);  
      
            final RadioGroupItem radioGroupItem = new RadioGroupItem();  
            radioGroupItem.setName("willAttend");  
            radioGroupItem.setColSpan("*");  
            radioGroupItem.setRequired(true);  
            radioGroupItem.setVertical(false);  
            radioGroupItem.setValueMap("Yes", "No");  
            radioGroupItem.setRedrawOnChange(true);  
            radioGroupItem.setTitle("Will you be attending the meeting on April 4th? If no, please provide a reason");  
      
            TextItem textItem = new TextItem();  
            textItem.setName("reason");  
            textItem.setTitle("Reason");  
            RequiredIfValidator ifValidator = new RequiredIfValidator();  
            ifValidator.setExpression(new RequiredIfFunction() {  
                public boolean execute(FormItem formItem, Object value) {  
                    String valueStr = (String) radioGroupItem.getValue();  
                    return "No".equals(valueStr);  
                }  
            });  
            ifValidator.setErrorMessage("Please provide a reason");  
      
            textItem.setValidators(ifValidator);  
      
            ButtonItem buttonItem = new ButtonItem("validate", "Validate");  
            buttonItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {  
                public void onClick(ClickEvent event) {  
                    form.validate();  
                }  
            });  
      
            form.setFields(toolbarItem, radioGroupItem, textItem, buttonItem);  
            form.draw();  
        }
    Thank you very much for your help in advance!
    Last edited by smart.code; 19 Feb 2009, 03:15. Reason: Please move this post to SmartGWT Technical Q&A forum. Thank you!

    #2
    Uniform font within entire app and setErrorMessage.

    I am sorry, I intended to post this message on SmartGWT Technical Q&A forum. I still need help with these and hope that it won't stay here unnoticed. Thank you.

    Comment


      #3
      We shifted this over to the relevant forum.

      Thanks for the kind words - we really appreciate it.

      To answer your questions:
      - The reason your change isn't being applied to all components is that the styles applied to the various components are typically pretty full - for example we often explicitly specify font-family / size etc, which would be applied on top of the global settings you're applying.
      You may want to create your own new skin directory (duplicate and rename the existing one), and then use search-and-replace to specify your desired font-family wherever is appropriate.
      You may find that you need to make some additional changes to ensure that everything shows up as you intended - for example changing the font size for cells in a ListGrid won't automatically change the cellHeight - which may or may not be acceptable depending on the change you make.

      - The default value of showErrorText has recently changed so validation errors are only shown when you hover over the error icon by default - you can change this value to true to show the errors next to the form item directly

      Comment

      Working...
      X