Use of JavaScript in a Portlet
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Use of JavaScript in a Portlet




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Use of JavaScript in a Portlet  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-26-05 11:02 PM

I am getting an error on my portlet after following the tutorial in the Rati
onal Application Developer V6 and Portal Tools book.

In my JSP file, as advised, I wrote a function, but appended a tag to refer 
to the name space in the javascript like so:

function "portlet:namespace/"func_1(thisObj, thisEvent) {
document.forms['view"portlet:namespace/":form1'].submit();
return false;
}

This might be difficult to read. I have replaced the tag brackets around por
tlet:namespace with " because this forum strips out tags like that on posts.

I always get a javascript error when trying to display the portlet saying a 
'(' is expected on the line:

function "portlet:namespace/"func_1(thisObj, thisEvent) {

The portlet will never render either on the test environment.  If I cut the 
javascript from my JSP page, it will render with no error. And if I cut the 
"portlet:namespace/", it renders without javascript error.

I have never gotten javascript to run properly. What is the right way to hav
e it run on a portlet page? What is wrong with the code above?

I am using JSR 168.








[ Post a follow-up to this message ]



    Re: Use of JavaScript in a Portlet  
Dennis te Lintelo


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-29-05 11:01 PM

You have to use the right tag...

function <portlet:encodeNamespace value="func_1"/>(thisObj, thisEvent)
 {
..your code...
}

Success!

Dennis te Lintelo
Portico Consultancy B.V.
The Netherlands





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:46 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register