Announcement

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

    Fluent Setters

    Hi,

    According to the FAQ smartgwt API is generated. So, didn't you consider to use fluent setters (when setter returns this) to support chaining of methods?
    In such case code will look more like in DSL-style

    PHP Code:
    final DynamicForm form = new DynamicForm()
        .
    setWidth(250)
        .
    setFields(new FormItem[] {
            new 
    TextItem()
                .
    setTitle("Username")
                .
    setRequired(true)
                .
    setDefaultValue("bob"); 
        }); 

    #2
    We're looking into this, but it's not a simple change as some of our APIs inherit from existing GWT APIs.

    Comment


      #3
      Hi all,

      I just noticed this is now the case in some parts of 12.1p, e.g. DSRequest (search for "DSRequest instance, for chaining setter calls").

      Best regards
      Blama

      Comment


        #4
        You'll find that Fluent setters are now present for Canvas, BaseClass, DataClass, and subclasses, where the previous signature declared a void return type. In some cases Fluent setters couldn't be applied because our APIs extend existing GWT APIs.

        Comment

        Working...
        X