Announcement

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

    13.0 setLinearOnMobile doesn't seem to work.

    13.0-d20210426

    Consider the example below. Even though i've set "setIsHandset()", and "setLinearOnMobile()" both to true, the form still renders multiple columns.

    It works if i call "setLinearMode(true)", but i thought setLinearOnMobile would render linearly automatically (as per the docs) if on a handset. Am i missing something here?

    Code:
    @Override
    public void onModuleLoad() {
    
    Browser.setIsHandset(true);//i expect this to make the environment consider us in "mobile" mode.
    
    DynamicForm form = new DynamicForm();
    form.setTitleOrientation(TitleOrientation.TOP);
    form.setWidth(800);
    form.setNumCols(2);
    
    form.setLinearOnMobile(true);// doesn't work
    //form.setLinearMode(true);//works
    
    TextItem item1 = new TextItem();
    item1.setTitle("Item 1");
    TextItem item2 = new TextItem();
    item2.setTitle("Item 2");
    TextItem item3 = new TextItem();
    item3.setTitle("Item 3");
    item3.setColSpan(2);
    
    form.setItems(item1, item2, item3);
    form.draw();
    }

    #2
    Up until this point, DynamicForm.linearOnMobile was triggering when we determined the browser to be a mobile browser, based on certain internal logic unaffected by Browser.isHandset. This meant that you could not modify the behavior for a given device/browser. We've made a change so that Browser.isHandset is now used definitively, rather than internal logic.

    The fix should be in the next nightly build, dated 2021-06-08.

    Comment


      #3
      Great stuff thanks

      Comment

      Working...
      X