PDA

View Full Version : [CLOSED] Caching common part of UI



vijay.sahu
Mar 20, 2013, 6:56 AM
Greetings,

I have a requirement of caching/storing common part of UI on client browser so that the navigation wont look like a full postback or refresh.
I am relatively new to ext.net so am not much aware of the features of it.

Can you please provide me some solution to the requirement or suggest any path through which I can achieve that using ext.net.

Daniil
Mar 20, 2013, 9:46 AM
Hi @vijay.sahu,

Well, you could cache something in cookies. But it would be rather some data, not UI.

Please provide more details. What exactly do you need to "cache"?


so that the navigation wont look like a full postback or refresh

I guess it is rather a problem of the application's design. If you don't need to refresh some part of the page, you should not reload it.

For example, please open some examples here (clicking the tree's nodes).
http://examples.ext.net

As you can see it doesn't refresh the whole page, but just loads and renders the requested things.

vijay.sahu
Mar 20, 2013, 12:21 PM
Hi Daniil,

We are trying to achive RIA look for our applications.

Please refer image for more clarification. We would like to refresh only the central panel (bordered panel) without using iframe and load different content on clicking the different links of the tree rather than refreshing the whole page and expanding the tree.

In the http://examples.ext.net url, the contents are loaded in different tabs on clicking the tree nodes which is not what we are actually looking for.

It would be great if you would be able to provide any solution available for such a scenario.





Hi @vijay.sahu,

Well, you could cache something in cookies. But it would be rather some data, not UI.

Please provide more details. What exactly do you need to "cache"?



I guess it is rather a problem of the application's design. If you don't need to refresh some part of the page, you should not reload it.

For example, please open some examples here (clicking the tree's nodes).
http://examples.ext.net

As you can see it doesn't refresh the whole page, but just loads and renders the requested things.

Daniil
Mar 20, 2013, 12:50 PM
You can achieve it using the XRender functionality. XRender means rendering controls to client of the fly.
http://examples2.ext.net/#/XRender/Basic/Add_Items/

Here is a very simple example demonstrating the basics.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Render(object sender, DirectEventArgs e)
{
this.PanelCenter.RemoveAll();

Ext.Net.Label label = new Ext.Net.Label(DateTime.Now.Second.ToString());

label.AddTo(this.PanelCenter);
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server" Layout="BorderLayout">
<Items>
<ext:Container runat="server" Region="West" Width="150">
<Items>
<ext:Button runat="server" Text="Render new content" OnDirectClick="Render" />
</Items>
</ext:Container>
<ext:Panel ID="PanelCenter" runat="server" Title="Center" Region="Center">
<Items>
<ext:Label runat="server" Text="Some Initial Content" />
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
</body>
</html>


Another approach is using a Loader.
http://examples2.ext.net/#/Loaders/Component/Direct_Method/
http://examples2.ext.net/#/Loaders/Component/Http_Handler/
http://examples2.ext.net/#/Loaders/Component/JSON_WebService/