Open new Window from PowerWebpart

Sep 2, 2009 at 1:11 PM

Hi Christian,

can you please help me with the following:

I add a new Item in a list through the powerwebpart. After the Item is added, i like ti open the Edit or Dispform.aspx for this item in an new window!

Is there any way to do this from powershell within in the webpart?

I tryed to use $ie = new-object -com "InternetExplorer.Application" but this only works in the powershell console, not in the webpart :(

Do you have any hints for me?

Thanks

Michael

Coordinator
Sep 2, 2009 at 8:55 PM

Hello Michael,

user javascript.

Hint: 

$script="window.open('......');

Register-JavaScriptBlock -name "OpenNewWindow" -script $script 

Not sure if this 1000% correct, but it's a step in the right direction ;-)

Bye,

Christian

Sep 3, 2009 at 8:50 AM

Hi Christian,

thanks for your help!

Should the script execute when i register it via Register-JavaScriptBlock, or do i have to call it? If i have to call it, how does it work?

Thanks,

Michael

Sep 3, 2009 at 1:13 PM

Hi Christian,

sorry, it was my fault --> my javascript code was wrong....

Everything works fine :)

Thanks a lot!

I really like your webpart :))

 

Michael