Metastorm link button in form segment
I was encountered in problem where I need a Link button in form segment but unfortunately it does not provide by Metastorm.
There is an option available in Label where you can define URL in property and it converts to hyperlink. But it will be static and you cannot change it. Another problem is that it opened in new page.
So, Solution is
1) Add label in your form segment and set caption as below which will load function "FormSegment_OnLoad" when form segment load.
window.attachEvent("onload", FormSegment\_OnLoad);
2) Add another label in your form segment which you want to make as link ex.: lblParentRequestNo and set URL property as below. This function "OpenParentRequestNo" will be usefull for any code you want to execute on hyperlink click.
javascript: OpenParentRequestNo();
3) Add below function in your client script library. And set your label target property to "_self". This is important otherwise it will open form in blank page and not able to execute your function "OpenParentRequestNo"
function FormSegment_OnLoad()
{
try
{
document.getElementById('lblParentRequestNo').childNodes[0].target = "_self";
}
catch(ex) {alert(ex.description);}
}
4) Add your function "OpenParentRequestNo" code here, in my case I am clicking on button which open existing folder.
function OpenParentRequestNo()
{
try
{
document.getElementById('cmdOpenParent').click();
}
catch(ex) {alert(ex.description);}
}
That's all...
Hope this helps... someone…