Strange behaviour in menu item

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange behaviour in menu item

Pierre Smits
Hi all,

In a menuappbar file I have following menu item:

        <menu-item name="GenerateShortProfile"
title="${uiLabelMap.GenerateSP}">
            <link
target="javascript:window.open(document.ExperiencesOverview.selectedExperiences.value,
'newwindow');" url-mode="plain"/>
        </menu-item>

When in the browser and I clik on the generated menu a new window is opened
and the expected result is shown (based on the generated url in field
selectedExperiences), but the originating window changes to a blank screen
with only

*[object Window]*

in stead of displaying the original page.

Somewhere I am doing something wrong, but what? And how do I resolve this?

Any pointer would be appreciated.

Regards,

Pierre
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour in menu item

Scott Gray-2
Here you go:
 <menu-item name="GenerateShortProfile" title="${uiLabelMap.GenerateSP}">
    <link target="javascript:return document.ExperiencesOverview.selectedExperiences.value;" target-window="_blank" url-mode="plain"/>
</menu-item>

Disclaimer: I'm just guessing on the javascript in the target attribute.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 19/08/2010, at 11:55 PM, Pierre Smits wrote:

> Hi all,
>
> In a menuappbar file I have following menu item:
>
>        <menu-item name="GenerateShortProfile"
> title="${uiLabelMap.GenerateSP}">
>            <link
> target="javascript:window.open(document.ExperiencesOverview.selectedExperiences.value,
> 'newwindow');" url-mode="plain"/>
>        </menu-item>
>
> When in the browser and I clik on the generated menu a new window is opened
> and the expected result is shown (based on the generated url in field
> selectedExperiences), but the originating window changes to a blank screen
> with only
>
> *[object Window]*
>
> in stead of displaying the original page.
>
> Somewhere I am doing something wrong, but what? And how do I resolve this?
>
> Any pointer would be appreciated.
>
> Regards,
>
> Pierre


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour in menu item

Pierre Smits
Hi Scot,

Thanks for your prompt reply.

I have found out that it is a browser issue, namely:

   - My original code generated the problem as I described in my post.
   - In Chrome it delivers what I want: originating page is kept and a new
   window (tab) is opened and displays the desired new page (a pdf)
   - In IE 7 the originating tab changes to a blank page with only *[object]
   * shown, a new window (tab) is opened and displays the desired new page
   (a pdf)



I have also tried your solution but it also didn't deliver what I needed.
In Firefox : On the originating page it kept displaying the page, but the
page to be shown in the new tab (of Firefox) remained blank.
In Chrome: On the originating page it kept displaying the page, but no new
window (tab) is opened
In IE7: same result as in Firefox

So it is back to the drawing board and rethink it.

But anyway, thanks for your input.

Regards,

Pierre

2010/8/19 Scott Gray <[hidden email]>

> Here you go:
>  <menu-item name="GenerateShortProfile" title="${uiLabelMap.GenerateSP}">
>     <link target="javascript:return
> document.ExperiencesOverview.selectedExperiences.value;"
> target-window="_blank" url-mode="plain"/>
> </menu-item>
>
> Disclaimer: I'm just guessing on the javascript in the target attribute.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 19/08/2010, at 11:55 PM, Pierre Smits wrote:
>
> > Hi all,
> >
> > In a menuappbar file I have following menu item:
> >
> >        <menu-item name="GenerateShortProfile"
> > title="${uiLabelMap.GenerateSP}">
> >            <link
> >
> target="javascript:window.open(document.ExperiencesOverview.selectedExperiences.value,
> > 'newwindow');" url-mode="plain"/>
> >        </menu-item>
> >
> > When in the browser and I clik on the generated menu a new window is
> opened
> > and the expected result is shown (based on the generated url in field
> > selectedExperiences), but the originating window changes to a blank
> screen
> > with only
> >
> > *[object Window]*
> >
> > in stead of displaying the original page.
> >
> > Somewhere I am doing something wrong, but what? And how do I resolve
> this?
> >
> > Any pointer would be appreciated.
> >
> > Regards,
> >
> > Pierre
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour in menu item

Pierre Smits
I have resolved the issue.

Putting the javascript: window.open code in a js function and calling the js
function in the menu item delivered the solution.

Thanks.

2010/8/20 Pierre Smits <[hidden email]>

> Hi Scot,
>
> Thanks for your prompt reply.
>
> I have found out that it is a browser issue, namely:
>
>    - My original code generated the problem as I described in my post.
>    - In Chrome it delivers what I want: originating page is kept and a new
>    window (tab) is opened and displays the desired new page (a pdf)
>    - In IE 7 the originating tab changes to a blank page with only *
>    [object]* shown, a new window (tab) is opened and displays the desired
>    new page (a pdf)
>
>
>
> I have also tried your solution but it also didn't deliver what I needed.
> In Firefox : On the originating page it kept displaying the page, but the
> page to be shown in the new tab (of Firefox) remained blank.
> In Chrome: On the originating page it kept displaying the page, but no new
> window (tab) is opened
> In IE7: same result as in Firefox
>
> So it is back to the drawing board and rethink it.
>
> But anyway, thanks for your input.
>
> Regards,
>
> Pierre
>
> 2010/8/19 Scott Gray <[hidden email]>
>
> Here you go:
>>  <menu-item name="GenerateShortProfile" title="${uiLabelMap.GenerateSP}">
>>     <link target="javascript:return
>> document.ExperiencesOverview.selectedExperiences.value;"
>> target-window="_blank" url-mode="plain"/>
>> </menu-item>
>>
>> Disclaimer: I'm just guessing on the javascript in the target attribute.
>>
>> Regards
>> Scott
>>
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>> On 19/08/2010, at 11:55 PM, Pierre Smits wrote:
>>
>> > Hi all,
>> >
>> > In a menuappbar file I have following menu item:
>> >
>> >        <menu-item name="GenerateShortProfile"
>> > title="${uiLabelMap.GenerateSP}">
>> >            <link
>> >
>> target="javascript:window.open(document.ExperiencesOverview.selectedExperiences.value,
>> > 'newwindow');" url-mode="plain"/>
>> >        </menu-item>
>> >
>> > When in the browser and I clik on the generated menu a new window is
>> opened
>> > and the expected result is shown (based on the generated url in field
>> > selectedExperiences), but the originating window changes to a blank
>> screen
>> > with only
>> >
>> > *[object Window]*
>> >
>> > in stead of displaying the original page.
>> >
>> > Somewhere I am doing something wrong, but what? And how do I resolve
>> this?
>> >
>> > Any pointer would be appreciated.
>> >
>> > Regards,
>> >
>> > Pierre
>>
>>
>