[CLOSED] Single page application

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Single page application

    Hello

    My question is bot more generic, I'm just looking for the direction where to read and aditionaly some ideas if possible
    So we are planning to to brand new application, relativelly wide one, everything on one page (well login will be probably another)

    now what I'm looking for is to understand and choose what Ext.net offers me (I tried forums and did not find too much)

    So let's start with relativelly simple example like http://mvc.ext.net/#/XRender_Basic/Add_Items/

    the control is created during direct call - which is great - but I would rather have it ready on clinet and just instantiate it using Ext.create

    You probably saw me playing with the

    ComponentLoader.ToConfig

    method in one of previous post. which works, but in general I don't have impression it's recomendd solution
    problem is that in bit complex controls it generate additional stuff (for example .show calls, divs for <content> tag with hardcoded ids, so the overall script is not reusable). I can write the details if you want. But for now I'm just looking for recomended way how to do single page application, with UI json loaded when the page load, and based on loaded json dynamically create UI componets. Basically how the typical ExtJs application works
    And note that I'm trying to avoid going extjs way as ( I do not want to make you unhappy :-)) creating UI in ascx/mvc is pretty productive way of dealing with ExtJs and additionally your small enhancements to ExtJs are particulary usefull.
    I know that I can include ResourceManager on the page and create UI in js, like with ExtJs, possibly even using their MVVM. But that would exclude ascx files where intelisence and compile time check is more then handy

    Thanks
    Zdenek
    Last edited by Daniil; Oct 29, 2015 at 1:58 PM. Reason: [CLOSED]
  2. #2
    Hi @Zdenek,

    Personally, I would go with an ASP.NET MVC application and, for dynamic UI, partial views rendering them with ComponentLoader.ToConfig(...) with Mode="Component" when possible. You have mentioned issues with ComponentLoader that we could discuss in details in individual threads when/if you want.

    I should say it is only my personal preference. Yes, you might be more comfortable with creating an application in a pure ExtJS way. Well, I think that is totally okay if you feel it is the best for you.

    I also remembered about the Desktop control which is actually an example of a single page application design as well.
    http://mvc.ext.net/#/Desktop/Overview
  3. #3
    Ok, thanks

    regarding "pure ExtJS" way I meant the oposite - even with new tools from sencha (beside the fact that they are relativelly expensive) , it's pretty slow to create any UI, in compare to ascx/mvc way with Ext.NET, where intelisence and compile time check works, so that's why I'm trying to find a way how to use ext.net

    There are two questions on my mind, not sure if they worth creating separate thread as they are related to this

    1) how MVC ( means ext.net MVC) helps here?
    In compare to webforms? Any ajax call is basically direct method that is supposed to return pure JSON data, does it matter if there is MVC on server or not? (I undertand it coul d be matter of preference, I'm trying to understand why I would introduce MVC level and what advantages I would get from that, particulary in this case), considering my question in parallel thread - http://forums.ext.net/showthread.php...-class-library - can controllers sit in separate libraries?

    2) MVVM on client
    Ok - so views can be created using ComponentLoader.ToConfig
    Now - can the output be serious type definition - something that I can reuse on client as a class?
    For example - I take TestClass.ascx file, call ComponentLoader.ToConfig, somehow inject to page and on client I can call Ext.create('TestClass').
    motivation is simple - having MVVM on client side ( so add ViewModel attribute to the root control of the TestClass.ascx and implement that in js)
    Does it sounds logical a little? and if yes, how far from doing that we are now?
    If necessary I can demonstrate what I mean in details in code, but hopefully idea is understable now

    Thanks
    Zdenek
  4. #4
    1) how MVC ( means ext.net MVC) helps here?
    I rather meant the MVC pattern as it is. I just like MVC a bit more than Web Forms.

    Any ajax call is basically direct method that is supposed to return pure JSON data, does it matter if there is MVC on server or not?
    I think it doesn't matter.
    considering my question in parallel thread - http://forums.ext.net/showthread.php...-class-library - can controllers sit in separate libraries?
    Personally, I have never thought about it. It looks like it is possible:
    http://stackoverflow.com/questions/4...parate-project

    Though, I am not sure it is going to work with DirectMethods.

    Now - can the output be serious type definition - something that I can reuse on client as a class?
    Unfortunately, there is no such the functionality when partial views become JavaScript classes. It sounds like you might be interesting in creating custom controls.
  5. #5
    Ok,
    whole problem with custom controls is that they can't use ascx, and designing anything more complex here is bit slower (in compare to ascx)

    Do you consider as good or bad idea to take the output of the ComponentLoader.ToConfig , and do smth like

    Ext.define('<%= name of the app %>.view.<%= Name of file with ascx %>', {
        extend: '<%= typename of the root control in ascx  %>',
        viewModel:'<%= name of view model based on some convention %>,
         <%= output of the ComponentLoader.ToConfig  %>
        
    }

    Should I send MVVM question in separate thread?


    Many thanks for your ideas
  6. #6
    whole problem with custom controls is that they can't use ascx, and designing anything more complex here is bit slower (in compare to ascx)
    Yeah, that's true.

    Do you consider as good or bad idea to take the output of the ComponentLoader.ToConfig , and do smth like
    I cannot say it is bad or good, but it is definitely interesting. If you give it a try ever, I would much appreciate sharing your experience on that.

    Should I send MVVM question in separate thread?
    It looks like it is okay to keep this discussion here. At least, for now according to the level of details - currently it is a discussion in general, we don't dive into greater details so far.
  7. #7
    OK

    I'm trying to make some result from this. In fact, whole purpose of discussion is to setup design where after some time you would not say "this is not intended usage"

    So if I summarize:
    - You are not aware of anyone using MVVM together with Ext.net, but you don't see a reason why not to use it?
    - Idea with generating views sounds fine, there could be some problems with that (as i'ts not common aproach) you will try to fix those as they are reported

    thanks
    Z
  8. #8
    Hello Z,

    - in my case I have reached the conclusion that if one wants a fully dynamic single page application what works best is using Asp.Net Web Forms in a minimal fashion (i.e. put code only on Page_Load) everything else is done with Direct methods which get called by Listeners.
    - ASP.Net MVC is quite restrictive with all the hassle of Actions, controllers, partial views, viewbags etc.
    - "Minimal Web Forms" is the easiest and the fastest way to grab all the benefits of Ext.Net while allowing you to structure your application in any way you like.
    - .aspx page has only a resource manager and usually a viewport, code behind uses Page_Load to call some functions that create all the required ext.net controls and then render them to the viewport items collection, all ajax calls happen through listeners and direct methods, minimal use of direct events (onyl for file uploads and possible .ashx calls).
    - simple to grasp and manage, ultra-fast development time, fully server-size customisable UI, less memory requirements of client's browser, optimal scale-up capability.

    hth,
    AnFil
  9. #9
    Thanks for reply

    In fact I have similar conclusion about asp.net MVC
    the only reason why i started to watching that bit more closer is limitation that all direct methods can be called just through the default.aspx , so bit harder to simulate kind of modular architecture ( but Daniil already sugested a solution above)
    As well i cannot render everything at page_load time, as most robust controls can appear multiple time on the page
    (imagine it like document viewer - user can open many documents, bit harder to guess how many)
    So that's why I ended up with stateless static direct methods ( no direct events), and now thinking how to "move" ascx code into javascript markup and/or eventually somehow plug inside MVVM

    Z
  10. #10
    - You are not aware of anyone using MVVM together with Ext.net, but you don't see a reason why not to use it?
    I tend to answer yes:)

    - Idea with generating views sounds fine, there could be some problems with that (as i'ts not common aproach) you will try to fix those as they are reported
    Yes, we will definitely attempt to fix. Though, if a fix involves redesigning a lot of things, it might become "won't fix" or, at least, slated for the next major releases.
Page 1 of 2 12 LastLast

Similar Threads

  1. Forms Authentication with Single Page App
    By glenh in forum 2.x Help
    Replies: 1
    Last Post: Feb 13, 2014, 11:38 PM
  2. Replies: 1
    Last Post: Sep 02, 2013, 4:15 AM
  3. Multiple Task Managers in a single page
    By GKG4 in forum 2.x Help
    Replies: 1
    Last Post: May 27, 2013, 5:13 AM
  4. [CLOSED] Multiple partial views on single page
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 03, 2012, 9:06 AM
  5. Replies: 2
    Last Post: Jun 23, 2011, 12:41 PM

Posting Permissions