Hi,
I have added a keypress event as

[CODE] jQuery('#body').keypress(function(){currentTime= new Date().getTime(); });[/CODE]

but when I open a pop up window which have a iframe contains a rich text area not capturing this event.

Any ways to handle parent event in child element?

Any suggestion?

hey you can use like this..

[CODE]
Properties props=new Properties();
FileInputStream fis = new FileInputStream (application.getRealPath("/WEB-INF/classes/filename.properties"));
props.load(fis);

String componentList = props.getProperty("somekey");
FileOutputStream fos = new FileOutputStream (application.getRealPath("/WEB-INF/classes/filename.properties"));

props.setProperty(componentList,"somevalue");
props.store(fos,null);
fis.close();
fos.close();
[/CODE]

might be useful to u....

Hi,
Is your application uses only JSP?
Otherwise u can use Ajax for this issue.

You can pass value to ajax request to populate another select box.

call a function on onchange event of first select box in that u can get
[CODE]var selectedvalue=document.getElementByName("evnt_cat").options[document.getElementByName("evnt_cat").options.selectedIndex].value;[/CODE]

then pass it to AJAX request.

You can declare id variable as global in init() method as call it onload of body tag
[CODE]function init()
{
id =0;
}[/CODE]

then append id to text box id property which u dynamically created.

Declare a combo Box of name fileNames. as
[CODE]
<html:select property="fileNames" multiple="true">
<html:option value="">-Select-</html>
</html:select>
[/CODE]

when You submit form you can use

[CODE]function submit(form)
{
var newElem="";
for(int j=0;j<id;j++)
{
newElement =document.createElement("<OPTION>");
var textBox1=document.getElementById("alertFieldName"+id);
newElement.text=textBox1.value;
newElement.value=textBox1.value;
form.fileNames.options.add(newElement);
}

for(var i=0;i< form.fileNames.options.length;i++)
{
form.fileNames.options.selected=true;
}
}[/CODE]

[QUOTE=amarjeetsingh;877260]Create the variable in the javaScript
and store the value in it
then use it

[code]function changeQuantity(form,productCode,index)
{
var z=productCode;
var y=index;
lengthOfItems=form.productCombo.options.length;
lengthOfProducts=form.productCombo2.options.length;
alert("index"+index);
changeItemValueNew(form,z,y);
}[/code][/QUOTE]

thanks.. Its working perfectly

[QUOTE=javaAddict;877479]What do you mean the list is nested?[/QUOTE]

list which i want to set to comboBox is in another arrayList
(arrayList within arrayList)

[QUOTE=adatapost;878069]You are adding reference of an object of a class which is not Serializable. Tomcat is trying to serialize the session, which
fails as soon as any non-serializable attribute is found.[/QUOTE]

What I do now?? Any change in web.xml? or server.xml?
I used pop3store class for attachment.

SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.sun.mail.pop3.POP3Message

I am not getting why this exception has occurred.It throws the exception when i starts tomcat server.
I have used recieve() method in LoginAction which is used to recieved mails using POP3 protocol.
I am using JAVAMAIL 1.4

[QUOTE]I am posting here my code which display pdf.
I m using struts 1.2 this method generate pdf.
I have used iText jar[/QUOTE]
[ICODE]
public ActionForward print(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {

 try{

/* set content type as PDF /

     response.setContentType("application/pdf");

/* create Object Of document /

     Document document = new Document(PageSize.FLSE);
     /** set margin of page */
    document.setMargins(1.25F,0.75F, 5F,0.75F);

ByteArrayOutputStream baos = new ByteArrayOutputStream();

     PdfWriter pdfWriter=PdfWriter.getInstance(document, baos);

document.open();

/* Table For header address /

     PdfPTable headerTable =new PdfPTable(3);
     headerTable.setWidthPercentage(91);

     /** Add company Address*/ 

     /** First Cell  For address*/

     PdfPCell headerCell=new PdfPCell();
     headerCell.addElement(new Paragraph("My comapany"));

     /** add cell to headerTable*/

     headerTable.addCell(headerCell);

     /** Second cell For CompanyLogo */

     headerCell=new PdfPCell();
     /** get context object */

     ServletContext context=request.getSession().getServletContext();
     /** get Real  Path of image */ 

     String path=context.getRealPath(login.getPath());
     /** set image to cell*/

     Image img= Image.getInstance(path);
     headerCell.setImage(img);

     /** add cell to headerTable*/

     headerTable.addCell(headerCell);

     /** Third cell for lable of document **/

     headerCell=new PdfPCell();
    String allLedger="ALL LEDGER";
    headerCell.addElement(new Paragraph(allLedger+"\n"
         +"From Date:"+session.getAttribute("firstDate")+"\nTo Date:"+session.getAttribute("lastDate")
         ,new Font(Font.TIMES_ROMAN, 10f, Font.BOLD, Color.black )));

     /** add cell to headerTable*/

    headerTable.addCell(headerCell);

/* add table to document /

 document.add(headerTable);

document.close();
/* Don't know why??/
response.setContentLength(baos.size());
/* comment it if u don't want to download pdf/
//response.addHeader("Content-Disposition", "attachment; filename=\"ledgers.pdf\"");

 /** get out put Stream*/
 out = response.getOutputStream();
 /** write to--- Don't know*/
 baos.writeTo(out);
/** Clear OutputStream*/
 out.flush();
 out.close();

 }catch (Exception e) {
    System.err.println("exception in print=="+e.getMessage());
}

          return mapping.findForward("printJsp55");
    }

[/ICODE]

It generate pdf whic u can use to print.
you can add your data to PdfPTable.
This ...

i got solution.I moved my java scrpit code to first Jsp (which i used to create tabs).

Hello'
I m using struts 2.0 .
I want a comboBox(<s:select>) on Jsp.
bean i want to populate in combobox is nested.
I only know list property of <s:select>
but my list is nested.
How can i populate combobox with nested
arraylist.

we cant convert jsp in to pdf .
you have to render the ur output in pdf format using iText.jar
search pdf using itext u will get ur solution

[QUOTE=adatapost;877203]Will you post javascript code?[/QUOTE]
I m giving just an alert("Hi" ) for checking prupose

[CODE]
function select(form)
{
alert("Hi") ;
}
[/CODE]

[QUOTE=sanjayrawat177;872616]HEy Peter can you pls provide me the CODE ,i tried through itext but didnt get along..
so pls help buddy ...provide me the code to trnsfer JSP output in PDF[/QUOTE]

You can use PDFPtable for table formatting

[QUOTE=adatapost;877049]Post your code fragement in BB code. Check whether a select function is defined or not and if it there then post it so I can help you on that issue.[/QUOTE]

I have written that function on my tabbed jsp

[QUOTE=javaAddict;877050]What do you mean giving an alert. Post the code that works[/QUOTE]

This is my input text field

[code=JSP]<input type="text" id="productQuantity" size="5" onchange="changeQuantity(this.form,'<bean:write property="productCode" name="product"/>','<%=z %>');"/>[/code]

And this is my javaScript function is..

[code=JavaScript]function changeQuantity(form,productCode,index)
{
//alert("z==="+productCode);
lengthOfItems=form.productCombo.options.length;
lengthOfProducts=form.productCombo2.options.length;
alert("index"+index);
changeItemValueNew(form,productCode,index);
}[/code]

after giving that alert messsage it works otherwise not.

}

r u using struts 1.2???
In struts 1.2 it will like this

[code]<logic:iterate name="arrayListName" id="someId">
<logic:iterate name="arrayListName" property="nestedArrayListNme" id="someId">
<bean:write name="someId" property="name">
</logic:iterate>
</logic:iterate> [/code]

here name might be your javabean property

hi..
I am using struts 2..
I want tabs on my jsp
and my code is..
On first Jsp i used to create tabs which works fine for me.

[code=JSP]<s:tabbedPanel id="test" labelposition="middle" >
<s:iterator value="teamlist">
<s:url id="resultsUrl" action="navigateChangeTeamAction.action" >
<s:param name="teamCode" value="teamCode" />
<s:param name="teamName" value="teamName"></s:param>
</s:url>
<s:div label="Team2" theme="ajax" labelposition="center" href="%{resultsUrl}">
</s:div>
</s:iterator>
</s:tabbedPanel>[/code]

after executing navigateChangeTeamAction.action
now on my tabbed jsp code is as...

[code=JSP] <s:select name="teamEmpNameCombo"
id="teamEmpNameCombo"
list="teamEmployeelist"
listValue="employeeName" headerKey="1" headerValue="Select" multiple="true"
cssStyle="width:130;font-size:15;"
onchange="select(this.form);" theme="simple" >
</s:select>[/code]

but onchage javascript function select() not called. not giving any error.
if i put alert("Hi"); instead of select() it gives me alert message.

Please help me?? I don't know why my javascript function is not getting call??

[QUOTE=javaAddict;876440]Try this:
changeValue('<%=i%>')[/QUOTE]

Thanks for reply....
It's not working..
when i first time load my project it gives me error like i is undefined
But after giving an alert it works fine...

hii..
I want to use a scriplet variable in javascript.
i used
<%! int i;>
<% i=0; %>
<input type="text" id="itemValue" onchange=changeValue('<%i%>')>

it works fine if i give alert(i) in
changeValue function.
Otherwise it gives error i is undefined.
Plz help me. I don't want to bother user by increasing one user click.
Plz help what is the reason ????

i m using struts 1.2

:confused: