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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Data Utility

praseeth.moothe
1-Visitor

Data Utility

Hello All,

I want to use a text box and a button in a single row in Attributes table. How can I achieve this in a JCA attributes table. ? Is it possible through data utilities ?

If anyone has done anything similar or anyone has created a GuiComponent Data utility, can you please explain the procedure to do so. Any help will be appreciated.

Thanks,

Praseeth M

12 REPLIES 12

Hi Praseeth,

Your datautility should extend the
com.ptc.core.components.factory.dataUtilities.DefaultDataUtility.
--> Override the method getDataValue(String s, Object obj, ModelContext
modelcontext)
--> In this method create an arraylist of GUIComponents that you want to
tile
--> Create MultiValuedInputComponent passing ur arraylist
---> Return the MultiValuedInputComponent
Regards,

Murugesh
On Thu, Apr 29, 2010 at 11:54 AM, Praseeth Moothedath <
-> wrote:

> Hi Murugesh,
>
> How do I render the components ? Should I extend the GuiComponent class
> and override teh draw() method ? And inside teh draw method how do I
> actually render the components ?
>
> I am in fact, stuck up here. Smiley Sad
> Thanks ,
> Praseeth M
> +91-9176687882
>
>
>

Thanks Murugesh. It worked !!! I used only the GUiComponentArray. And i
could render a textbox and pushbutton in the Attributes table. I used JS, to
call another JSP at the click of teh button. Thanks for the help.


Hello Praseeth/Murugesh,

 

I am trying to implement similar functionality for two attributes one is combobox and another is a text area.

I want to see plus button of UI for both attributes together. Can you please share exactly how you implemented MultiValuedInputComponent  by passing arraylist of component 

 

Thanks & Regards,

Manisha

 

@MP_10433217 

It is better to ask a new question then react to the 14 years old thread 😄

 

example

 

public Object getDataValue(String columnName, Object rowObject, ModelContext modelContext) throws WTException
{
ArrayList<AttributeGuiComponent> urlLinks = new ArrayList();
UrlDisplayComponent urlDisplay = new UrlDisplayComponent(columnID, null, null, null);
urlLinks.add(urlDisplay);

Label labelComponent = new Label(((ConfigPropertiesItem) rowObject).getFileName());
urlLinks.add(labelComponent );

return new MultiValuedDisplayComponent(urlLinks);
}

 

 

PetrH

Thank you for the example. I want to add a combo box here in with textbox. TextBox display component is working fine.

However is there any API for combobox for adding to MultiValuedDisplayComponent?

Hi @MP_10433217 

What do you want? Don't you know how to create a ComboBox object?

 

You just add the combobox object to the ArrayList and this array contains all components that are shown in one column. 

 

example of multiple components

Filename, DetailpageButton, Actions menu, URL , DisplayText

HelesicPetr_0-1712820041707.png

PetrH

ComboBox giving error that it cannot be cast to AttributeGUIComponent.  As we are trying to add it to the ArrayList of AttributeGUIComponent. 

In the example above all objects are of type AttributeGUIComponents, so able to add it to ArrayList of it.

How could it be possible if the ComboBox is subclass of the AbstractGuiComponent

 

PS: you don't provide any code where I could find your issue. 

 

PetrH

Hi @MP_10433217 

Try to use following ArrayList type: 

GUIComponentArray urlLinks = new GUIComponentArray();

PetrH

Tried doing that. Below is the snapshot of the code.

 

MP_10433217_0-1712901683171.png

 

Hi @MP_10433217 

If you use GuiComponentArray why do you try to create new Multivalue component?

What about just try to return the GUIComponentArray instead of using the new Multivalue method? 

 

here is an class example where you can find how to use the GUIComponentArray 

com.ptc.windchill.enterprise.attachments.dataUtilities.PrimaryAttachmentPropertiesDataUtility

 

PetrH

I need MultiValuedInputComponent because I want to provide input like shown below. Want Plus sign and minus for both the components at the same time.

 

MP_10433217_1-1712904799075.png

 

 

Announcements


Top Tags