cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to add hyperlink in builder

HT_9313847
1-Newbie

How to add hyperlink in builder

I am using Windchill PDMLink Release 11.0 and Datecode with CPS M030-CPS17

 

How to add hyperlink in builder

For example

ColumnConfig expired_qty = getColumn(factory, MaterialBOMDetailBean.EXPIRED_QTY,

messageSource.getMessage(GoldenRB.EXPIRED_QTY_DESCRIPTION), true);

table.addComponent(expired_qty);

 

ColumnConfig expireDate = getColumn(factory, MaterialBOMDetailBean.EXPIREDATE,

messageSource.getMessage(GoldenRB.EXPIREDATE_DESCRIPTION), true);

table.addComponent(expireDate);

 

Whether the attribute values ​​in the establishment of two ColumnConfig can be added link

 

Translated by Simona using Google Translate on 1/26/2022

-------------

 

I am using Windchill PDMLink Release 11.0 and Datecode with CPS M030-CPS17

請問如何在builder 裡面加入 hyperlink
例如
ColumnConfig expired_qty = getColumn(factory, MaterialBOMDetailBean.EXPIRED_QTY,
messageSource.getMessage(GoldenRB.EXPIRED_QTY_DESCRIPTION), true);
table.addComponent(expired_qty);

ColumnConfig expireDate = getColumn(factory, MaterialBOMDetailBean.EXPIREDATE,
messageSource.getMessage(GoldenRB.EXPIREDATE_DESCRIPTION), true);
table.addComponent(expireDate);

建立兩個 ColumnConfig 裡面的屬性值是否可以加入link

 

 

1 REPLY 1

Hello @HT_9313847 ,

I usually use a DataUtility to render hyperlink.

Create DataUtility class

register the datautility in a service.properties by site.xconf

 <Service context="default" name="com.ptc.core.components.descriptor.DataUtility"
targetFile="codebase/service.properties">
<Option cardinality="duplicate" order="1" overridable="true"
requestor="java.lang.Object"
selector="duHyperLink"
serviceClass="com.custom.HyperLink.HyperLinkDataUtility"/>
</Service>

use the datautility ID(selector) to set in a databuilder 

// col is a ColumnConfig ...
col.setDataUtilityId("duHyperLink");

 Simple example of datautility to render hyperlink

public class URLLinkAttribute extends NameNumberDataUtility
{

public Object getDataValue(String columnID, Object object, ModelContext modelContext) throws WTException
{
String url = "http:\\www.google.com";
String value = "go TO GOOGLE";
ArrayList<AttributeGuiComponent> urlLinks = new ArrayList();

UrlDisplayComponent urlDisplay = new UrlDisplayComponent(columnID, null, null, null);
urlDisplay.setLink(url);
urlDisplay.setLabel(value);
urlDisplay.setName(value);
urlDisplay.setLabelForTheLink(value);
urlLinks.add(urlDisplay);

return new MultiValuedDisplayComponent(urlLinks);
}

 

Hope this can help.

 

PetrH

Top Tags