I am pretty new to apex development and am having trouble finding documentation on AJAX implementation. I have a few buttons that navigate to different pages. Some of these pages run very expensive sql statements and it takes a while to load. I would like to add an ajax loader just to give the user some feedback that the system is currently loading the next page.
How can I do something like this? Does Apex 4 include AJAX or do I need to load a framework such as JQuery? Any help or direction would greatly be appreciated.
Apex 4.0 includes jQuery. It also has a concept called Dynamic Actions that would enable you to achieve your requirement very easily.
Related
It hadn't been doing that. Nothing seems to be triggered when the page is loading. What would trigger SSJS validation to run upon opening an xpage?
Your question is too vague to give an exact answer. I recommend watching the XPages Master Class. It will explain the JSF life cycle and show you how to use the XPages toolbox to diagnose your application to get the answer.
Check any partial refresh calls. Use firebug to view network traffic
See if any Ajax calls are being made when page loads. Also check
If you have any converters altering data that might trigger the validation
Currently i have been using an iframe component to display a php page that i have written. the reason i used iframe rather than writing a joomla component in the first place was for 2 reasons, the information that is displayed in that page is from a remote mssql sever and the second was that i didnt really understand how to write one.
Now i have completed the creation of the php page that i display within the iframe, but now i need to be able to have it inherent within the joomla site, for both display reasons and security.
basically its a single page that displays information in a bunch of drop down boxes and then a submit button is clicked and it posts that information to another php page that again queries the mssql server and displays the results based on the post from the previous page.
query.php, posts some variables to results.php and is displayed in a table.
i have the functionality perfect, but i dont understand the documentation i have read so far. is there any simple component i can see the code of so that i can try and work out whats going on?
You might want to look at http://docs.joomla.org/J3.1:Developing_a_MVC_Component/Introduction and follow the process outlined.
I have a requirement of having the same URL throughout the application navigations. Like below
http://www.[Site Name]:com. (Here User should not have the idea of chaning the URL from one page to another page)
I am using ASP.NET MVC3 with latest Razor View Engine,
Can some body give suggestions on this?
Advanced Thanks,
Satish Kotha
This may make it very difficult for users to access your site - they won't be able to bookmark a specific page, for example.
It sounds like you want a single-page-app (e.g. like Google Mail or Reader). In this case, you have one page and make heavy use of AJAX. You can query the server via javascript, and send back Partial Views, or raw data in JSON format which can be rendered on the client, possibly via some kind of templating engine.
As Graham Clark has already mentioned, this functionality will most likely be frustrating for the user; however, achieving it depends on the complexity of your project. You may want to look into using jquery to load partial views into the main content area of your site.
When you click on your navigation you can use jquery's load() to replace the main content on the page. Jquery-load-with-mvc-2-partialviews is an interesting blog post that may give you more insight into what you would want to do. Your code to load content could look something like this:
$("#mainContent").load("/Controller/Action",
{parameter}, function () {
// perform javascript actions on load complete
});
We are using Ajax Update Panel in SharePoint web part to avoid postback, Certainly it is the easiest approach out there to provide AJAX functionality.But at times it feels like the performance is horrible!
Are there any better approach where in you get better performance then AJAX update panel.
If you're interested in better performance then the Update Panel isn't going to help you.
It's purely a User Experience thing!
When you're using the Update Panel:
Browser is still doing the full post
to the server
Server is doing all the usual work
for ALL the web parts on the page
Server graps the HTML inside the
update panel and sends this and
ViewState to browser
Browser replaces ViewState and HTML
inside Update Panel
But Using the Update Panel is very easy and you don't have to know any JavaScript
Using "real" AJAX would mean:
You have to know JavaScript
You have to know/develop Web Services
BUT only the requested functionallity will have to run on the server, so you'll usually get a lot better performance
NEVER EVER EVER user MS Ajax and the update panel. You will be burnt sooner or later.
Instead, use jQuery, and it's AJAX methods.
Why?
A) jQuery is smaller (and therefore faster?)
B) You can do more with jQuery by iteself than ms AJAX
C) Trying to hide AJAX in server controls is a dumb idea from the start
d) Web forms and server controls in general suck - less is more
e) Sooner or later you will need to get down and dirty with AJAX - better to start at a lower level
I suggest instead of using Asp.NET Update Panel. You can create an .ashx file handler that will expose your server side functions. Then with this you can use jQuery and Ajax to call your server side functions. This will be faster and cross browser issues will be kept to a minimum.
I thought I would ask here about how to develop a wiazrd like control
in ajax for MVC before I started it.
The control will have pages that have data entry controls and
on each page submission insert data into a database.
Any ideas how to go about this?
Malcolm
Are you using a JavaScript library? I know dojo has a wizard in dojox namespace, and I'm pretty sure there are wizards for jquery. If not, I'd do a wizard just like I would tabs, without the tab bar, and each view contains a form and next, previous, cancel and or restart buttons, all of which would handle the ajax calls/state management and change the view.
If it's a wizard you probably actually should use separate web pages rather than having a single page that's updated through ajax calls, that way the forward and back buttons can work as nature intended in the browser for moving forward and back through the wizard.
Of course you can use fragment tricks to get forward / back working in a single page but in my experience this is tricky.