EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Slide Tansition - DojoMobileView

    Posted 02/17/15 11:58 AM

    See if I can explain this...I have my main UI screen that loads all the views(Login, DatePicker, Client List, Item List, Notes, Time In/Out, Confirm). This is my setup and process.

    I start the main view in a listed structure. The user will tap on Log in, and it will transition/slide to the Log In screen. 

    Here is the main view:

    mainView DojoMobileView{                     selected = true, children = [homeView, list, messages.messageBottom ]        };                     homeView DojoMobileView{ id="mainView",                selected = true,                 headerTitle = "Mobile Timesheet"        };                                     _views DojoMobileView[] = [                        Login.View,                datePicker.View,                clientView.View,                itemView.View,                notes.View,                timeInOut.View,                confirmEntry.View                        ];                        startList MobileHelper[] = [                new MobileHelper{ _index = 1, _title = login.View2.headerTitle, _icon = "icons/Check-icon.png"},                new MobileHelper{ _index = 2, _title = datePicker.View2.headerTitle},                new MobileHelper{ _index = 3, _title = clientView.View2.headerTitle},                new MobileHelper{ _index = 4, _title = itemView.View2.headerTitle},                new MobileHelper{ _index = 5, _title = notes.View2.headerTitle},                new MobileHelper{ _index = 6, _title = timeInOut.View2.headerTitle},                new MobileHelper{ _index = 7, _title = confirmEntry.View2.headerTitle}                ];                List DojoMobileList{                style = DojoMobileLib.LIST_STYLE_ROUNDED_RECTANGLE,                height = "auto",                children = []        };                           listChild Widget;        listChildren Widget[] = [];                private me string = "com.ads.mobiletime.ui.mobiletimesheet";         private im InfoBusMessage;                function initialization()                clientView.initList();                i2 int;                                 for( i int from 1 to startList.getSize())                                                        //      startList[i]._title = _views[startList[i]._index ].headerTitle;                                _views[startList[i]._index ].headerTitle = "Mobile Timesheet";                                                                                                i2 = i;                                                                if(i>1)                                        i2 = i-1;                                                                                listChild = new DojoMobileListItem{                                        id = "list_" + startList[i]._index,                                        text = startList[i]._title,                                         actionView = _views[startList[i]._index],                                        onPress ::= onPress_PushTimeEntry,                                        style = "display:none"                                        //visibility = "hidden"                                                                        };                                                        else                                        listChild = new DojoMobileListItem{                                        id = "list_" + startList[i]._index,                                        text = startList[i]._title,                                         actionView = _views[startList[i]._index],                                        onPress ::= onPress_PushTimeEntry                                };                                                                        end                                                                case(i)                                        when(1)                                        _views[startList[i]._index ].backView = HomeView;                                        _views[startList[i]._index ].backText = "Home";                                        when(2)                                        _views[startList[i]._index ].backView = HomeView;                                        _views[startList[i]._index ].backText = "Home";                                        //                                      (_views[startList[i]._index ].children[1] as DojoMobileView).backText = "back";                                        (_views[startList[i]._index ].children[1] as DojoMobileView).backView = _views[startList[i2]._index];                                        (_views[startList[i]._index ].children[1] as DojoMobileView).onPress ::= onPress_PushTimeEntry;                                        (_views[startList[i]._index ].children[1] as DojoMobileView).id = "view_" + startList[i2]._index;                                                                                                                        when(3)                                        _views[startList[i]._index ].backView = HomeView;                                        _views[startList[i]._index ].backText = "Home";                                        //                                      (_views[startList[i]._index ].children[1] as DojoMobileView).backText = "back";                                        (_views[startList[i]._index ].children[1] as DojoMobileView).backView = _views[startList[i2]._index];                                        (_views[startList[i]._index ].children[1] as DojoMobileView).onPress ::= onPress_PushTimeEntry;                                        (_views[startList[i]._index ].children[1] as DojoMobileView).id = "view_" + startList[i2]._index;                                                                                when(4)                                        _views[startList[i]._index ].backView = HomeView;                                        _views[startList[i]._index ].backText = "Home";                                        //                                      (_views[startList[i]._index ].children[1] as DojoMobileView).backText = "back";                                        (_views[startList[i]._index ].children[1] as DojoMobileView).backView = _views[startList[i2]._index];                                        (_views[startList[i]._index ].children[1] as DojoMobileView).onPress ::= onPress_PushTimeEntry;                                        (_views[startList[i]._index ].children[1] as DojoMobileView).id = "view_" + startList[i2]._index;                                                                                     when(5)                                        _views[startList[i]._index ].backView = HomeView;                                        _views[startList[i]._index ].backText = "Home";                                        //                                      (_views[startList[i]._index ].children[1] as DojoMobileView).backText = "back";                                        (_views[startList[i]._index ].children[1] as DojoMobileView).backView = _views[startList[i2]._index];                                        (_views[startList[i]._index ].children[1] as DojoMobileView).onPress ::= onPress_PushTimeEntry;                                        (_views[startList[i]._index ].children[1] as DojoMobileView).id = "view_" + startList[i2]._index;                                                                                     when(6)                                        _views[startList[i]._index ].backView = HomeView;                                        _views[startList[i]._index ].backText = "Home";                                        //                                      (_views[startList[i]._index ].children[1] as DojoMobileView).backText = "back";                                        (_views[startList[i]._index ].children[1] as DojoMobileView).backView = _views[startList[i2]._index];                                        (_views[startList[i]._index ].children[1] as DojoMobileView).onPress ::= onPress_PushTimeEntry;                                        (_views[startList[i]._index ].children[1] as DojoMobileView).id = "view_" + startList[i2]._index;                                                                                when(7)                                        _views[startList[i]._index ].backView = HomeView;                                        _views[startList[i]._index ].backText = "Home";                                        //                                      (_views[startList[i]._index ].children[1] as DojoMobileView).backText = "back";                                        (_views[startList[i]._index ].children[1] as DojoMobileView).backView = _views[startList[i2]._index];                                        (_views[startList[i]._index ].children[1] as DojoMobileView).onPress ::= onPress_PushTimeEntry;                                        (_views[startList[i]._index ].children[1] as DojoMobileView).id = "view_" + startList[i2]._index;                                                                                                     end                                                                                listChildren.appendElement( listChild );                end                                List.children = listChildren;

     

    The user will enter their credentials and tap on Login.  If successful, I use infobus to go back to the main view so I can switch to my next screen.

    InfoBus.publish("com.ads.mobiletime.ui.mobiletimesheet",                         new InfoBusMessage { action = "LOGIN_STATUS", callbackAction = "dateView", data = currentUser } );

     

    Since all the views are loaded on the main view, I select my DatePicker view with this:

    datePicker.View.selected = true;

    This shows the DatePicker, but I would like it to transition/slide to the view. I've tried all kinds of workarounds to transition to the next screen with no success. Could I manipulate DojoMobileView.js to do a transition instead of just showing the screen, or is there a better way to load up my views to prepare for future transitions.

     

    Ritchie

    Gadberry


  • 2.  Re: Slide Tansition - DojoMobileView

    Posted 03/16/15 11:24 PM

    Hi Ritchie,

    It looks like performTransition function can fulfill your requirement. Please check: http://dojotoolkit.org/api/#1_10dojox_mobile_View_performTransition

    Unfortunately, this method is not included in EGL DojoMobileView yet. You can either use JS externalType to include it or open a RFE to the development team to include it.

    HuangJiYong


  • 3.  Re: Slide Tansition - DojoMobileView

    Posted 03/17/15 02:15 PM

    Could you give me an example of using JS externalType to include it in my project.

    Gadberry


  • 4.  Re: Slide Tansition - DojoMobileView

    Posted 04/13/15 10:54 AM

    I was able to figure this out. I needed to load my main screen different than what I initially had. When I initially loaded the screen I was using a view that had my children(textLabel1, List, messages.messageBottom). The 'List' child had my gridlayout, which also contained my dojoBobileButton to go to the next screen.

    View DojoMobileView{standardEvents = [DojoMobileLib.TRANSITION_SLIDE], children=[View2] }; View2 DojoMobileView{headerTitle = "Login", children =[textLabel1, List, messages.messageBottom]};   GridLayout2 GridLayout{style="text-align:center; padding-top:30px",  rows = 2, columns = 1, width = "100%", children =[LoginButton]};                        GridLayout3 GridLayout{cellPadding = 4, rows = 2, columns = 1, width = "100%", children =[TextLabel2, employeeNoField]};    GridLayout4 GridLayout{cellPadding = 4, rows = 2, columns = 1, width = "100%", children =[TextLabel3, firstNameField]};    LoginButton DojoMobileButton{id="Login", class="responsiveButton",  text = "Login",                        layoutData = new GridLayoutData{row = 1, column = 1}, onPress ::= Button_onPress};                  List DojoMobileList{class="login_box", style = DojoMobileLib.LIST_STYLE_ROUNDED_RECTANGLE,    children = [ListItem]};    ListItem DojoMobileListItem{children = [GridLayout3, GridLayout4, GridLayout2], actionTransition = DojoMobileLib.TRANSITION_SLIDE};               

     

    I did not need to bury my 'LoginButton' inside the gridlayout, and the DojoMobileList. I removed the button from the list and the gridlayout. I left the button standalone and added him to the view as a second child. I changed LoginButton from a dojoMobileButton to a DojoMobileListItem. 

     View DojoMobileView{id="LoginView", children=[View2, LoginButton ] };    View2 DojoMobileView{headerTitle = "Login",         children =[textLabel1, List, messages.messageBottom]};     LoginButton DojoMobileListItem{onPress ::= Button_onPress};

     

    Back on the Main screen I loaded the 'LoginButton' when the program initialized. That way it got the necessary actions it needed to transition to the next screen.

    case(i)    when(1)        _views[startList[i]._index ].backView = HomeView;        _views[startList[i]._index ].backText = "Home";                                (_views[startList[i]._index ].children[2] as DojoMobileListItem).id = "LoginList_1";        (_views[startList[i]._index ].children[2] as DojoMobileListItem).actionView = _views[2];        (_views[startList[i]._index ].children[2] as DojoMobileListItem).actionTransition = DojoMobileLib.TRANSITION_SLIDE;        (_views[startList[i]._index ].children[2] as DojoMobileListItem).text = "Login with Credentials";

     

    Now the screen slides to the next screen. I don't like how I had to accomplish this, because if I needed to add something on the Login screen I would possibly need to change which child I need to look at to get to my LoginButton to set the actions. It would be nice to use it the way I had it...where all I had to do is select it.

    datePicker.View.selected = true;

     This way was also helpful because I was able to stay on the screen if there were errors when the user logged in. Now, I display the error on the next screen, because you can't stop the transition when you tap the 'LoginButton'. With this way I can determine when I need to go to the next screen. With the way it is now...when I use the selected method it makes your mobile device screen jump, it doesn't have that smooth transition from screen to screen.

     I like the way the transition works when I use the dojoMobileListItem or dojoMobileButton and is inline with how mobile solutions work now days. So, I ask of you to please add a transition to the 'View' when it is selected.

    Gadberry