You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by Stephan Hesmer <sh...@apache.org> on 2004/03/02 21:26:35 UTC

Re: JavaScript not working correctly when both portlets are in vi ewmode...

This is not yet possible. maybe we see something like that in one of the 
next versions of the portlet spec. but that will take some time.

Stephan

Jacek Palka wrote:
> Hi,
> 
> I have a similar problem. I have JavaScript functions that are common to the
> entire application, consequently to all my portlets on the same portal page.
> So generation of the functions for each of my portlets prefixed by the
> namespace ID is not any good option. How can I generate script once per
> portal page?
> 
> Then I'd also like to make some action from the onLoad trigger. Is it
> possible?
> 
> Best Regards
> 
> Jacek
> 
>  -----Original Message-----
> From: 	Stephan Huber [mailto:shuber@ti.com] 
> Sent:	1 March 2004 09:41
> To:	pluto-user@jakarta.apache.org
> Subject:	Re: JavaScript not working correctly when both portlets are
> in vi ewmode...
> 
> Thank you Nick. But I can't find the method you mention in JSR 168 Spec 1.0.
> 
> - Stephan
> 
> Nick Lothian wrote:
> 
>>Or else you could do as suggested by the JSR168 specification and use the
>>RenderResponse.encodeNamespace(String) method to generate unique (to the
>>page) function names for each of the Javascript functions called by each
>>portlet.
>>
>>
>>>>>From the Javadoc:
>>
>>"Maps the given string value into this portlet namespace and therefore
>>ensures the uniqueness of the string value in the whole portal page. This
>>method should be applied to every variable or name used in the output
>>stream. For example a function name in javascript. "
>>
>>Nick
>>
>>
>>
>>>-----Original Message-----
>>>From: Stephan Huber [mailto:shuber@ti.com]
>>>Sent: Friday, 27 February 2004 3:10 AM
>>>To: pluto-user@jakarta.apache.org
>>>Subject: Re: JavaScript not working correctly when both 
>>>portlets are in
>>>viewmode...
>>>
>>>
>>>I realized the "auto-start" like this:
>>>
>>><body onLoad="dashBoardStart()">
>>>
>>>dashBoardStart() is my JavaScript method to display my slide show 
>>>sequence...
>>>
>>>I will try your suggestion using a plain old HTML page and 
>>>will tell you 
>>>if the problem persists...
>>>
>>>Thanks
>>>
>>>- Stephan
>>>
>>>Mike Burati wrote:
>>>
>>>
>>>>Sounds like the Javascript itself doesn't like having two 
>>>
>>>copies of itself
>>>
>>>
>>>>on the same overall page...
>>>>
>>>>You could try putting duplicate copies of it in two 
>>>
>>>portions of a plain old
>>>
>>>
>>>>non-portal HTML page, to rule out anything to do with 
>>>
>>>Pluto/portlets.
>>>
>>>
>>>>Can you send us the javascript or at least a fragment of 
>>>
>>>the piece(s) that
>>>
>>>
>>>>you're expecting to do the auto-start of the slide show?
>>>>
>>>>-----Original Message-----
>>>>From: Stephan Huber [mailto:shuber@ti.com]
>>>>Sent: Friday, February 27, 2004 11:31 AM
>>>>To: Pluto-user
>>>>Subject: JavaScript not working correctly when both 
>>>
>>>portlets are in view
>>>
>>>
>>>>mode...
>>>>
>>>>
>>>>Hi,
>>>>
>>>>I've written a SlideShow portlet which uses some JavaScript 
>>>
>>>in one of 
>>>
>>>
>>>>the JSPs to display a sequence of pictures in view mode.
>>>>
>>>>That works very well...
>>>>
>>>>When adding a second instance of the portlet (see below) 
>>>
>>>both portlets 
>>>
>>>
>>>>are displayed correctly in view mode - but in this case the 
>>>
>>>sequence of 
>>>
>>>
>>>>pictures isn't starting (you can only see the first picture 
>>>
>>>of the slide 
>>>
>>>
>>>>show in both portlets but not the other pictures).
>>>>
>>>><application id="7">
>>>>  <definition-id>Slide</definition-id>
>>>>  <portlet id="1">
>>>>    <definition-id>Slide.SlideShow_1</definition-id>
>>>>  </portlet>
>>>>  <portlet id="2">
>>>>    <definition-id>Slide.SlideShow_2</definition-id>
>>>>  </portlet>
>>>></application>
>>>>
>>>>It seems that JavaScript isn't starting correctly when both 
>>>
>>>portlets are 
>>>
>>>
>>>>displayed.
>>>>The other point is that when switching to edit mode in one 
>>>
>>>of the two 
>>>
>>>
>>>>portlets, the edit mode is displayed while the other 
>>>
>>>portlet is still in 
>>>
>>>
>>>>view mode. In this case the portlet which is now in view 
>>>
>>>mode displays 
>>>
>>>
>>>>the slide show correctly...
>>>>
>>>>Only when both portlets are in view mode nothing happens.
>>>>
>>>>Any ideas?
>>>>
>>>>Best Regards
>>>>
>>>>- Stephan
>>>
> 
> 


wishlist / javascript support

Posted by Jason Novotny <no...@aei.mpg.de>.
    Echoing a request earlier that Stephan Hesmer approved, I too would 
like to see better support for integrating JavaScript in with portlets-- 
it looks like it would require buffering though which is fine I think. 
The current approach of duplicating JS in each portlet is not very good.

    Jason

Stephan Hesmer wrote:

> This is not yet possible. maybe we see something like that in one of 
> the next versions of the portlet spec. but that will take some time.
>
> Stephan
>
> Jacek Palka wrote:
>
>> Hi,
>>
>> I have a similar problem. I have JavaScript functions that are common 
>> to the
>> entire application, consequently to all my portlets on the same 
>> portal page.
>> So generation of the functions for each of my portlets prefixed by the
>> namespace ID is not any good option. How can I generate script once per
>> portal page?
>>
>> Then I'd also like to make some action from the onLoad trigger. Is it
>> possible?
>>
>> Best Regards
>>
>> Jacek
>>
>>  -----Original Message-----
>> From:     Stephan Huber [mailto:shuber@ti.com] Sent:    1 March 2004 
>> 09:41
>> To:    pluto-user@jakarta.apache.org
>> Subject:    Re: JavaScript not working correctly when both portlets are
>> in vi ewmode...
>>
>> Thank you Nick. But I can't find the method you mention in JSR 168 
>> Spec 1.0.
>>
>> - Stephan
>>
>> Nick Lothian wrote:
>>
>>> Or else you could do as suggested by the JSR168 specification and 
>>> use the
>>> RenderResponse.encodeNamespace(String) method to generate unique (to 
>>> the
>>> page) function names for each of the Javascript functions called by 
>>> each
>>> portlet.
>>>
>>>
>>>>> From the Javadoc:
>>>>
>>>
>>> "Maps the given string value into this portlet namespace and therefore
>>> ensures the uniqueness of the string value in the whole portal page. 
>>> This
>>> method should be applied to every variable or name used in the output
>>> stream. For example a function name in javascript. "
>>>
>>> Nick
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: Stephan Huber [mailto:shuber@ti.com]
>>>> Sent: Friday, 27 February 2004 3:10 AM
>>>> To: pluto-user@jakarta.apache.org
>>>> Subject: Re: JavaScript not working correctly when both portlets 
>>>> are in
>>>> viewmode...
>>>>
>>>>
>>>> I realized the "auto-start" like this:
>>>>
>>>> <body onLoad="dashBoardStart()">
>>>>
>>>> dashBoardStart() is my JavaScript method to display my slide show 
>>>> sequence...
>>>>
>>>> I will try your suggestion using a plain old HTML page and will 
>>>> tell you if the problem persists...
>>>>
>>>> Thanks
>>>>
>>>> - Stephan
>>>>
>>>> Mike Burati wrote:
>>>>
>>>>
>>>>> Sounds like the Javascript itself doesn't like having two 
>>>>
>>>>
>>>> copies of itself
>>>>
>>>>
>>>>> on the same overall page...
>>>>>
>>>>> You could try putting duplicate copies of it in two 
>>>>
>>>>
>>>> portions of a plain old
>>>>
>>>>
>>>>> non-portal HTML page, to rule out anything to do with 
>>>>
>>>>
>>>> Pluto/portlets.
>>>>
>>>>
>>>>> Can you send us the javascript or at least a fragment of 
>>>>
>>>>
>>>> the piece(s) that
>>>>
>>>>
>>>>> you're expecting to do the auto-start of the slide show?
>>>>>
>>>>> -----Original Message-----
>>>>> From: Stephan Huber [mailto:shuber@ti.com]
>>>>> Sent: Friday, February 27, 2004 11:31 AM
>>>>> To: Pluto-user
>>>>> Subject: JavaScript not working correctly when both 
>>>>
>>>>
>>>> portlets are in view
>>>>
>>>>
>>>>> mode...
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I've written a SlideShow portlet which uses some JavaScript 
>>>>
>>>>
>>>> in one of
>>>>
>>>>> the JSPs to display a sequence of pictures in view mode.
>>>>>
>>>>> That works very well...
>>>>>
>>>>> When adding a second instance of the portlet (see below) 
>>>>
>>>>
>>>> both portlets
>>>>
>>>>> are displayed correctly in view mode - but in this case the 
>>>>
>>>>
>>>> sequence of
>>>>
>>>>> pictures isn't starting (you can only see the first picture 
>>>>
>>>>
>>>> of the slide
>>>>
>>>>> show in both portlets but not the other pictures).
>>>>>
>>>>> <application id="7">
>>>>>  <definition-id>Slide</definition-id>
>>>>>  <portlet id="1">
>>>>>    <definition-id>Slide.SlideShow_1</definition-id>
>>>>>  </portlet>
>>>>>  <portlet id="2">
>>>>>    <definition-id>Slide.SlideShow_2</definition-id>
>>>>>  </portlet>
>>>>> </application>
>>>>>
>>>>> It seems that JavaScript isn't starting correctly when both 
>>>>
>>>>
>>>> portlets are
>>>>
>>>>> displayed.
>>>>> The other point is that when switching to edit mode in one 
>>>>
>>>>
>>>> of the two
>>>>
>>>>> portlets, the edit mode is displayed while the other 
>>>>
>>>>
>>>> portlet is still in
>>>>
>>>>> view mode. In this case the portlet which is now in view 
>>>>
>>>>
>>>> mode displays
>>>>
>>>>> the slide show correctly...
>>>>>
>>>>> Only when both portlets are in view mode nothing happens.
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> Best Regards
>>>>>
>>>>> - Stephan
>>>>
>>>>
>>
>>
>
>
>