Register | Log in | RSS channel for codegravity.com homepage Bookmark!

284/2NEW projects | 71 services | 215 websites | 834/3NEW freelancers | 2126 topics | advertise



Login:



Forgot your password?
Forgot your username?
Create an account
JoomlaWatch Agent

Users

Most active users today from total of 108:
garikello, Peerke, jakkrit, dayanand, andrew_saber, giakhanh, mohalb, carmachhh, fguyon, dfireablaze, boho, phoeker, ozedfr, ashish_php, amoluca, blackie, JDev, tinytim007, Pascale, besoil


19.9%United States United States
17.9%India India
9.3%Germany Germany
5.5%Russian Federation Russian Federation
4.4%United Kingdom United Kingdom
4.3%France France
4%Australia Australia
3.8%Netherlands Netherlands
3.8%Poland Poland
3.7%Italy Italy

Today: 961
Yesterday: 1402
This Week: 5251
Last Week: 8869
This Month: 2363
Last Month: 37593
Total: 117043


Partners:

HTML5, CSS3, SVG, tutorials

Freelance ColdFusion, Flex, PHP

Olejomalby, abstraktne obrazy

Camping Europe

WinAsm Studio

Vyšné Ružbachy

Sochy, Reštaurovanie

R.E.M.

Valid XHTML 1.0 Transitional

RSS feed:

Statistics:
Search Engine Genie Promotion Widget
Home
Programming
jQuery in place editor plugin tutorial

Introduction

jQuery is an open source cross browser javascript library . jQuery is a very popular javascript library and has a lot of plug-ins for a wide variety of task . JQuery has got plug-ins from simple task like form validation to a lot of complex behavior. In this article I am going to discuss some of the very useful plug-ins of jQuery to do in place editing.

 

Jeditable

 

Jeditable is a very handy and small jQuery in place editor plug in . This plug in helps you make a lot of HTML elements directly in place editable with just a few lines of code

This plug in can be downloaded from

 

http://www.appelsiini.net/projects/jeditable

 

You can also get more information about it on

 

http://plugins.jquery.com/project/jeditable

 

 

Once you have downloaded jQuery and jeditable using this plug in is very simple.

I will start with a very simple e.g:-

 




Jeditable Demo








click to Update Text Here

This example creates a div element and clicking on it will make it editable. Once the user clicks on it and makes changes and clicks the data is posted to the script 'updatedata.php' (below the code for updatedata.php is shown).

 

In this example first I have created a <dev> element using

<div class="div_txt" id="div_text">click to Update Text Here</div>

 

 

 

To make this element in place editable you just have to add

 

 

$(document).ready(function() {

$('.div_txt').editable('updatedata.php');

});

 

 

 

The only mandatory parameter is the complete URL where the data will be posted when the user changes the content.( in our case its 'updatedata.php' or it could be http://abc.com/updatedata.php ) . My updatedata.php just echoes the value back so that it is displayed to the user back

 

<?php

//Add Code here to $_POST['id'] and $_POST['value'] and update

//in a database or file

echo $_POST['value']; // Return the changed value so that is displayed to the user

?>

 

 

Adding buttons and tool tips

 

We can even add Ok and cancel buttons when the user tries to edit the content in place. So when the user clicks Ok the data is posted to updatedata.php . We can also add a tool tip which can give instructions to the user like ‘Click to edit’

 

So if I add a new div element to my page as follows

<div class="div_txt_area" id="div_txt_area">Click on text here</div>

 

Then the following code

 

$('.div_txt_area').editable('updatedata.php', {

type : 'textarea',

cancel : 'Cancel',

submit : 'OK',

tooltip : 'Click to edit...'

});

 

will add two buttons when the user is editing the text as Ok and Cancel .

Also when the user hovers the mouse over the div the tool tip will be shown as 'Click to edit...'

 

 

 

Other Features

 

This plug-in has a lot of other features like

  • To use selects in , in-place edition

  • To specify a load url from which data is loaded in a Text area

  • To post data to a function instead of an URL

 

You can read a complete list of features with code examples at http://www.appelsiini.net/projects/jeditable

 

 

Another In-Place Editor

 

An another good jQuery in place editor plug in is the ‘Another In-Place Editor ‘

 

This is also a very good plug-in which makes HTML elements in place editable .

This plug in can be downloaded from http://code.google.com/p/jquery-in-place-editor/

 

Once you have downloaded this plug in and jQuery using this plug-in is also very simple .

An example to demo its usage is as follows

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

<title>Another In-Place Editor</title>

<script src="/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript" src="/jquery.editinplace.js"></script>

 

<script type="text/javascript" charset="utf-8">

 

$(document).ready(function() {

$("#div_text").editInPlace({

url: "updatedata2.php"

});

 

});

 

 

 

</script>

</head>

 

<body>

 

<p id="div_text">

Click to Update Text Here

</p>

 

</body>

</html>

 

Like the above example for Jeditable I have created one div element using

<p id="div_text"> Click to Update Text Here </p>

 

 

 

To make this element in place editable with ‘Another In-Place Editor ‘

You have to just add

 

$("#div_text").editInPlace({

url: "updatedata2.php"

});

 

 

This will make the element div_text in place editable and when the value is changed by the user and presses enter the data is posted to url parameter specified. (In our example it is updatedata2.php )

 

The parameters which are posted to the URL are

 

  • original_html; The original value in the element prior to the post

  • update_value; The value which the user changed

  • element_id; The ID of the current element



<?php

//Add Code here to add or update $_POST['update_value']

//in a database or file

echo $_POST['update_value']; // Return the changed value so that is displayed to the user

?>

The updatedata2.php just echoes the value back so that it is displayed to the user back

 

Adding a select for in place edit

 

We can even add a select in the in place edit so that the user can choose from options while editing. Once the user will select the value the data will be posted to url specified.

 

To do this I will have to create a div element

 

<p id="div_select">Click Here to Choose country</p>

The following code will add a select to the in place edit

$("#div_select").editInPlace({

url: "updatedata2.php",

field_type: "select",

select_options: "USA, UK , Australia"

});

 

To add the select you will have to add the parameter field_type as"select" and specify the options in select_options parameter.

Other Features

Some of the other features of this plug in are

  • Adding a saving image or saving text while the save happens on the server.

  • This plugin allows to submit to a callback function rather than to the server URL

  • This plug in allows validation of blank field



For a list of more features you can visit http://code.google.com/p/jquery-in-place-editor/

Some other good jQuery in place editor plug-ins

Following are some other jQuery plug-in which can be used for in place editor functionality

Conclusion

jQuery and its plug-ins have really changed the way UI is developed for websites now. The plug in described in this article make is very easy to make a UI in websites where there is need In place editable elements. Adding in place elements just take a few lines of code with the use of these plug-ins.



 

 

 
ORM frameworks in PHP

Introduction

 

ORM (Object Relational mapping) is a technique in which Objects oriented languages i.e Objects are mapped directly to relational databases. This is a generic concept which can be applied to any object oriented language like C++, Java, PHP etc and any relational database like Oracle, Mysql etc.

 

Object Relational Mapping Frameworks

 

Generally if you are working in a big web application you will have the data stored in some relational database. For e.g. If you are using PHP to build web applications there is a good chance that you would be using MySql as your relational database. As the application gets large dealing in with SQL in your PHP code gets very messy.

 

ORM frameworks are generally written in an object oriented programming language like PHP and map (or even generate) objects which directly map to relational databases.

 

So if you have an ORM object of customer and want to save it in your database the code required to do that would be some what like the following if you use an ORM frame work

 

$objCustomer = new Customer();

$objCustomer->name=”John”

$objCustomer->emaail=” This e-mail address is being protected from spambots. You need JavaScript enabled to view it ”;

$objCustomer->save();

 

Some of the good Object Relational Mapping Frameworks in PHP

 

CakePHP

 

 

 

CakePHP is a rapid application development framework in PHP. You can download it from http://cakephp.org/ .

 

CakePHP has a support for developing application with ORM and MVC architecture. The licensing of CakePHP is flexible as it is distributed under MIT license. CakePHP is a complete Object oriented framework.

 

As CakePHP is a complete MVC architecture supporting framework it is an excellent framework to use specifically if a new application is to be started. CakePHP also has a good mechanism to define relationships between different objects and tables.

 

CakePHP has a feature called as CRUD scaffolding which with one line helps you create views for performing CRUD (Create Read Update Delete) operations once your modeler is defined.

 

Doctrine

Doctrine is another good ORM framework in PHP. It can be downloaded from http://www.doctrine-project.org/ .

Doctrine allows one to write database query in Doctrine Query Language (DQL) which is a dialect of SQL which is inspired by Hibernates HQL. This provided one with the flexibility to easily change backend database without much rework. Doctrine also has support for hooks. Hooks can be used to validate data which is stored in the database or which is retrieved from the database. Doctrine also has other features like a caching framework and also the ability to combine multiple PHP files in one which reduces the performance which is due to inclusion of many PHP file at runtime.

Propel

Propel is an ORM toolkit written in PHP. It can be downloaded from

http://www.propelorm.org/

Propel is an open source framework which is under which is released under the MIT license. Propel has a component for source code generation which generated PHP classes on basis of datamodel definition language which is in XML. Propel also has a component which manages connections and transactions with RDBMS you are using.

Propel has a features of easily describing relationship between different objects .It also has features to define database transaction in your code which will help you ensure database integrity and also improves the performance of database queries.

CoughPHP

CoughPHP is only an ORM framework in PHP. It can be downloaded from http://coughphp.com/

CoughPHP is not an MVC framework and hence is very light weight compared to other PHP frame works which provide MVC functionalities as well .As CoughPHP is not an MVC framework it does not affect the ways your views are built .Because of this it can be integrated into existing projects also easily . It is an open source framework and is licensed under FreeBSD license.

CoughPHP generates all the PHP classes for the ORM mapping to the database. CoughPHP also provided hook like mechanism to validate or invalidate data before saving them in database. It also has support for specifying database transactions.

Symphony

Symphony is a MVC architecture web application framework written in PHP. It also has support for ORM .It can be downloaded at http://www.symfony-project.org/

Symphony is an open source framework which is licensed under MIT license. Symphony uses Propel or Doctrine as its Object Relational mapping layer. So if you are using Symphony you can use all the features which belong to Propel or Doctrine. As Symphony is a complete MVC framework it helps you create views controllers etc also. Symphony makes heavy use of other open source frameworks like Zend , Propel , Doctrine. So the features of these frameworks can be used when using Symphony. JavaScript frameworks like jQuery and prototype can be easily integrated as plug-ins in Symphony.

Advantages of using a PHP ORM framework.

Most PHP ORM frameworks generate code which is required for CRUD ( Create Read Update Delete ) operation on the database automatically . This helps in rapid development of the application as one requires to deal with only high level things of the application. The code for basic database functionalities is directly taken care by the PHP ORM framework

In relational database you have a type like int, text, blog etc associated to each field in the database. Some times we have to convert the type on the fly from get data or storing data in the database from PHP code. This all will be taken care by the PHP ORM framework which is used in the project.

As the PHP ORM frameworks are used by many people they are less likely to have security problems than hand written code specifically for your project. This protects your application from attacks like SQL injections etc.

By using ORM frameworks there is no mixing of SQL code with business layer code of your application. This makes the code much easier to maintain.

If during the lifecycle of the application the backend database needs to be changed then if a PHP ORM framework is will become comparatively much easier to perform a transition then if one was not using a ORM framework.

 

 

 

 
Interactive HTML5 as flash banner replacement

Introduction

HTML 5 is the new version of HTML.Like previous version of HTML this specifies the structuring and presenting content on the World Wide Web. But what we will roughly refer to as HTML 5 in this articles is actually the whole web technology stack (HTML 5 + CSS + JavaScript) and not only of the markup language.

So when we talk of HTML 5 we have a programming language JavaScript ( like flash ) a set of api and JavaScript frameworks and the new multi media features of HTML 5 like drawing graphics ( using the <canvas> ) , play audio( using <audio>) and video ( using <video> )

Features of HTML5 for supporting Media

HTML5 has added new features to HTML . To have a complete overview of HTML 5 and its features please visit http://dev.w3.org/html5/spec/Overview.html

But the tags for media support which are very important are

  • <video> tag

The video tag defines a video or other video stream.

<video src="/myVideo.ogg" controls="controls">
Video Tag Not Supported
</video>

  • <audio> tag

The audio tag defines sound, music or other audio streams

<audio src="/myMusic.ogg" controls="controls">
audio Tag Not Supported

</audio>

  • <canvas> tag

The canvas tag is used to display graphics. Canvas is just a container. One can use JavaScript to draw in the container.

<canvas id="drawCanvas"> Canvas Tag Not Supported </canvas>

<script type="text/javascript">

var drawingcanvas=document.getElementById('drawCanvas');

var drawingcontext= drawingcanvas.getContext('2d');

drawingcontext.fillStyle='#FFFFF';

drawingcontext.fillRect(0,0,70,70);

</script>

Web Development trend towards open technology

Web development is certainly moving towards open technologies and non proprietary standards like HTML 5. Moving towards open technologies becomes necessary for the developers specifically at client side technologies as they do not have control over it and are depended on what the client is using ( e.g. the client might be using IE on windows , or might be using IPhone to access the website ) . In such cases open standards and software are a better bet than a proprietary technology like Flash.

It is seen that JavaScript frameworks like Jquery etc are continuously replacing flash at least in things such as animated menus and basic web animation. So basically web developers are now using Flash at least for lesser things than they used to use it a couple of years earlier.

Software giants like Microsoft (which have there own proprietary Silverlight ) are also embracing open software like Jquery and are also going to make it a part of visual studio.

So with the in a war of flash (a proprietary technology) competing with HTML5 (an open standard), HTML5 (the complete stack) has a much better chance of winning till the features both provide are similar.

Also HTML 5 is render directly by the browser (flash is rendered through the flash plug-in), in case there are any bug in it they can be directly fixed by the browsers. The browsers don’t have to wait for adobe to fix the bug in the flash plug-in.

YouTube launches support for HTML5

  • One of the biggest site using Flash would be youtube . You tube launched support for HTLM5. The support is limited but this is a huge step towards HTML5.

Screen shot of youtube without a adobe flash plug-in

No flash on iPhones, iPods and iPads

There is no flash support on iPhones, iPods and iPads. Apple has rather given support for HTML5 on iPhones, iPods and iPads .

Steve jobs have shared his thoughts on flash and the reason behind not using as flash being a propriety technology and only adobe controlling it. So apple wanted to use open standards in their products ( i.e. on iPhones, iPods and iPads)

You can read a detail reasoning given by Steve Jobs for this decision on -

http://www.apple.com/hotnews/thoughts-on-flash/

Flash offers things that open web don’t offer (may be also not in coming years)

The HTML 5 (stack) is good for basic animations. But capabilities of Flash are still unmatched by far by any combination of open standards for higher end animation and interactive capabilities.

Javascript also is very processor intensive currently. So here also Flash presents a better solution for the sites which have a lot of animations and high interactivity like gaming sites etc.

Flash has a more than just video, flex currently provides a very rich programming model and create very rich interactive web applications.

Also the Action script engine is very robust and efficient which contributes to the popularity of Flash.

Developers can only move if the users move

One another major hurdle in HTML 5 replacing flash is the developers can use these new standards only if the users of the web sites move to software which supports these new standards. Still a lot of users use IE6 to access websites which is quite an old technology.

Though backed up by big software players HTML 5 video is also not mature enough still.

Tools to create rich content for authors

There are a lot of tools associated with flash to create rich content in flash. Some of these tools are specifically built and marketed by adobe itself. Such tools support is currently lacking for HTML5. This might not be a problem for developers. But authors who are not developers it would be a big problem if such tools are not present or easily available.

Conclusion

With all the factors mentioned above HTML5 ( stack ) at least in the recent years will replace flash for basic animation , but flash would still be a dominant technology for high end animation and interactivity applications on net . Total replacement of flash by

HTML 5 in recent years looks highly unlikely unless some combination of open technologies can provide all sets of features provided by flash.

But the use of flash will surely diminish as HTML 5 can do more and more things (like use of flash to do basic animation is greatly reduced) and if Adobe has to keep flash in the race against HTML5 and other open technologies it will have to continuously improve Flash and provide better features and capabilities the open standard can provide.

 

 
Java Data Repository performance

Scenario:
It’s a common scenario that a web site rarely updates the background database but frequently
access the database to fetch requested data. Consider the web site that provides the results of Secondary School Certificate exam of a country, based the population of that country the total number of students who attended the exam may be 2 million, 3 million or more. In India it may be more than 10 million. When the result is just published just think about the number of hits per second on that web site. A student just provides a Student Registration number and gets the result from the site. So should that
web application search the database every time there is a request for result in that site? To me it’s a
‘NO’. In the age of WiMax and 3G it is expected the website to appear in a twinkling of an eye. So if you
can provide sufficient RAM to that web server why don’t you use data repository. “Data
Repository”? Yes. Data Repository: It’s an implementation of virtual storage of a portion of a database or entire database.

The concept is:
Database (MySQL, SQL Server etc), Load the data in to RAM and refresh periodically Æ Response
of the data query. For each subsequent database query, after the initial loading, the response is generated from the data loaded into RAM. So, there is no need to knock the database for every query. This is a quite
faster approach. But remember if the database rarely has insert, update and delete operation this
approach is very much efficient. If the there is a change in the database the change will be reflected in the database only after the data repository is refreshed.

Implementation:
So in a web server how would you implement that? Here is an example to implement Data
Repository using Java and STRUTS framework. For simplicity I have omitted some minor parts such as
import statement, portion to fetch data from Database in the reload() method. I have also omitted
the details of the DataDTO class.

 

Implementing the DataRepository:

/*********************** Start of DataRepository.java************************/ 
public class DataRepository 
{ 
	// 60 Seconds, you can change it s u like   
  public static final long REFRESH_INTERVAL = 60 * 1000; 
  static DataRepository repository = null; 
  private long lastRelodingTime; 
  //Its a map to get Result using Registration number as KEY 
  HashMap regMap; 
  private DataRepository()  { 
    forceReload(); 
  } 
  public static DataRepository getInstance()  { 
    if (repository == null) 
      createDataRepository(); 
    return repository; 
  } 
 
  private synchronized static void createDataRepository()  { 
    if (repository == null) 
      repository = new DataRepository(); 
  } 
  private void reload()  { 
   // DataDTO is the clas to hold Registration Number,  
   // Name and CGPA of any student 
   // For simplicity here I havent added it. 
      ResultSet rs = null; 
      rs = ResultSet after database query 
   while(rs.next()) 
   {  
    // DataDTO provides StudentName, Student Registration Number 
    // and student CGPA. You can add additional member variable 
    // or method for more details*/ 
    DataDTO dto = new DataDTO();  
    dto.setName(rs.getString("name")); 
    dto.setCGPA(rs.getFloat("cgpa")); 
    regMap.put(dto, new Long(rs.getLong("registration")));  
   } 
     
  } 
  public synchronized DataDTO getResult(long registrationNumber)  { 
    checkForReload(); 
    return (DataDTO)this.regMap.get(new Long(registrationNumber)); 
  } 
  private void checkForReload()  { 
    long now = System.currentTimeMillis(); 
    if (now - lastRelodingTime > REFRESH_INTERVAL) { 
      lastRelodingTime = now; 
      reload(); 
   } 
  } 
  public synchronized void forceReload()  { 
    lastRelodingTime = System.currentTimeMillis(); 
    reload(); 
  } 
}/*********************** End of DataRepository.java************************/ 

Look at the implementation, you can’t directly create object of the DataRepository Class. The
DataRepository class is an implementation of a singleton. So, there will be only one instance of the
DataRepository Class.
You should get the instance of the Class this way:
DataRepository instance = DataRepository.getInstance();

The logic here is, you create a single instance of the class. Load the data from database to Java data
structure inside the reload() method. The data loaded from the database is refreshed when a new
request is made and the refresh time interval expires. Now the object of the DataRepository Class is
loaded into the memory along with the data loaded from Database.
Suppose, a student with registration number = 101 is looking for his result. You can provide the
result without searching it again.
DataDTO studentInfo ;
long regNumber = 101;
studentInfo=(DataDTO) DataRepository.getInstance().getResult(regNumber);
String studentName = studentInfo.getName();
float studentCGPA = studentInfo.getCGPA();

If you are using STRUTS framework you can have Form Class that extends ActionForm. Say, you Form
class name is DataForm.
DataForm form = new DataForm();
form.setName(studentName)
form.setCGPA(studentCGPA)
Finally: Forward this DataForm to your Action class.
You can use this architecture in any desktop, web or other server type application based on your
requirements.

 
Joomla services and commercial support

Joomla Services and Commercial support

 
Email as Image in PHP

This is a class which is different than every other class you can find regarding coverting an email address to image.

This is because it uses the encryption of the email addresswhich is being passed to the script which renders the image. The renderer decrypts this parameter produces an image output.

 

 

 
Custom JSF component - Birthday

One of the powerful feature of JSF is to extend its tag library and create custom tags. Developers can use this feature and enhance the tags that are provided by JSF implementations (e.g. sun, myfaces, etc). Or they can straight away start writing the tags of their own. Today we’ll see how easy it is to create a custom tag in JSF. Let’s try out with an example, to create a tag, which will display today’s date and a list of people who has birthday today.

 
JSF, Icefaces and custom components experiences

I got the task to evaluate the new web-frameworks in the company I work for.  There were many candicates that might enhance the web user interface and move away from the old struts framework. If you want to know some of my experiences, just read on..

 
Icefaces custom tag with facelets

I've been struggling with creating my own icefaces tag that I could use everywhere it's needed. There are many tutorials on the internet, BUT.. I couldn't get it work anyway.

When I looked at the sourcecode on the webpage, the tag     <ticker:ticker />  was there directly in the HTML sourcecode. This is wrong, because I expected the rendered ouput there.

One whole week I tried to solve this problem trying almost everything. But then, finally, I found it.

So, what was the problem? When you are using Facelets with your JSF/Icefaces, the TLD (tag library descriptor) files are for nothing. Even if I tried to place them everywhere. You have to create the equivalent of the TLD file for the Facelets - the XML file describing the tag structure. In this case it's ticker.taglib.xml

 

ticker.taglib.xml
The tag descriptor for the facelets

 

 There you specify the component's class - Ticker, and it's renderer - TickerRenderer. Now, you don't need the TickerTag as suggested when using JSP in many tutorials around the internet.


Also don't forget to tell the JSF to recognize your taglib and place this XML snippet into web.xml (just the first reference to xml, the second is when you want to use also another taglib - eg. the tomahawk components)
web.xml facelets libraries
Put the reference to your tag descriptor into web.xml

  

    <context-param>
        <param-name>facelets.LIBRARIES</param-name>
        <param-value>
            /WEB-INF/ticker.taglib.xml;/WEB-INF/tomahawk.taglib.xml
        </param-value>
    </context-param>

 

  JSF source
JSF source with a custom tag



rendered output
Rendered output

 

I wonder why this 'trick' hasn't been described yet in some tutorial. So, I hope you will find this remark useful and it will help you when creating your own JSF components.

 

 

 
Firefox extensions - useful XUL resources

 

I've been reading something about firefox extensions programming. There are many tutorials on the web showing just the basics - how to create the .xpi file, and describe contents of this archive. None of these tutorials showed something more about the XUL programming and theory behind it.

Check out these cool XUL presentations I found: 

http://www.xmlaustin.org/wk/385/4/Eitan_Suez_XUL.pdf

 

http://media.wiley.com/product_data/excerpt/04/04714158/0471415804.pdf

 
Practical usage of AJAX on this website
ajax

 

I found a great CSS dropdown menu on a website http://www.cssplay.co.uk/menus/drop_variation.html

It allows you to include the dropdown menu as one you can see on the top of this website. One great advantage is that it's in a plain HTML with the usage of CSS styling and therefore no javascript coding is required.

Ok, so I made a module that generates the set of HTML links from the Joomla CMS which are then transformed into this nice menu.
Every page of my website usually contains less than 100 links (internal+external) because I want the pages to be the search engine friendly.  But using this feature the number of links on every webpage increased to 200 or so.

 
Google web toolkit (GWT) useful links

Currently I am evaluating the Google Web Toolkit technology (GWT) for our project and I'm trying to compare it to other approaches like the ICEfaces technology from the Icesoft company.

If you are about to start with the google web toolkit (gwt), I can recommend you the following presentation from Intellij:

http://www.jetbrains.com/idea/training/demos/GWT.html

It features the Intellij IDEA's support for GWT. I have to say here that working with GWT with IDEA is very easy and intuitive. IDEA's got lots of helpers, code generators, and error reporting. I was nicely surprised that IDEA hilighted the non-existing CSS style used with the GWT ! Creating the remote servlets is also a piece of cake! It registers your servlet automatically in web.xml and does other neat stuff.

UPDATE: Great presentation from the Prodyna GmbH:
http://jax.prodyna.de/jaxdocs/jaxgwt.ppt

UPDATE: GWT presentation video from Bruce Johnson:
http://www.infoq.com/presentations/gwt

To learn some theory - have a look here:
http://www.maximilien.org/presentations/2006/AJAX_and_GWT_Public_07052006.pdf

Read the whitepaper form the IBM:
ftp://ftp.software.ibm.com/software/dw/wes/hipods/Advanced_AJAX_with_GWT_wp16Feb.pdf

And a great presentation from javapassion.com:
http://www.javapassion.com/ajax/GWT.pdf

and it's version with the speaker noted there.
http://www.javapassion.com/ajax/GWT_speakernoted.pdf

I found the development with GWT quite easy, it's quite similar to the swing development with it's actionlisteners etc.. My task now is to create the form which would have it's fields expanded regarding to the role of the user that logged in. With icefaces it was the matter of an hour, GWT learning curve seems to be quite longer, but maybe it's because I knew JSF before. Anyway.. it's worth to have a look at these technologies, because they allow you to combine the AJAX and Java approach, without any painful javascript coding. If you'd have some experiences with the GWT, or other web technologies, feel free to comment ! Thank you

 
Amazing Flex 3d demo

Check out this amazing 3D Flex demo:

3D Flex gallery

 
ICEfaces JSF components presentation
Here is a flash presentation of the components bundled with the ICEfaces framework from the icesoft.com. It features functionality like text autocompletion, calendars, menus, forms partial submit, trees, drag&drop and many various effects.
Click the image to see the icefaces components flash presentation
 
 
Swing text antialiasing
Want to antialias all the text on your Swing application without touching your code? No problem, just add the following definition to the command line when you invoke your application: java -Dswing.aatext=true MyStartClass
 
Java Tips
Here are some of my tips and notes, that could be useful for you
 
Programming in J2EE
I'm focusing on Java2 Enterprise Edition (J2EE), and have the following experiences
 
JavaServer Faces notes
Here are some of the notes from the JSF training. You can see here some tricks and important remarks.
 
Cannot find FacesContext

While developing JSF pages, I got following error: "javax.servlet.
ServletException: Cannot find FacesContext". The solution is: You cannot access the .jsp page directly, always you have to access .jsf or .faces instead. For example, if you have index.jsp with a view, you should access it via index.jsf or index.faces.
 
Hibernate
Notes from the Hibernate training. Basic information about hibernate configuration, mapping and queries
 
Microsoft SQL server course overview
 
JSP and Servlet Tips
 
Links to Free Programming Manuals
This is good resource of links for beginners or also advanced programmers. Enjoy!
 
Programming in Java
My practical skills in Java Programming
 
PHP and MySQL hosting
Most website programming beginners are asking where they can try their PHP scripts for free. Here are some of free web hosting services
 
Idea shortcuts
Here are some useful shortcuts of IntelliJ IDEA that I have found. These shortcuts are useful when you have a large project and want to browse it's methods.
  • Ctrl+Q - quick lookup in the Javadoc documenation. It shows up a popup box with the javadoc comment
  • Ctrl+P - shows the parameters of the method. This is useful when you are not sure about parameters of the constructor or some method. It gives you the list of the all available parameters.
  • Ctrl+B - go to declaration. If you are not sure where the variable is defined, this shortcut jumps to that place.
  • Shift+F1 - View External Javadoc - opens a browser with the method in the javadoc
 
Java certification - fundamentals
Keywords are special reserved words in Java that you cannot use as identifiers (names) for classes, methods, or variables. Access Modifiers
  • private - accessible only from within it's own class
  • protected - only to classes in the same package or subclasses of the class.
  • public - from any other class
Class, methods, and variable modifiers
  • abstract - cannot be instantiated, must be implemented by a nonabstract subclass.
  • class - keyword that specifies a class
  • extends - indicates the superclass that a suclass is extending
  • final - impossible to extend a class, override a method, or reinitialize a variable
  • implements - indicates the interfaces that a class implements
  • interface - specifies the interface
  • native - a method is written in a platform-dependent language
  • new - instantiating, invoking the constructor
  • static - variable belong to a class as opposed to an instance
  • strictfp - will follow FP-strict rules in all expressions
  • synchronized - method can be accessed only by one thread
  • transient - prevents fields from ever being serialized
  • volatile - may change out of sync
Flow Control
  • break - exits from the block of code in which it is
  • case - executes a block of code, dependent on the switch
  • continue - begins the next iteration of the loop
  • default - executes if none of the switch-case statements match
  • do - conjuction with the while statement
  • else - if an if test is false
  • for - conditional loop for a block of code
  • if - logical test for true or false
  • instanceof - whether an object is an instance of a class, superclass, or interface
  • return - returns from method
  • switch - variable to be compared with the case statements
  • while - repeats while a certain condition is true
Error Handling
  • catch - declares the block to handle an exception
  • finally - is executed no matter what program flow occurs
  • throw - used to pass an exception
  • throws - indicates the method will pass an exception
  • try - block that will be tried, and which may cause an exception
  • assert - evaluates an expression to verify the assumption of the programmer
Package control
  • import - statement that says which packages or classes to import
  • package - specifies the package to which the sourcecode belongs
Primitives
  • boolean - a value true or false
  • byte - 8-bit signed integer
  • char - unicode character (16-bit)
  • short - 16-bit integer which is signed
  • double - 64-bit floating-point number which is signed
  • float - 32-bit floating-point number which is signed
  • int - 32-bit integer number which is signed
  • long - 64-bit integer which is signed
Variable keywords
  • super - refers to the superclass
  • this - refers to the current object
Void return type
  • void - indicates no return type
Unused reserved words
  • const - use public static final instead
  • goto - not implemented !
null, true and false are technically not keywords, but literal values ! Range of the primitives Six number types in Java are signed. The positive range is one less than the negative range. Zero is stored as a positive binary number. Boolean can be only true or false. Most of the ranges are virtual-machine depentent. The char type is a single unsigned 16-bit Unicode character. A primitive literal - is a source code representation of the primitive data types. Integer literals There are three ways how to write an integer primitive: as a
  • decimal
  • octal - by placing the zero in front of the number (up to 21 digits)
  • hexadecimal - by the prefix 0x or the optional suffix extension L (up to 16 digits)
Floating point defined as double (64 bits) by default. If you want to use the float, you must attach the suffix F or f to the number. You may also also attach a D or d to touble literals, but it's not necessary. Boolean literals can only be defined as true or false. Character literals char literals are represented by a single character in single quotes. You can use the escape code like \n for a new line. Literal values for Strings strings are not primitives, they can be represented as literals (typed directly into the code) Arrays are objects that store multiple variables of the same type. There are three important steps:
  • make an array reference (declaration) eg. int test[]; It is recommended to put the brackets after the type.
  • construct the array object eg.
  • initialize the array
 
JSF and GET parameters
I was curious how could JSF be imporved to use GET, instead of using POST and saving it's state into URL parameters. GET is important also for the search-engine optimization when you combine it with the url rewriting. Great discussion is on the TheServerSide.com:http://theserverside.com/
news/thread.tss?thread_id=38601
Eg. You can then get the paramater value injected to your backing bean using: orderId #{param[orderId]} From my point of view, this is Just Perfect. How could anything be easier? http://wiki.apache.org/myfaces/InvokingJsfPagesWithStandardUrls JSF rules, and I think it should be more and more the basic web user-interface framework.
 
No Tweets

Add URL of a programming website
register as a freelancer
submit your project
open freelance projects you can work on
webmaster resources
write paid blog posts about programming - tips and articles
bugs and features

Recommended: (advertise)
Download Joomlawatch 1.2.12


Green Geeks Hosting -
World's best selling green web hosting


Outsource your project
-
Submit your project description with all the requirements to more than 600 freelancers from around the world for FREE.

Register as a Freelancer -
Submit your project experiences, programming languages and your other skills


Freelancers, create paid articles
-
Looking for freelancers with experiences in Java to write paid articles on their experiences

FastDomain.com -
Fast Domain hosting. Hostmonster alternative. Also for $6.95/month.

HostMonster.com -
best cheap Joomla Web hosting. Website joomlawatchdemo.com is hosted by them with domain for $6,95/mo.


Advertise Here
-
Promote your services and get the new customers from the community of webmasters / programmers visiting CodeGravity.com



News from Twitter:
No Tweets
RSS Feeds:new

rss Freelance
rss Projects
rss Forum
rss Resources

Popular:
MathGuard
download mathguard
Random screenshot:

linoopz15.jpg


Poll

At what price would you purchase JoomlaWatch ad-free license?
 
Privacy policy | Advertise | Donate | Doucovanie Nemcina
Joomla Visitors Google Map
Loading map...
Joomla Visitors Google Map
Visitors Google Map Agent

Locations of visitors to this page


©2003-2010 Codegravity.com