I looked for a long time what was the matter, minimized the program and this is what happened:

package ru.ig.thdr.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.widgets.form.fields.ButtonItem; public class Thdr implements EntryPoint { public void onModuleLoad() { System.out.println("Start"); ButtonItem bi = new ButtonItem("Button Item"); System.out.println("End"); } } 

It does not issue a trace (the infection does not paste from Eclipse), the meaning is as follows:

 Unable to load module entry point ... java.lang.AssertionError: Invalid FormItem name. Cannot use spaces in FormItem name 

It falls on the new ButtonItem ("Button Item") ;. The error is clear ( space in the name ) for the FormItem.

The question is actually this - is it in all versions such garbage or did I get it? (Smart GWT 2.5)

Actually, it got me so stuck, because (fool himself) the error message was inattentively read and was looking for it in other places.

Another question is which html tag (or Unicode character) can insert a space (a character that is depicted as a space)?

 <sp> и <nbsp> 

does not work.

  • The answer is simple: ButtonItem ("int-name", "And this is in the button we draw") Kotyara good. - avp

1 answer 1

As I understand it, this is not a problem, but rather a misunderstanding of the logic of work. You are confusing the internal designation of name and label . label is what is shown to the end user of the application, and the name is something like some kind of internal alias .

Accordingly, it is necessary to change the label , which, of course, has no restrictions on the use of spaces , and set the name certain way, corresponding to the internal convention of SmartGWT .

Read more here.

  • Exactly. - Nofate
  • Not. In this case (I don’t know what to call it correctly) for an object of type ButtonItem, which must be packaged in the DynamicForm cell, the label concept is missing. name here corresponds to what you call the label, it is it (which is in parenthesis) when the new ButtonItem is shown to the viewer. You can change it by calling the .setName (String) method. What you mean by name ( alias ) (internal identifier) ​​is obtained by getID (). In this case, I do not confuse. By the way, did you decide that I was trying to establish an ID with such a call ??? The question of another is how to draw a space. He stayed - avp
  • @avp Either you have some kind of revision of the SmartGWT , or I don’t know something. The documentation [ here ] [1] indicates that the constructor accepts name and also (in the second variant) title . [1]: smartclient.com/smartgwtee/javadoc/com/smartgwt/client/widgets/… - Costantino Rupert
  • Yes @ Kotik_hochet_kushat, you're right. Itself just looked at one more form of the designer. Just for Button's, in all their forms, this first argument is drawn where appropriate, and that’s misleading. And about ID, I got excited. In general, plus and close. - avp