Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Master Field not firing in mobile clients(The Master Field value is not propagated to the listening field in a Tab Box in mobile clients.)
Master Field not firing in mobile clients [message #1613013] Thu, 12 February 2015 10:54 Go to next message
Dirk Seider is currently offline Dirk SeiderFriend
Messages: 2
Registered: February 2015
Junior Member
Newbie question maybe, but I'm playing around since quite a time and don't get it working. I hope to get help (or bug confirmation??) here.

I have a DesktopForm with two fields.
1.) A TextField that takes some simple input
2.) A TabBox with Tabs (Groups)
2a.) In a Tab of the TabBox I have a Label

So what I want to achieve is whenever I change the text in the top level TextField the Label's text should change as well.
To do so I set the TextField as a Master Field for the Label and by magic it works well in the web version of the application. However if I switch to Mobile/Tablet, only the first time I change the TextField, the Label is updated properly. All follow on changes to TextField do not update it at all.

So I asked the debugger for assistance and ended up finding the following behavior for Mobile/Tablet:
On first start, everything seems to be setup correctly and the Master Field is configured to be the TextField. All this is done in AbstractFormField.class in postInitConfig(). When I enter some text then the update for Master Field is fired, the execChangedMasterVale() called as it should be.
As soon as I change into the Tab of the TabBox, thing run out of control. Again postInitConfig() is called in AbstractFormField.class and when it trys to find the Master Field, null comes back and as a consequence the Master Field is unset and cannot listen any longer for updates.
Stepping into the findNearestFieldByClass() it appears that the enumeration of enclosing fields doesn't step up the whole tree but stops too early and thus does not see the DesktopForm and the TextField.class it should find there as a Master Field. Since it doesn't see anything, of course the null value is returned and the system behaves as described above.

Posting the setup of the DesktopForm as well:

public class DesktopForm extends AbstractForm {

  @Order(10.0)
  public class MainBox extends AbstractGroupBox {

    @Order(10.0)
    public class TextField extends AbstractTextField {

      @Override
      protected String getConfiguredLabel() {
        return TEXTS.get("Text");
      }
    }

    @Order(20.0)
    public class TabBox extends AbstractTabBox {

      @Override
      protected String getConfiguredLabel() {
        return TEXTS.get("TabBox");
      }

      @Order(10.0)
      public class Tab1Box extends AbstractGroupBox {

        @Override
        protected String getConfiguredLabel() {
          return TEXTS.get("Tab1");
        }

        @Order(10.0)
        public class Label1Field extends AbstractLabelField {

          @Override
          protected String getConfiguredLabel() {
            return TEXTS.get("Label1");
          }

          @Override
          protected Class<? extends IValueField> getConfiguredMasterField() {
            return DesktopForm.MainBox.TextField.class;
          }

          @Override
          protected boolean getConfiguredMasterRequired() {
            return true;
          }

          @Override
          protected void execChangedMasterValue(Object newMasterValue) throws ProcessingException {
            super.execChangedMasterValue(newMasterValue);
            setDisplayText((String) newMasterValue);
          }
        }
      }
    }
}


Anybody with similar issues? How can I get this running?
Re: Master Field not firing in mobile clients [message #1617604 is a reply to message #1613013] Sun, 15 February 2015 10:46 Go to previous messageGo to next message
Dirk Seider is currently offline Dirk SeiderFriend
Messages: 2
Registered: February 2015
Junior Member
Got it resolved in a way.

When putting both, the TextField AND the TabBox each in its own group, everything works fine. However - the look and feel changes from mobile tabbed style to desktop tabbed style on mobile devices as well. Actually not what I wanted to end up with, but it works now.
So the Form structure is now like this:
DesktopForm
|-MainBox
    |-Group1
        |-TextField
    |-Group2
        |-TabBox
            |-Tab1
                |-Label
Re: Master Field not firing in mobile clients [message #1618884 is a reply to message #1617604] Mon, 16 February 2015 07:33 Go to previous message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 566
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Another thing you could try is to leave out the master field configuration and add a execValueChanged() method to the text field and then call getLabel1Field().setText() in that method. I haven't tried if that works in your original setup but it's worth a try.
Previous Topic:Casting query results
Next Topic:Width and height of a Scout Dialog
Goto Forum:
  


Current Time: Fri Oct 20 01:53:00 GMT 2017

Powered by FUDForum. Page generated in 0.04157 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software