Layouts of smartgwt are automatically!! adding to rootpanel - smartgwt

I'm using smartgwt. I have created some Layout objects when I run my app in dev mode all the Layouts are added to my page but I have not added all of them to rootpanel. Is it because of browser doesn't refresh the page or jetty doesn't render? I have cleared the browser cache and made my app clean&build, but the issue isn't solved.

When you call draw(), SmartGWT components render themselves. You don't need to add them to RootPanel, and in fact you should not do so - draw() is preferred unless some third-party code is forcing you to go through RootPanel.

Related

How to force an update a Cached Kendo UI Mobile Remote View

I'm using Kendo UI Mobile Framework and have the bulk of my views handled as remote views. For example, a remote html doc view1.html instead of an inline div element #view1.
They all work fine in the browser, however I see some problems related to caching of these remote views:
Reloading the home screen app after closing it doesn't force the web app contents to refresh/update (iOS Saved to home screen).
Recreating the home screen web app doesn't force the contents to refresh/update, even after clearing the Safari web data (iOS Saved to home screen).
Does anyone know how to force the app to fetch new versions of these remote views on initial application load (once per session) when that is all taken care of behind the scenes in the Kendo Mobile Library?
I was looking into ApplicationCache but that seems pretty scary for my mostly dynamic, database intensive app. On top of this, I don't think my webserver (which runs off the back of a 4D database can actually serve the correct mime-type for appcache files).
Since Kendo UI is using jQuery:
https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.mobile.view.js#L660
you can probably stop the cache with the global $.ajaxSetup(), like this:
$.ajaxSetup({
cache: false
});
Just make sure to switch it off before loading any other data you need.

Kendo drop down list doesn't work in IE10 iframe

My mvc website makes use of the Telerik Kendo mvc dll's. However the problem is that the drop down list doens't work when running it on IE10, in a website that uses frames. When I run it on its own, it works fine, however as soon as it is used on a website with frames, it brakes the drop down list and they won't expand.
I'm currently using the latest version (2012.913) of the Kendo UI for MVC.
Is there a solution for this.?
I know this is an old post, but I thought I'd share since we had the same issue and found the fix for it. Unfortunately we are forced to continue using frames as well, so we had to put this fix in place.
First thing to check is if your using compatibility mode in the browser, whether by the site being added to the compatibility list or you're on an intranet site. If you can, disable compatibility mode and that should resolve this. If you want to ensure your site isn't using compatibility mode, add this tag to your application.
The problem we had is that IE doesn't obey this setting when using frames...it will always use whatever the parent frame is set to. We had to have compatibility mode enabled for certain portions of our site, so we were in a catch-22 situation. Since there's no way around this, our final resolution was to re-direct the user behind the scenes if they navigated to the page in the iFrame.
That being said, the easiest option is to add the meta tag above if you don't need compatibility view for anything.

Performance in MVC web application

I am struggling to get some performance in my MVC application.I am loading a partial page (popup) which is taking hardly 500ms. But each time the popup loads it also downloads 2 jQuery files as well.
is it possible to use the jQuery from cache or from parent page?
I have attached the image in red which shows 2 additional request to server.
In order to improve the performance you can try with the following approaches:
see if your application server supports GZip and configure the application/server to return the responses always archived in Gzip
Use minified version of JQuery
there are also Packing libraries where you can pack all the imported resources, such as CSS files and JS files, and the browser will do only 1 request per resource type. For instance, in Java we have a library called packtag.
In general, I recommend you using Google Chrome browser and its performance analyzer. It will give you good hints.
In the Bundle config use this code
BundleTable.EnableOptimizations = true;
and also indclude both files in single bundle.
Does the popup use an iframe or does it's content just get added to the DOM of the current page?
If it gets added to the current page you could try just adding the script references to the parent page instead. It might not always be the best idea if the parent page has no need for those two files, but if the parent page also uses the jQuery validation then the popup will be able to use the parent's reference to the script file.
For an iframe I'd suggest looking at Gzip and minification to make the scripts load faster.

How can I disable layout file caching (Rails 2)?

I'm creating a custom CMS in Rails 2 that enables users to edit a web page using markdown. The page they are creating is within an iframe. An editor web page UI wraps that iframe.
I've found that this causes a problem in production because how Rails caches the layout file. The first time I load the editor it works as expected, but after I load a second editor page the editor uses the layout file for the page within the iframe and breaks the presentation of the editor.
In development or when config.cache_classes = false I don't see this problem.
Is there a way to either force a new layout to load for both the inner iframe and the outer editor page? Or is there a way to disable caching for this Controller's actions.
In researching this issue I've found that you can enable caching for specific actions in a controller with 'caches_action,' but there doesn't seem to be a way to turn off caching for isolated instances.
Thanks much.
You can always specify which layout to use in the action by using:
render :layout => 'layout_name'
See if the problem is solved by explicitly specifying the layout.

CSS not updated during debugging ASP.NET MVC application

I am working on a test application based on ASP.NET MVC. I am new to CSS stuff so I am learning that as well.
I have created a master page called "new.master" and created a new css "new.css". I am calling the view from controller as:
return View ("About", "new");
What I am doing is that I am frequently updating the css and master page. So I run the application in debug mode frequently. After sometime I stop seeing the effect of changes in css. When I "view source" in chrome and check the css, it shows an old version.
When I change the name of both master page and css, I start to receive updated views but that works for sometime and then again I stop getting the CSS updates. Have you faced this problem? How can I fix it? (Its terribly annoying!)
Your browser is caching the css. If you force a refresh with F5 that should display any changes.
I think this may be a browser cache issue. In in IE and FF I usually do Ctrl + F5 or Ctrl + Refresh button. Also you can manually clear the cache. For IE you can use the IE Dev Toolbar and for Firefox there is Firebug with both you can clear the cache easily. Not sure about chrome, sorry.
Sayed Ibrahim Hashimi
My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build
I found another case in which this can happen.
We started our application with just plain links to the CSS files, then switched to using bundling. We updated the old <link href="#Url.Content("~/somePath/someStyle.css")" rel="stylesheet" type="text/css" /> to #Styles.Render("~/Styles/bundles/someStyle").
We also use a few stylesheets which are only needed for some pages, and they have their own bundle. Now, for one of them, we forgot to change the link tag to the #Styles.Render statement.
The result was that this CSS got updated now and then (so we thought everything is OK; the style wasn't missing), but we could not influence when the update happens. When I started making changes to the file, I realized that nothing I do (emptying the cache, rebuilding the project, restarting Cassini) will trigger an update. The browser always got a 304 Not modified.
So, if you have these symptoms, check your links.
Please use Ctrl+F5 to refresh your browser.
F5 may give you the same page even if the content is changed, because it may load the page from cache. But Ctrl - F5 forces a cache refresh, and will guarantee that if the content is changed, you will get the new content.
hope this will help you
Thank you
go to chroom developer panel by right click inspect -> then go to Network tap -> tick the Disable cache checkbox (note: this should always be checked) -> Refresh the page by pressing F5.
this work for me, hope this help others who have this issue! :)
It's very possible that css is being cached in your browser, so simply clearch browser cache, it should help
This happened to me when I had a master view that would load partial views depending on which partial view the user wanted to see, but the answer from this page helped, https://forums.asp.net/t/1763494.aspx?applying+CSS+layouts+to+a+partial+view
CSS must be referenced in the of the Html document. As a
consequence you cannot include them in a partial view...because in
such case the css is included in the Html body. Please plce the style
sheet in head of the page that hosts the partial view.
I would have css links in my partial views and any modifications to the css files would never happen, even if I pressed Ctrl-F5 in the browser. I also tried clearing cache contents in the developer tools. I noticed by viewing the source stylesheets that the css files linked by the partial views were not changing, so the fix for me was to move the css links from the partial view to the main view where these partial views were to be held.
I had something similar happening to me.
Then suddenly noticed the bundle was added to the page:
#Styles.Render("/bundles/classifiedDetailCss")
instead of:
#Styles.Render("~/bundles/classifiedDetailCss")
Note the missing ~ character in the first example.
(The first example only worked after building the project, otherwise it would return a cached version even in debug mode.)
This can help solve this issues in both dev and production.
use asp-append-version="true"

Resources