Tuesday, June 29, 2010

JSF page script code using RAD quick edit feature

First you need to open the JSP page in design view and single click on ‘SAVE’ button. Thereafter, you need to select ‘Quick Edit’ tab (Lower middle portion of RAD) and then select required function which will execute when you click on SAVE button. Suppose you want to implement onclick function once you click on SAVE button so you need to select onclick once and then click on right portion where you can add the required code for onclick java script function.
















You can see the added code in JSP file

<script type="text/javascript">
function func_1(thisObj, thisEvent) {
//use 'thisObj' to refer directly to this component instead of keyword 'this'
//use 'thisEvent' to refer to the event generated instead of keyword 'event'
alert("hello");
}</script>

<hx:commandExButton id="button1" styleClass="commandExButton" type="submit" value="SAVE" action="#{pc_UserInformationView.doButton1Action}" onclick="return #{facesContext.externalContext.response.namespace}func_1(this, event);">
</hx:commandExButton>

No comments: