Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

calling a javascript function in Scriptlet

843840Nov 28 2008 — edited Nov 28 2008
Hello,

I need to call a Javascript function from within my scriptlet.
Now I am pretty aware that I cant do that. Let me tell you what I want to do: To display a message next to the item being displayed(now there is a list of items and their attributes in one page), based on the value of one of the parameters, that belong to that item. The query that fetches the item and its attributes happens in the JSP (thats not my fault, I am just enhancing something already existing)
So what I tried to do was wrote a function (which updates the innerHtml of a DIV tag, which is placed next to the line where the item is displayed)
and did an
<iframe frameborder='0' width="100%" height="700px" onload="javascript:showWarning('<%= myPartHelper.getPartNumber(oPart.getNumber()) %>')"/>  
Now, the warning is displayed somewhere on the top of the page (not where I expect it to be) and the page stops rendering after encountering the <iframe>
however now, when i look at the source code, the rest of the items and attributes are there, but probably hidden behind the iframe. I am not able to resize this iframe either. I used iframe because that is one tag which offered me an onload functionality.

So basically, I am kind of stuck and was wondering if some one could show me a way.

many thanks,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2008
Added on Nov 28 2008
1 comment
1,863 views