Taking too long in navigating from one page to another in Smartface App Studio - smartface.io

It's taking too long time to show up an page from another. I kept only value bindings to the controls which are pre-dedigned.
Can any one please help me in increasing the performance of navigating between the pages.
Thanks in advance.

Loading images or design elemets(like map) takes a lots of time before loading page. I am trying to call empty page first and by timer start to load design elements it become not more fast but at least you don't wait until create the page . Also I use page.reset() method after i left the page it helps in some cases to reload the same pages performance. In all cases don't expect the performance of native app.

Related

Stop wicket from reloading page

I am working on an existing project with no previous experience in wicket.
The application has a page with four tabs. the first three tab is suppose to reload every 60 sec. The last tab is what I am working on and I don't want it to reload ever. I cannot find out where is the code that does the reloading
When a do a view source of the UI. I see something like this
Wicket.Event.add(window, "load", function(event) {
Wicket.TimerHandles['id135'] = setTimeout('Wicket.Ajax.ajax({\"c\":\"id135\",\"u\":\"./?2-3.IBehaviorListener.0-viewPanel-contentPanel-criticalZonePanel-1\"});', 60000);
Wicket.TimerHandles['id225'] = setTimeout('Wicket.Ajax.ajax({\"u\":\"./?2-3.IBehaviorListener.0-\"});', 60000);
Not sure if there is enough hint to figure out what might be causing the reloading or what kind of code or keywork should I be looking for in the application to change this.
This JavaScript is generated by AbstractAjaxTimerBehavior or its specialization AjaxSelfUpdatingTimerBehavior. Check where in your page/tabs any of those is used and disable it for the fourth tab.

Positioning a sap.m.list

I'd like to create a twitter like stream out of a sap.m.list, hence when I get more data with a pulltorefresh control, I'd like to update the list with the additional rows, but should not move the list at all, and be hidden until the user scrolls the list down.
Any standard ways of doing this, or alternatively, custom CSS/JS recommended ways of doing this?
Thanks,
Matt
There's no need to drop down to jQuery here as OpenUI5 already contains the awesome iScroll library.
I've just setup a test app for you to have a look at here: https://github.com/js1972/ui5_pull_to_refresh.
Clone this; check the readme; then just run grunt serve to open the app in your default browser. You can use Chrome dev tools to emulate an iphone or android, etc.
I think this does what you're after - it works just like the GMail mobile app. You pull down to refresh items and at the end of the refresh your still looking at the same items but can now scroll up to see the new ones.
Will be interesting to see the performance if you have a thousand items... iScroll gives you allot of settings to play that may help (which aren't discussed in the UI5 SDK).
One thing to be careful of with browser scrolling is paint times. If the browser is not 100% done painting then iScroll can't calculate all the element dimensions it needs and you get strange results - typically just no scrolling. Sometimes you've just got to give a little time back to the browser by wrapping things in setTimeout(scroll_stuff, 0).
Hope this helps...
While not quite the answer I was after, looked into doing it another way, and provided you can work with automatically generated Id's that you'll need to calculate based on the row number, the following is one brute force way of doing it (I've borrowed it from another SO question and kept the animation for fun - Referenced SO Link):
var pOffset = $("#__item0-App--Main--MyList-76").position().top;
$("#App--Main--myPage-cont").animate({scrollTop: ( pOffset)}, 800);

gwt - history - how to "keep" UI state

I tried the example which is showing how to get data from history to re-generate UI; The thing I see mostly in all "history usage" examples are related to UI re-generation only so it is none-static way...
But what about "each UI state may have its unique url something like JSF does with flows"? For example I have app url like a
http://localhost:8080/myapp/MyApp.html
the app default UI contains main menu which is helping to navigate through my test catalog; I tried to make possible keep the UI dynamics in history by building url in this way
http://localhost:8080/myapp/MyApp.html#menu_testcategory_page1
but when I click internet browser "refresh" button the url keeps the same as http://localhost:8080/myapp/MyApp.html#menu_testcategory_page1 but the UI comes back to its default state :(
So my question is
is there an optimal way in pure gwt to stay in the same UI state even after browser's refresh button is clicked (I mean the unload/load window events occur)?
thanks
P.S. gwt 2.3
You should implement Activities and Places pattern: http://www.gwtproject.org/doc/latest/DevGuideMvpActivitiesAndPlaces.html
I am using it for 3 years, and it works very well.
Note, however, that when you reload a page, you lose all of your state, data, etc. If you need to preserve some of it, you can use a combination of a Place (#page1) and a token that tells the corresponding Activity the state of the View representing this Place, i.e. (#page1:item=5).
You probably just forgot to call
History.fireCurrentHistoryState();
from your entry point.

How to show message during initial loading of gwt application?

I want to display a message (please wait...) or animated gif before the initial entire loading of my gwt application.
Can you give me a full example please.
Thanks
Because the GWT app is not yet loaded, you have to do it in pure HTML/CSS and/or JS in your HTML host page. The easiest is to just put it in your <body> and when the GWT app loads it starts by cleaning that "loading" message (e.g. Document.get().getElementByid("loading").removeFromParent())
Another possibility is to use code-splitting: make a first fragment that's as small as possible and will display your "loading" message, and load the rest of the app in the background. In the RunAsyncCallback, hide your "loading" message.
That said, if you feel the need to display such a "loading" message, then IMO you have a bigger problem than finding how to display it (and if you struggle to find how to display one, you're in bad shape to build an app that people will enjoy using; fortunately, this is fixable: keep learning!).

Wicket Pagemap Correct Use

I'm working on an app. with a homepage that contains two iframes. Each one of these iframes is refreshed every 5 seconds. Also, from the homepage the user can open several popup windows. Right now, when I open one of the popup windows, and reload it 3 or 4 times, one of the iframes in the homepage crashes because of a PageExpiredException. My question is, what would be the right way to use PageMaps to avoid this PageExpiredException? Also, the back button won't be available, so I don't need to keep previous versions of any page in session, is there a way to tell app. not to store previous versions of the pages?
Thanks,
Juan.
Each window, frame or iframe should have a PageMap of its own, so they don't conflict with each other. When you create the initial URL of an iframe, use the urlFor(PageMap,Class,PageParameter) method, so that page and pages navigated from there are part of that PageMap.
Stateless pages don't go into the PageMaps, so if a window only shows stateless pages, it doesn't really matter what is its PageMap (you may use the default).
If you upgrade to Wicket 1.5 (in RC right now), you don't have to worry about that anymore, since they discarded the whole PageMaps concept.