Announcement

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

    SmartGWT2.0 Upgrade Issue

    I upgraded an existing SmartGWT1.3 project to SmartGWT2.0 and I see the following error message on one of the forms:

    Uncaught JavaScript exception [java.lang.AssertionError: Invalid FormItem name. Cannot use spaces in FormItem name.
    at com.smartgwt.client.widgets.form.fields.FormItem.setName(FormItem.java:2890)

    I am not setting the name to spaces as can be seen in the code snippet below:

    Code:
    final PasswordItem newPwdItem = new PasswordItem();
    newPwdItem.setName("New Password");
    newPwdItem.setRequired(true);

    #2
    The item's name cannot include any spaces. "New Password" has a space. This is not a new requirement, only a new validation of the requirement.

    Comment


      #3
      My bad. Should have looked closer before posting.

      Soon after I posted the message I compared the source code for FormItem on SmartGWT 1.3 and SmartGWT 2.0 and found that some new assertion validations have been included.

      I removed the space and it works fine now.

      Thanks

      Comment


        #4
        ?

        Originally posted by davidj6
        The item's name cannot include any spaces. "New Password" has a space. This is not a new requirement, only a new validation of the requirement.
        How can I go around this? The demo video I saw on youtube where someone showed how to use SmartGWT had a TextItem with name Employee Name and when I tried to use this with smartGWT 2.0 (both LGPL and EE versions) it fails! Interestingly IButton allows a name such as Click Me (with spaces)..
        How can I go around this to create text items with spaces in name? It seems odd to be forced to have artificial and geeky looking fields such as EmployeeName, EmployeeNumber, SocialSecurityNumber, BirthDate..etc where one would expect to see those fields with their natural names with embedded spaces.... comments?

        Comment


          #5
          You seem to be confusing FormItem names and titles.

          Comment


            #6
            thanks

            well, I didn't know about title earlier. just started playing with smartGWT recently. I was following this tutorial http://www.youtube.com/watch?v=CYxn1DuVFUE and when tried the statement
            TextItem textItem = new TextItem("Employee Name"); it kept giving the above mentioned error. I now realized that one can set title (label) for the control.
            Thanks

            Comment

            Working...
            X