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:
Also, a direct copy-paste from Showcase does not work:
Thank you very much for your help in advance!
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!");
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(); }
Comment