Current filter:
                                You should refresh the page.
                                  • Hi

                                    I'm working on a mobile (iPad) template for XAF ASP.NET. However I'm stuck at one point: When I place custom controls (like ASPxButtonEdit) on the WebForm, they always cause a full postback instead of AJAX callback. I tried placing the controls in an XafUpdatePanel, but it makes no difference.

                                    What am I missing here?

                                    Thanks!
                                    Best regards

                                    Marco

                                • Dennis (DevExpress) 11.26.2012

                                  Hello Marco,
                                  Does not the AutoPostBack = False property assignment help solve this?

                                • Marco Kummer 11.26.2012

                                  Hi Dennis
                                  I tried that, but it doesn't seem to make much difference. When I set AutoPostBack=true, the buttons still cause a full postback and the ASPxButtonEdit will not even fire the OnTextChanged-event any more.
                                  I'm attaching the markup for you. I know it isn't very pretty yet... it's in a very early stage :-) Check out the controls with ids "ASPxButtonEdit1" and "Button1". They will both cause a full postback.
                                  Maybe I'm just missing something really simple. I haven't used DX ASP.NET controls a lot in conjuction with AJAX.
                                  Thanks!
                                  Best regards
                                  Marco

                                • Dennis (DevExpress) 11.27.2012

                                  Thank you for the example. Although I cannot test your code live (because it is currently missing the *.designer.cs file), I seem to understand what you are doing. I will perform additional testing and let you know my results.

                                • Marco Kummer 11.27.2012

                                  Hi Dennis,
                                  attached please find my full sample. There's also another problem that I just can't seem to get rid of: every time I change something in DefaultiOS.aspx and then save changes, Visual Studio 2010 adds two identical panels with id "VSP" underneath the VSC (ViewSiteControl). Like so:
                                   <cc4:ViewSiteControl ID="VSC" runat="server">
                                                                                  <asp:Panel runat="server" Width="100%" ID="VSP" EnableViewState="False"></asp:Panel>

                                                                                  <asp:Panel ID="VSP" runat="server" EnableViewState="False" Width="100%">
                                                                                  </asp:Panel>
                                  </cc4:ViewSiteControl>
                                  Then the compiler obviously throws an error saying that the id "VSP" is used twice. I don't know how to get rid of this problem permanently. It's very annoying. It seems to originate from the ViewSiteControl class. You can, however, trick it by removing those panels and then quickly compiling before VS adds more panels. :-)
                                  Regards,
                                  Marco

                                • Dennis (DevExpress) 11.28.2012

                                  Thank you for the sample project, Marco. We will research it and get back to you.

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Marco,
                                I have found out that the postback always occurs due to the following code in the ASPxWebControl:

                                [C#]
                                protected virtual void RegisterPostBackScripts() { if(IsScriptEnabled()) { if(AutoPostBackInternal || IsClientSideEventsAssigned() || IsServerSideEventsAssigned()) RenderUtils.GetPostBackEventReference(Page, this, ""); if(this is IRequiresLoadPostDataControl) RenderUtils.RegisterRequiresPostBack(Page, this); if (IsCallBacksEnabled()) GetCallbackEventReference(); // to include ms script file before our controls } }

                                In other words, if you handled a server-side event, it will always cause a postback regardless of the AutoPostBack property value. So, to avoid a postback, you need to remove the server-side event subscription and set the EnableClientSideAPI (or simply assign the ClientInstanceName property) property and handle everything via client-side scripts:

                                [XML]
                                <dx:ASPxButton ID="ASPxButton2" runat="server" AutoPostBack="False" EnableClientSideAPI="True" Text="ASPxButton"> </dx:ASPxButton>

                                Refer to the documentation on our ASPx controls to learn more on how to accomplish the latter part. Feel free to contact our ASP.NET team if you experience any difficulties with this part.
                                PS
                                I remember that in the past other customer reported us the same issue (Bug Report - Xaf Web Templates), but we failed to replicate it locally. I could not replicate it with your project. Would you please provide some additional instructions on this?

                                Show all comments
                                • Marco Kummer 11.30.2012

                                  Hi Dennis. Thanks for your research and your suggested solutions. So are you saying that none of the DX-ASP.NET-Controls can cause an AJAX-callback using server side events? And that I have to write javascript for every event I want to pass back to the server?
                                  You see, JavaScript is not exactly my favorite programming language since it shows the same deficiencies that VB6 had (no type safety, no proper object orientation, no real exception handling...). Why JavaScript manages to expose the same spaghetti code weaknesses while at the same time being promoted as a mature, fast and potent language and everyone jumping on that train... that's beyond my comprehension. But that's another story... ;-)
                                  Back on track: With MS ASP.NET controls any postback trigger (=server side event) placed inside an UpdatePanel will instead cause an AJAX-callback. Is there no equivalent to this behavior with DX controls?
                                  I really would like to get this XAF iPad/Tablet template going, and from what I saw in your KB and forums, a lot of people are asking for something similar. Would you be willing to invest some more support time than usual to help me accomplish this task? In return I'd make the whole code available to the community of course.
                                  Thanks and best regards.
                                  Marco

                                • Dennis (DevExpress) 12.03.2012

                                  Hello Marco,
                                  In fact, you can get the expected behavior with our controls (as you can with standard MS controls) by tweaking them a little. This is well explained in the The Concept of Callbacks KB Article.
                                  Please feel free to contact our ASP.NET team if you experience any difficulties or require any additional insight - we will be glad to help you.
                                  As for the mobile template, we have received several requests from our customers in this regard (e.g., Separate Web Application For Mobile Issues and Mobile edition template), but the overall interest in XAF mobile template is not significant at the moment, at least according to our stats. Although the XAF Web UI can be used on touch devices (thanks to DevExpress ASP.NET controls used in it), its UI has to be dramatically changed to be effectively used on mobile devices. This will most likely require input from the XAF developer itself or even from the framework. Providing another mobile template is not sufficient. Your current idea is certainly good, but we are still looking into this direction and cannot offer the immediate assistance you are looking for, because all this work should be carefully planned for a specific release before investing any time into it. Hopefully, this is really not a huge task and we can respond with support for the mobile theme (e.g., iOS) for the existing XAF Web UI in the future, but I cannot give any promises for now.
                                  Sorry for not being much help at this time. As an alternative, you can try to combine your resources with the eXpand Team, with which I talked in the past on a similar subject.

                                • Marco Kummer 12.05.2012

                                  Hi Dennis
                                  Thanks for your answers. Can you just answer me this: Do you think my efforts in creating a mobile template for XAF are justified when looking at the next 1-2 years? I really would hate spending days on this project just to learn that full mobile support will be added in say 2 releases. From what I understand you're saying that there's not even a point in your roadmap that includes mobile web device support for XAF, correct? What about support for Windows RT / Metro UI ? If the latter is planned, it would basically eliminate my requirement for a generic mobile XAF template.
                                  Thanks!!
                                  Marco

                                • Dennis (DevExpress) 12.05.2012

                                  Marco, thank you for getting back to me. Honestly, it is very difficult for me or any one else to answer this question, because as you see, everything in the world is changing very quickly. Yes, we discussed the possibility of providing such a mobile template internally, but have not planned anything for a specific release. I also cannot promise that it will not change in a month or two. We have not planned support for Windows 8 UI in XAF yet, but think that it may be difficult to convert the existing XAF infrastructure to it, because this new UI follows a different paradigm, which is unlike the old good desktop. If you are looking forward to creating apps for Windows 8 tomorrow, you would be better served by our DXTREME product.
                                  If I were in your shoes, however, I would evaluate what the XAF community thinks of the mobile Web UI template idea. The easiest way to do this, which also proved itself quite effective in the past, was discussing it in our groups in social networks.

                                • Marco Kummer 12.05.2012

                                  Hi Dennis! Thanks so much for your reply. I'll check out those sources. Let me just share one final thought with you hoping that you'll share it with the dev team: I don't see why XAF is bound to desktop apps. On the contrary I think it is the only framework that has the potential to run on virtually any platform. Why? It consits roughly of:
                                  - Real world business objects
                                  - Actions that act upon those objects
                                  - Sortable and searchable lists of those objects
                                  - Detail views to edit and browse those objects
                                  - Platform-independent conditional display of object properties
                                  - Reports
                                  - Statistics
                                  Those are things that exist in the real world no matter if I'm developing for Win RT, mobile web or windows desktop. Therefore they are "translatable" to any platform. The platform-independent XAF app module only contains the metadata that describes relationships between those items. In my view this makes XAF easier to adapt to a new platform or UI paradigm than any other product. If the iPad paradigm requires an XAF action button to be stashed away behind a popup button... who cares? It's still the same action to the platform independent XAF module.
                                  So please don't degrade XAF prematurely! I've looked at DXTREME and I'm not at all happy with it because it relies hevaily on JavaScript... again emphasizing the word "Script" here ;-)
                                  I'll leave you to your work now, and thanks again for the superior support!!
                                  Marco

                                • Dennis (DevExpress) 12.05.2012

                                  I appreciate the time you took to share your comments. I will definitely share this with my team.
                                  Feel free to contact me if you have any further difficulties.
                                  PS
                                  Although I agree that the XAF metadata approach is quite universal and can be used as a basis to build a UI for any platform, may I ask how you will make your application non-static and provide business and UI logic to it? In particular, how would you force the XAF controllers to work in an Android or iOS mobile application? It would be interesting to hear your thoughts on the subject, because when thinking over these questions it does not seem to be as straightforward as it appears at first glance.

                                • Marco Kummer 12.05.2012

                                  Hi Dennis. I'll gladly share my view on how to turn XAF into a universal solution. First of all rest assured that I know that XAF is not THE solution to every problem. So the following strategy "recommendation" is based on the assumption that we're buildung an enterprise business solution. Towards the end it will become apparent why this distinction is important:
                                  - XAF already covers Windows Forms
                                  - XAF already covers general web use with the ASP.NET platform
                                  - The full Windows 8 (not RT) allows "emulated" Metro UI based on WinForms. With DX 12.1 you guys shipped terrific components to build the bridge. So integrating this technology into XAF could be achieved by either creating alternative WinForms templates or more likely by adding a new platform executable module.
                                  So what we haven't covered yet are the more "closed" systems which all have a sort of sandbox-like approach to building apps:
                                  - Windows RT and/or Windows Phone 8
                                  - iOS
                                  - Android
                                  Since all of those technologies are exclusively used for mobile computing, they will connect to their data sources only through the cloud. We ARE talking about enterprise business solutions, so nobody can nor wants to carry around their company's full ERP database on a windows tablet or ipad. And since we're not talking games either, we don't need super fancy visual effects.
                                  This frees us from having to deal with platform specifics on those sandbox systems. All we have to do is connect to the central datasource in the cloud, visualize data and send back changes to the cloud.
                                  Assuming that the middle tier of XAFwill be greatly enhanced, it would therefore be enough to create a new powerful HTML5/AJAX/ASP.NET platform module for XAF which is exclusively optimized for those mobile devices. After all it is possible to make web apps highly responsive using those technologies. This would provide us with the following additional advantages:
                                  - Very little javascript / HTML coding required for your customers (=developers). After all we are MS technology developers.
                                  - Hardly any issues because of Android's tablet mess (every device behaves differently and native app developers hate it)
                                  - No knowledge of native Android / iOS development required (again, we're MS tech based and should focus on that)
                                  - Fast, easy deployment without the need or fees for app stores. Again this is a major advantage for internal enterprise development as it simplifies things and speeds up the dev and deployment process.
                                  - No worries when new mobile OS's emerge or big corporations like Apple are having mood swings (blocking apps in their stores for no apparent reason etc.)
                                  If interaction with the mobile device's native functions is required, developers can easily create a so-called hybrid app where they're essentially just showing a big browser control that connects their web app to the device's native functions (camera, location services, file system, etc.).
                                  Developers and end users just want to get the job done; I don't think anyone really cares if an enterprise app runs as web app or as a native tablet app as long as it feels responsive and adapts to the device's size. The only area where another native client for XAF would make sense is Windows RT / Windows Phone. And that's because those are based on MS technologies like C# and XAML, so they would nicely fit into the existing DX and XAF portfolio.
                                  Thanks for letting me share my thoughts!

                                • Marco Kummer 12.06.2012

                                  One thing that came to mind today: Why don't you guys use DXTREME internally to develop a universal mobile frontend for XAF ? Then all problems are solved.

                                • Dennis (DevExpress) 12.06.2012

                                  Thank you for your detailed explanation, Marco. I highly appreciate it.
                                  Let me comment on some of your points.
                                  >>
                                  - The full Windows 8 (not RT) allows "emulated" Metro UI based on WinForms. With DX 12.1 you guys shipped terrific components to build the bridge. So integrating this technology into XAF could be achieved by either creating alternative WinForms templates or more likely by adding a new platform executable module.
                                  <<
                                  I remember we did a spike in this regard in the past and it was technically based on a custom ShowViewStrategy + WinForms document manager features. However, we soon recognized that to provide a really good Windows 8 UI emulation it would require additional effort from XAF developers, since this cannot be achieved by just changing a single UseMetroUI option in the Model Editor (as they are used to doing currently). This is because a typical detail form contains dozens or even hundreds of fields and its layout needs to be redesigned for use on the Windows 8 UI and touch devices. So I think it will be easier and more productive to build this using DXTREME from scratch.
                                  >>
                                  Assuming that the middle tier of XAFwill be greatly enhanced, it would therefore be enough to create a new powerful HTML5/AJAX/ASP.NET platform module for XAF which is exclusively optimized for those mobile devices. After all it is possible to make web apps highly responsive using those technologies.
                                  ...
                                  Why don't you guys use DXTREME internally to develop a universal mobile frontend for XAF ?
                                  ...
                                  <<
                                  Yes, we hope to continue to strengthen our application server with new features, especially if our customers keep asking for them and find them useful. As for mobile clients for the platforms you mentioned, we hope that DXTREME will be the answer for the customers who already have desktop ready XAF clients + application server and are now looking for a mobile solution. Please track the How to add wcf service to the middle tier Application Server ticket to be automatically notified when the example and blog post I am currently finishing up is available (How to configure the XAF middle-tier security service and deploy it in the Cloud for further use by desktop XAF and mobile DXTREME clients).

                                • Marco Kummer 12.10.2012

                                  Hi Dennis
                                  The difficulties you mentioned are real, yes. But they can be overcome! If I were you guys I'd add mobile support in XAF using a two-step plan (maybe step 1 for 2013 and step 2 in 2014):
                                  STEP 1:

                                  1. Create mobile templates (tablet / smart phone) for the ASP.NET platform in XAF. Will there be trade-offs? Yes, but limited mobile support is better than no support.
                                  2. Introduce a new naming convention for views: "Customer_ListView-Tablet" will be used on tablets if it exists. Same for "Customer_ListView-SmartPhone". The same concept needs to apply to DetailViews of course. This allows the XAF developer to create reduced views for those devices, and voilà, all major problems are solved!
                                  STEP 2:
                                  3. Include an ODATA access service into the middle tier server
                                  4. Add two new platform targets in XAF solutions: Tablet and Smart Phone. So you'll have:
                                  - MyProject.Module
                                  - MyProject.Module.Tablet (contains model differences for tablets)
                                  - MyProject.Web.Tablet (executable layer using DXTREME, accessing ODATA from middle tier server)
                                  - MyProject.Module.SmartPhone (contains model differences for smart phones)
                                  - MyProject.Web.SmartPhone (executable layer using DXTREME, accessing ODATA from middle tier server)
                                  You see, I have about 3-5 years worth of C# code base in XAF and XPO. Numerous end customers are running on that code base and eventuall will want to add mobile support. The fact that MS is joining the HTML5 / JS hype (until they realize that they can't rewrite MS Office in JavaScript after all) is not a good enough excuse to just put the whole XAF stuff on hold. WinRT and ASP.NET are still current and supported technologies and they are also based on .NET, just like XAF!!
                                • Dennis (DevExpress) 12.11.2012

                                  Marco, thank you for your feedback. We will consider these options. I hope to blog about the second option by the end of this week. Please stay tuned.

                                • Willem de Vries 12.17.2012

                                  +1 for Marco!