JQgrid and Java - java

Can someone point to jqgrid + java web app solution or especially with populating the grid and sending the form back to server. there are several php examples but nothing on java.

If you want to use some advanced tools like Spring, Hibernate and Maven here is the good example.
http://krams915.blogspot.in/2012/01/spring-mvc-31-jqgrid-and-spring-data_1887.html
EDIT:
See this, if you want to use plain Servlet and JSP. This is very basic example.
http://javahunter.wordpress.com/2010/12/07/jqgrid-example/

Here is one example on the web:
jqGrid Forum: how-use-jqgrid-in-jsp-server-one-example

If you are using struts2 there's a plugin which includes jqueryui and jqgrid components.
http://struts2-jquery.googlecode.com/

Related

jQuery and JSON to retrieve data from database in Java web app?

I am doing a Java web application project wherein it one of its purposes is to display all data from the database. It uses the Hibernate, Struts2 and Spring frameworks. However, I want the application to retrieve the data using jQuery and JSON. Would that even be possible?
How would I do that? And are there any tools needed to achieve that? I can't find any tutorials online. Hope someone could help! thanks.
Java script can be used in any HTML widgets. It is not necessary that should be spring , struts ,etc. ultimately all these frame works will spit the HTML outputs. So what you have to learn is how can you invoke a java script function in the HTML widget. For your refrence I would to give some example
<spring:bind path="accountForm.account.someData">
<SELECT name="<c:out value="${status.expression}"/>" size="1" onChange=dynDisplay();>
</spring>
So Here I am calling a method called dynDisplay() on selecting of the widget someData.like this you can call any function and perform any task using javascript or jquery.
Yes it is possible, and actually the best scope, i recommend you to read the following tutorials and examples and then come up with a solution:
To convert java objects to json and viceversa use Jackson
http://www.mkyong.com/java/how-to-convert-java-object-to-from-json-jackson/
A great tutorial on Spring MVC and Hibernate integration:
http://www.beingjavaguys.com/2014/08/spring-restful-web-services.html
To get a json response out of a web service with jquery
http://api.jquery.com/jquery.getjson/
Finally a simple Struts 2 and Spring integration example
http://www.mkyong.com/struts/struts-spring-integration-example/

Highcharts, MySql and Vaadin

I am looking for an example on using Highcharts with data from MYSQL in java with Vaadin framework. I literally don't know whether it is possible.When i tried for Vaadin InvientCharts I was redirected to Highcharts. Highcharts looks promising for my project but i want to use along with Java and Mysql. Please elaborate me if I am wrong. I am beginner to this.
Yes, it is possible. Invient Charts (which is Java wrapper for JavaScript-based HighCharts) is totally independent on the data source. The Invient Charts package contains instructions and an example how to use it in your Vaadin project.
You can use Vaadin SQLContainer addon to get the data from your database. There's a simple example behind that link.
You can use JPAContainer or HbnContainer.
The addon suggested my #miq seems to be not maintained anymore.
This one looks more current:
https://vaadin.com/directory#!addon/highchartsapi-add-on

how to start on using DataTable in Jquery

I am trying to learn Java and Javascript. Currently I following MVC, where i have servlets that will send data from a table to a JSP and I disply the data in table.
i am trying to make this table editable and create a good look and feel of the table using DataTable, however i am not sure how or where to start..Can someone please help me on this. I am a beginner and any simple example on on how to use DataTable would really help?
Thank you!
There are several examples here: http://datatables.net/examples/
Datatables is a great plugin if you want to show the data. But in my experience, it is not simple to interact with the server.. Like... add a new tr and create an instance on database using java. It is complicated this interaction.
In my experience, I would use primefaces datables: http://www.primefaces.org/showcase-labs/ui/datatableBasic.jsf;jsessionid=1si9n7bh9e6921gz0mj3w42ew3

Web UI for existing Java application

I am trying to build a search engine using java and the lucene API as part of a project. For the last step, we plan to build a web UI (a local host would do) for the same. Are there UI softwares/plugins for eclipse which will allow me to call the functions present in the java classes?
Essentially I would want to have a search box and a search key, pressing which will throw up the search results(which is computed from the java program). javascript cannot call java code I understand. So using that is eliminated?
Any suggestions on what to use will be greatly appreciated. I have pretty poor knowledge in front end design!
Cheers!
AB
If all you have is a simple screen with a entry field and a button and you simply want to return an html table. I would go with a servlet and two jsps. Your servlet can call your search engine and then have the jsp format the data into the table. If you do not know web apis this is probably the easiest entry.
I think, If your using JAVA, that you should look into JSF.
It's a rather easy to maintain and work with library for just the uses you describe.
I recommend these tutorials to get you started: http://www.coreservlets.com/JSF-Tutorial/jsf2/#Tutorial-Intro
There are lots of options to achieve this.
you can create web-ui using jsp.
I have also created same type of project using Lucene, here i have used spring mvc.i have provided all the back-end process as REST api which any web-ui can use.
Please do not look into JSF; it is an overengineered pile for your task.
Sure you can call your java code from javascript, you can make it really simple with something like DWR.
However, for your project I would suggest GWT as then you only deal with Java and it will generate javascript, html and css for you.
For your project you dont really need an "enterprise" level framework like spring or a fullstack JavaEE, you could keep it real oldschool with only JSPs and html/javascript. However thats a bit too flaky for my taste, so go with GWT.
With GWT you basically set it up, define your module, entrance point (look at the hello world), and then you add a layout to your page like something to place the searchbox into and the resultbox to. Then you call your other Java code and classes from there like you normally would.
I would suggest you to use GWT in your application because GWT enables you to call java methods and it will also convert Javascript and css for your Java modules after GWT compile.
GWT reference :- http://code.google.com/webtoolkit/gettingstarted.html
If you're going to use GWT, you could aslo check Vaadin.
Creating a search UI is really simple, and the tutorial show a criteria /result table application taht could be adapted.

Dyanamic Graphs using jsf

My requirement is I need to populate dyanamic graphs in a jsp page. I am using jsf for my project. I planning to use "jfreecharts" but dont know how to bind my jsp page with the back bean. I have some drop downs on the basis of the selection I my BackBean is fetching the data from the DB. Can you please suggest me some procedure to that with some sample code for my reference?
You can use Fiji (Exadel) library.
They have charts, as well as support for wrapping SWF elements and sending properties in JSF.
See an example here. For each component, there is source code as well so you can try it yourself.
Primefaces has a nice chart component as well.
Fiji is very nice but check out this http://www.fusioncharts.com/

Categories

Resources