Can you open a html widget link into a new window in a certain size, on the service portal?

dave_edgar
Mega Guru

Now we've tried lots of things already but all we seem to be able to do is get the link to open into a new tab.

We have this on our CMS portal which open a link to a chat window:
a href="$chat_support.do?queueID=${menuO.sys_id}" onclick="window.open('$chat_support.do?queueID=${menuO.sys_id}','chat','width=800,height=600'); return false;">${menuO.name}</a>

But when trying this on the portal via a html widget the onclick section gets striped out.  

We've looked at the SN portal training but this isn't covered and I can't find good example of how to do it in the community.

Below is the closest I have gotten to getting there :
adding this to the JSON section 
"target": {"value": "_blank",
"displayValue":"_blank"
}
 
BUT anyone know if you can define the window size by adding a line such as: 
"target":{
"value": "_blank",
"displayValue":"_blank"
"height":"600",
"width":"800"}

1 ACCEPTED SOLUTION

Kumar Tella
Mega Expert

Dave,

The popup window and reszing working now. I Modified the Circle Icon code in HTML Template and added client script. Changes are here.

<!--// Circle Icon popUp-->
<a ng-click="c.openPopUp()" class="circle_icon {{::options.class_name}} text-{{::options.color}}" >
<span class="image-container" ng-if="options.u_image">
<img class="media-object" src="{{::options.u_image}}" width="55" height="55" alt="${{{options.title}}}" style="cursor:pointer;">
</span>
<h2 style="cursor:pointer;">{{::options.title}}</h2>
<span class="text-muted" style="cursor:pointer;">{{::options.short_description}}</span>
</a>

Added this in client script in Client controller:

// Client script
function() {
var c = this;
c.openPopUp = function() {
var url = "my url";
var popup = window.open (url, "popup", "width=900, height=600");
}
}

View solution in original post

7 REPLIES 7

Kumar Tella
Mega Expert

Jeff,

We have to add this in json section on widget, this is where we are having trouble.

Kumar Tella
Mega Expert

Dave,

The popup window and reszing working now. I Modified the Circle Icon code in HTML Template and added client script. Changes are here.

<!--// Circle Icon popUp-->
<a ng-click="c.openPopUp()" class="circle_icon {{::options.class_name}} text-{{::options.color}}" >
<span class="image-container" ng-if="options.u_image">
<img class="media-object" src="{{::options.u_image}}" width="55" height="55" alt="${{{options.title}}}" style="cursor:pointer;">
</span>
<h2 style="cursor:pointer;">{{::options.title}}</h2>
<span class="text-muted" style="cursor:pointer;">{{::options.short_description}}</span>
</a>

Added this in client script in Client controller:

// Client script
function() {
var c = this;
c.openPopUp = function() {
var url = "my url";
var popup = window.open (url, "popup", "width=900, height=600");
}
}

brill thanks for this.  I also just realised that working on a mac by default a new tab is always created when viewing the browser in full screen but on a Windows machine regardless is you are in full screen the popup appears.