As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have been looking for a good Java web framework and found Tapestry, which looks quite nice from an application architecture point of view. Another possibility is ASP and .NET, though I'm reluctant to use them since Java is the programming language most of the company's developer are used to. The reason why ASP is considered is due to its rich set of powerful UI widgets (http://demos.devexpress.com/ASPxGridViewDemos/GridEditing/EditModes.aspx for instance). Is there anything similar for Tapestry? What I am particularly interested in is tables (sorting, filtering, moving columns, hiding columns, etc.) and possibly others. Alternatively, is there a sophisticated Javascript library which can be easily integrated in Tapestry?
At my current job we use Tapestry 4, and we chose to use ExtJS widgets when we need a fancier UI component what Tapestry provides. Their grid widgets are exceptional. ExtJS isn't free for commercial apps, but the abundance of great widgets and documentation makes it really easy to work with, and it integrates pretty easily into Tapestry.
Another option would be to use Java Server Faces, which has several high quality component/widget libraries.
A big library of UI components is a good things. On the other hand there may be no such a set of predefined components that will suite everybody or suite anybody in an ultimate way. The alternative to relying on predefined components (which besides all may require an unexpected time to be learned) is to use a technology with which writing your own components would be an easy pleasure unlike what we see in almost every major Java Web Framework. The approach was implemented in HybridJava which in fact pushed it to the limits with zero predefined components. Yet it may be the most powerful for a task like you've describe.
Tapestry already offers a powerful Grid component.
This component covers all the features you are looking for.
Have a look at jumpstart to see how to sort,move columns, and hiding columns.
if you prefer the jQuery way perhaps you will have to check "Tapestry5-jquery" that proposes some components that make it possible to use jQuery plugins. The demo site only show the default grid component because it's implementation is still the best one.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I started using Javascript for HTML5 mobile development but noticed I can use the jQuery library as well. My question is, does jQuery do anything besides require you to write less code? Is Javascript faster in performance? Sorry for the newbie question but I couldn't find an answer and really interested in the difference. Thanks in advance
jQuery is a library built in JavaScript. The more you abstract the less performance you'll get. For example, just selecting an element with the native DOM methods is going to be way faster than doing the same with jQuery.
So the question is not quite "find out which one is faster", you already know jQuery is going to be slower. The question is more like "is the performance hit worth it?". And yes, most of the time it is because the time you save in writing code is much more valuable than the performance hit you get, which most of time is simply negligible.
Another factor is the quality of your vanilla JavaScript code. jQuery has been tested and maintained for years, and it shows.
Your question should not be "should I use jQuery or plain JavaScript" but rather "which library should I use?". No one should be starting a substantial project with zero code, they should have at least a good collection of robust, tested code that can easily be collated into a library or tool kit.
The problem with a general library is that it must provide general solutions, hence why jQuery has 4,000 lines of code that any one project might only really need a few hundred lines of. Some libraries have very many more lines of code. If you use someone else's library, you are often bound to their update schedule and may well end up using plugins that require different versions of the library.
If you have your own library, or one developed and maintained in your work area, you get the same reuse of code and can cut your cloth to suit the project. jQuery (and most general libraries) are monolithic: it's all or nothing, you can't include just one part or another (e.g. you might just want a good addListener function). Your own library can be modular, so you only include the code you need and can avoid many of the cross–browser issues that general libraries must deal with. David Mark's "MyLibrary" is one of the very few modular libraries.
Also, cross–browser differences are becoming less and less of an issue and the DOM API is becoming richer so there is less and less need to use a general library. E.g. no one accounts for document.all anymore, or bothers with browsers that don't support either addEventListener or attachEvent. Once support for IE 6 and 7 can be dropped (a few years yet) there will be very little reason to use a monolithic third party library, modularity will be the key. Everything will be a plugin, there will be no need for a base library, or the base library will be very small to provide a generic API for basic DOM functions.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'd to know examples, recommendations and frameworks to start in a right way to refractory a single page web app with html, css and js files (jquery) in a MVC/MVP js application that needs to works in a ie 7 at least (this is mandatory), but if its possible I'd like that this app could works well in others browsers too.
The code is a lot of ifs and else and each one use the document.write() js method to write page elements. To 90's style yet, like bellow:
if ($auth$ == 19) {
document.write("<TR>");
document.write("<TD NOWRAP WIDTH='100%' height='26'>");
document.write("<font face='Arial, Helvetica'><B>$username$</B> you cannot access your account.<p>Please contact your Security Administrator or Help Desk.</font>");
document.write(" </TD>");
document.write("</TR>");
}
80% percent of this web app is written in this way depends of the external variable values
What are the js modern frameworks or a modern approach that let me able to prototype this in a MVC/MVP js way?
Some references? tutorials?
I'm glad for your help, thanks!
I spent quite a bit of time researching whats available. KnockoutJS has a great tutorial site. Then I found AngularJS which is much more complex because it does so much more. Angular is a full framework to do your routing, databinding (without observables), as well as letting you build your app domain centric by using directives.
Another thing I love about the Angular team is that they are all about testing. They released the Testacular test runner which watches your file system and when any file changes, it runs your unit tests in a browser of your choosing. Automated browser based unit testing, I became hooked pretty quickly.
I have read many people not preferring AngularJS because the there are so many other bits out there that are constantly evolving that are focused on specific aspects of SPA, such as historyJS, backboneJS, sammyJS...Each of these have their own focus and may do the job better. I personally trust AngularJS as its backed by google, and its community is really growing.
John Lindquest has a great set of tutorials he just started recently at egghead.io.
There is a modules community at ngmodules.org which demonstrates the ease of building expansion modules into an angular app.
The youtube page for AngularJS has been very helpful for me to keep up with the suggested structures for your angular app.
I would suggest checking them out. Once you wrap your head around doing it the angular way, you really change your way of thinking.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been doing HTML layout as well as programming for many years and I'm seeing a growing issue recently. Folks who primarily do HTML layout are becoming increasingly more comfortable using JavaScript to solve basic page layout problems. Rather than consider what HTML is capable of doing (to hit their target browsers), they're slapping on bloated JS frameworks that "fix" fairly basic problems.
Let's get this out of the way right here: I find this practice annoying and often inconsiderate of those with special accessibility needs.
Unfortunately, when you try to tell these folks that what they're doing isn't semantic, ideal, or possibly even a good idea, they always counter with the same old arguments: "JavaScript has a market saturation of 98%, we don't care about the other 2%." or "Who doesn't have JavaScript enabled these days?" or simply "We don't care about those users." I find that remarkably short-sighted.
I would like the opinion of the community at large. What do you think, am I holding too fast to a dying ideal? Is JavaScript's prevalence a good excuse to use a programmatic language to do basic layout, thus mucking up your behavior and layout? jQuery and similar "behavior" based frameworks are blurring the lines, especially for those who don't realize the difference.
Most importantly, I would like some "argument ammo" to use against these folks when the "it's the right way to do it" argument is unacceptable. Can you cite sources outlining your stance, please?
Thanks everybody, please be civil :)
I consider myself also "old-school" and intend to use javascript in a way that increases user experience, but it is not necessary. So for example (not layout, just easier to understand) i would alert you with js if you haven't filled a required field in the form, but if you have js turned off I'd still "catch" you on the server side.
And yes, wherever I can I try to use static html+css. A good example is: many people use jquery animations, but in some circumstances it is easier / faster / smoother to use css transitions.
I agree with you, but because of the 2% but because of the inconsistent page load. As soon as you use client side functions to change the layout you have a short delay between the fully loaded page and the whole functionality. I usually try to do as much as possible with html/css.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm trying to learn JavaScript, but seem to be going around in circles regarding primitives, objects, functions, etc. I can code fairly well in Python, so the JavaScript part is now mostly about syntax and idioms.
I am overwhelmed by the choices and I'm not sure how to choose: Prototype, jQuery, Dojo, Node.js, Backbone.js, etc.
What would be good JavaScript framework/s to pick up after mastering the basics? At the risk of betraying my JavaScript naivete, I'd like one (or a combination of) framework wherein I can do asynchronous requests, data visualization, and UI implementation.
I can do asynchronous requests, data visualization, and UI implementation.
async requests means XHR2
data visualization and UI means HTML, DOM4 or <canvas>
If you want to learn and really learn stick with the low level basics and don't use bloated abstractions.
Sure when you use jQuery you might finish it faster, but you won't learn anything other then how to hack together spaghetti code using jQuery. Your code wouldn't be anywhere near as maintainable, stable or performant if you had just learned how to do it right with plain old javascript.
I wouldn't be right to not first say to make sure you understand JavaScript itself first. It's a rather unique language with both good parts and bad parts. If you take the time to understand closure, prototypal inheritance, this keyword, constructor functions, etc, you will thank yourself. JavaScript, The Good Parts is an excellent place to start. Anyways...
For basic DOM manipulation, event handling, ajax, etc jQuery is the clear winner. In the past, Prototype/Scriptaculous was a common alternative.
For more advanced browser-based applications, Backbone.js, Angular.js, and Ember.js are the winners.
Dojo, Mootools, ExtJS, and Knockout.js are some alternatives to Angular and friends... all with varying strengths and focuses.
There are countless libraries for charting. HighCharts is a popular one. For more advanced visualizations, check out D3.js and Raphael.
Node.js is different beast. It's a server-side, network IO platform. It's competitors are things like Python's Twisted and Ruby's EventMachine.
Of course this topic has been covered in great length here:
https://stackoverflow.com/questions/394601/which-javascript-framework-jquery-vs-dojo-vs
For the first steps I'll recommend jQuery, with it's intuitive syntax and ability to be extended with bunch of plugins, and for it's strong community and huge amount of articles, tutorials, etc. on the internet.
jQuery is a cross-browser JavaScript library that provides
abstractions for DOM traversal, event handling, animation, and AJAX
Try it at first, then you can go with other frameworks based on the task requirements like Raphaël JS for vector graphics,Processing.js for animations, etc.
I would suggest 3 main/major frameworks to consider. The reason I choose the following 3 is because they are fairly well supported, document and used, but more importantly - they all suggest a different coding style/convention.
Dojo
ExtJS (Sencha)
jQuery (UI/core)
Should be noted that any one of them can be fit to almost any coding style/preference, but if I were to create the perfect (from working with it standpoint) framework, I would do a hybrid:
Dojo's widget creation and styling + ExtJS layouting capabilities and stores-based data managemenet + jQuery DOM manipulation and AJAX support.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been using Ext JS as my rich-widget toolkit for a while, but I'm thinking of moving to YUI, partly because of the less restrictive license.
The component-oriented model used in YUI seems quite similar to the one that I've enjoyed so much in Ext JS, but I'm interested in how deep those similarities are. So I'm interested in feedback from people who've used both Ext JS and YUI. What is the same, and what is different? What do I lose by moving to YUI, and what do I gain?
I think both libraries actually address different needs.
YUI is designed addresses the needs of Yahoo inc. It is very good at building public facing applications where things like graceful degradation, clean markup and accessibility is important.
ExtJS is a very good and well designed full RIA framework that is very firmly targeted at building line of business applications. Features such as a really powerful grid component, strong layout and good professional look and feel.
I've used both quite considerably, although only up to YUI 2.7.0 and have built several full RIA using the frameworks.
Moving an existing application from one to another would be quite differcult as although they share a common ancestor (ExtJS was once YUIext) the frameworks are quite different now.
One major difference is that YUI is distributed under the extremely permissive BSD license whereas ExtJS is distributed under a very viral interpretation of the GPL. For instance, with Sencha's interpretation of the GPL, if you write a SOAP or REST interface specifically to talk to an ExtJS front end then your server code must be GPL and you must provide access to the source since you have "distributed" it by granting access over the web. Sencha does provide a commercial license for their code but if you read their docs carefully you will see that they do not allow you to convert code you wrote against GPL Sencha to another license when you switch to the commercial version. (http://www.sencha.com/legal/license-overview)
In short, if your code needs to integrate with proprietary business logic or commercially licensed systems then you must develop using the commercial version of Sencha from the outset.
For me the difference is that YUI is very lightweight and flexible, whereas ExtJS is heavier, with a bigger footprint and more rigid in the way you use it. YUI is great if you know what you're doing in Javascript and want to extend your power; ExtJS is good if you want a UI abstraction layer that you don't have to mess with much ... but if you do want to make it do things it wasn't designed to do, it can be a real chore.
When building a recent application I had the exact same decision to make YUI or Ext JS.
I ended up going with YUI for a few reasons:
YUI 3 is extremely light weight and fast for simple tasks and the lazy loading makes things even faster.
Graceful degradation was important for this app.
Using YUI 2 widgets in YUI 3 is rather easy and with 3.1 literally weeks away that will become even easier.
YUI documentation is unbelievable and the irc chat and forums are very helpful and actually have people from the YUI development team.
In a time when all applications are migrating to the web, the clear line drawn by Gareth between public facing and Business app doesn't make sense too me.
I prefer the other answers, like the one of Robusto, and compare both framework on technical/financial grounds.
YUI advantages:
Free
Lightweight (HTML + Javascript)
More efficient
Easier to learn and understand
Better documentation and examples
Larger community
Ext advantages:
Richer features & components
Some (undocumented) Server Side driver (like .NET) (although using such libraries on the server seems bad design)
Conclusion:
If your web site doesn't require the extra features provided by ext, go for YUI.
I haven't used ExtJS a lot yet, still in a learning phase, but for what I was able to do with it, I'm pretty sure that even a little more than 1 year ago when I was doing a lot of YUI dev, it would have been much more challenging and the result would not have been as slick.
It's not too say you shouldn't do it, but my advice to you would be to make some serious research and good prototyping of some of the existing features you have to see if YUI will fit your needs. DON'T just base yourself on the examples and the feel of "Yeah seems that would work".
With the GPLv3, it states that as long as your users are all part of the same legal entity that you do not need to share the source code. The verbiage technically states this as if they are not part of the same legal entity, then you need to provide source. But this doesn't mean Sencha won't change the license later. It also doesn't mean they will either.