Skip to main content
1-Visitor
March 25, 2013
Question

Can I generate an HTML fragment in DataUtility?

  • March 25, 2013
  • 2 replies
  • 3047 views

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.

2 replies

12-Amethyst
April 1, 2013

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

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

1-Visitor
December 23, 2013

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 ,

12-Amethyst
December 23, 2013

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

1-Visitor
December 24, 2013

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