Announcement

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

    Setting default properties on TextItem/StaticTextItem turns off title

    SmartClient Version: v9.0p_2013-10-24/LGPL Development Only (built 2013-10-24)

    Browser: IE9

    I think something broke in recently. I have code that overrides the defaults for many of the FormItem controls. This was working fine with the build from 10/5. I have not made any changes to this code, but recently my title disappeared on all of my TextItems after I rolled to the 10/24 build. In the debugger I can see that TextItem instances have a value of true for getShowTitle() until I call TextItem.setDefaultProperties(). After that call, showTitle is false.

    During my startup I call
    Code:
    TextItem.setDefaultProperties(new PMDarkTextItem());
    I've attached the source for PMDarkTextItem - it is very simple.

    I also just noticed that I am having the same issue with SelectItem. I do the same thing with CombBoxItem, but it is working fine.
    Attached Files

    #2
    I was wrong, I am seeing this with TextItem, SelectItem, ComboBoxItem, and SpinnerItem.

    Comment


      #3
      This is assigned to a developer for investigation. We'll let you know when we have more information.

      Thanks
      Isomorphic Software

      Comment


        #4
        We are unable to reproduce this issue in 4.0 or 4.1. The code below was used (in concert with your supplied .java file) and each time getShowTitle was true.

        Code:
            	TextItem.setDefaultProperties(new PMDarkTextItem());
            	
            	final DynamicForm dynamicForm = new DynamicForm();
            	dynamicForm.setFields(new TextItem("a"),new SelectItem("b"), new ComboBoxItem("c"), new SpinnerItem("d"));
            	dynamicForm.draw();;
            	
            	Button button = new Button();
            	button.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
        			@Override
        			public void onClick(ClickEvent event) {
        				SC.say("dynamicForm " + dynamicForm.getField("a").getShowTitle() );
        			}
        		});
            	button.setLeft(250);
            	button.draw();

        Comment


          #5
          Thank you for the time you spent on this. Upon furthur investigation I found the issue. I did the same type of thing to change the styling of RadioGroupItem. However in this, I called setShowTitle(false). When I set the default properties on RadioGroupItem this apparently changed the defaults on everything else. I was not expecting this interaction.

          Comment


            #6
            You're saying that a call to 'setDefaultProperties()' on RadioGroup is impacting other form item types (including TextItem)?
            That seems like incorrect behavior. If you can show us a little standalone test case we can run demonstrating this problem, we'll take a look and see if there's any framework issue to address here

            Thanks
            Isomorphic Software

            Comment

            Working...
            X