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

We are happy to announce the new Windchill Customization board! Learn more.

Can I generate an HTML fragment in DataUtility?

ptc-4523198
1-Newbie

Can I generate an HTML fragment in DataUtility?

Hello all.

I am trying to display custom HTML fragment inside the OOTB attribute panel. I already created a controller that generates the fragment.

Can I use this controller to substitute attribute value using Data Utility?

As an example I could use com.ptc.carambola.rendering.HTMLComponent to display custom HTML in the attribute:

HTMLComponent hc = new HTMLComponent("<a href='www.google.com'> Goole Link </a>" );

But I need help figuring out how to dynamically generate that HTML.

Windchill R10.1

Any help is very much appreciated.

Vitaliy.

6 REPLIES 6
KD
4-Participant
4-Participant
(To:ptc-4523198)

If your custom HTML fragment is only link then you can use

com.ptc.core.components.rendering.guicomponents.UrlInputComponent

Chanhasen
5-Regular Member
(To:KD)

Hi Kaushik,

I am also trying the same.In table Builder ,i need to display a Link. I m working on UrlInputComponent. Can you please elebroate how to achieve through UrlInputComponent.

What i am trying is ," In build component method,i am passing a UrlInputComponent instance: .but in table builder,its displaying as a string.

Can you please guide me ,

KD
4-Participant
4-Participant
(To:Chanhasen)

HI Chan,

Use this snippet.Hope it may help you.

UrlDisplayComponent url = new UrlDisplayComponent();

url.setLink("www.ptc.com");

url.setColumnName("columnName");

url.setLabel(part.getName());

url.setLabelForTheLink(part.getName());

return url;

Regards,

Kaushik

Chanhasen
5-Regular Member
(To:KD)

Thanks Kaushik..It exactly matchs my requirement..

KD
4-Participant
4-Participant
(To:Chanhasen)

you are welcome chan.

From table builder we populate the data in a table.

And after that using Data Utility you can make it hyper linked or highlighted or icon with link etc.

Regards,

Kaushik

Just to add to the discussion, it is more normal to use an icon to show a link rather than text with a link so the IconComponent is another key item in armoury here. A good tooltip is essential so the user can see what the icon means, and an icon saves on real estate usage. A GUIComponentArray can display a number of components in the same data utility such as a number of icons.


Regards and Happy Holidays,

Simon

Top Tags