7.  Adding code to the server application 
This chapter describes most of the code that the e FixIT application wizard includes in the server 
application objects it creates. It also presents several useful methods, events and properties. 
7.1  Application events 
You can add application events by selecting 
this
 object (see picture in chapter 6.5), clicking 
Events
 tab in 
the panel right and double clicking on the event. 
7.1.1  Action event 
The server application object has a few events defined that do not appear in Delphi/Web FixIT. The most 
important is 
action
 event, which occurs when 
call(String fileNumber)
 method of the application is 
called from the 
application
 JSP script (see chapter 5). The action event is best used to create logic that 
responds to the end user clicking submit/image buttons on the form. 
For example, when the user clicks 
First
 (<<) button on the HTML form, an key/value pair of 
 action=<< 
 is set (i.e, 
setAction( << )
) is called on the server application. When the call method is 
placed, the server application forwards the operation to corresponding source component, which is 
connected to the FileMan database file described by 
fileNumber
 parameter in the call method header. 
Thus the HTML form reloads to show the first record of the file. 
The call method processing can be influenced by adding an 
action
 event to the server application. For 
example, the intercepting code could look like this: 
  void this_action(ActionEvent e) { 
   if (e.getAction().equals("<<")) { 
    // do some stuff here 
    e.consume(); 
   }  
Now the event code 
consumes
 the event and the source component will not receive the operation. 
The 
action
 event can also be used to add custom events: You can define a submit button such as 
   
and intercept the button in the 
action
 event. 
The e FixIT Application wizard creates a default action event for the server application object. 
24 






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

servlets web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved