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

creating textarea wherein I can manually enter values.

SOLVED
Highlighted
Newbie

creating textarea wherein I can manually enter values.

I have written datautility extending AbstractDataUtility but textarea is not visible in table builder.Code is as follows.

public class AttributeTextAreaDataUtility extends AbstractAttributeDataUtility {

public Object getDataValue(String component_id, Object datum, ModelContext mc) throws WTException

{

super.getDataValue(component_id, datum, mc);

TextArea textarea = new TextArea();

TextArea textArea = GuiComponentUtil.createTextArea(1, 2, 3 );

//textArea.setColumnName(AttributeDataUtilityHelper.getColumnName(component_id, datum, mc));

textarea.setValue(getAttributeDisplayValue(component_id, component_id, datum, mc));

textarea.setReadOnly(true);

textarea.setWidth(40);

textarea.setHeight(5);

//textarea.setName(component_id);

return textarea;

}

private static String getAttributeDisplayValue(String attributeName,String componentId, Object datum, ModelContext mc)

throws WTException

{

Object raw_val = UtilityHelper.getRawValue(attributeName, datum, mc);

String value = UtilityHelper.getStringValue(raw_val, componentId,datum, mc);

return value;

}

}

1 ACCEPTED SOLUTION

Accepted Solutions

Re: creating textarea wherein I can manually enter values.

Hello Hrishikesh,

Have you created a custom builder class? Are you trying to hook the datautility to an attribute from builder or is this attribute is OOTB attribue?

But whatever the case may be you dont need these many lines of code in a datautility to display a Text Box.

Just one method inside your datautiliy class is sufficient:

public Object getDataValue(String component_id, Object datum,

ModelContext modelcontext) throws WTException {

TextArea textArea = new TextArea();

textArea.setId(component_id);

textArea.setEditable(true);

textArea.setLabel("MY TEXT AREA");

textArea.setWidth(20);

return textArea;

}

-Prabhash

View solution in original post

10 REPLIES 10

Re: creating textarea wherein I can manually enter values.

Hello Hrishikesh,

Have you created a custom builder class? Are you trying to hook the datautility to an attribute from builder or is this attribute is OOTB attribue?

But whatever the case may be you dont need these many lines of code in a datautility to display a Text Box.

Just one method inside your datautiliy class is sufficient:

public Object getDataValue(String component_id, Object datum,

ModelContext modelcontext) throws WTException {

TextArea textArea = new TextArea();

textArea.setId(component_id);

textArea.setEditable(true);

textArea.setLabel("MY TEXT AREA");

textArea.setWidth(20);

return textArea;

}

-Prabhash

View solution in original post

Re: creating textarea wherein I can manually enter values.

I tried with the above mentioned code but still i am not getting textbox wherein i can manually enter values.I have created a table builder wherein I hav added customized Data utility as a column.

Re: creating textarea wherein I can manually enter values.

Hrishikesh, I have used the same code many a times without any error. If you could send me your code may be i will be able to debug it and help you out. And finally do you want a Text Box or a Text Area?

-Prabhash

Re: creating textarea wherein I can manually enter values.

I want text Box in the table builder.

Re: creating textarea wherein I can manually enter values.

Not an issue. Send me your code and i will try to debug it.

Re: creating textarea wherein I can manually enter values.

I have attached table builder code and customized data utility.i have attached snap shot of the output im getting

Re: creating textarea wherein I can manually enter values.

Just Curious...is control going inside your datautility class? Where and how did you register the datautility?

Re: creating textarea wherein I can manually enter values.

yes code inside data utility is working as i had written system.out.println inside it.i hav registered it inside service.properties

Re: creating textarea wherein I can manually enter values.

Hello Hrishkesh,

I have not got the chance to deploy your code as it is and test it, but i used the same datautility code which i have asked you to use earlier just by replacing the TextArea object with TextBox. Good news is it worked fine. I am attaching a snapshot for your reference. Please do little bit of debugging and i am sure you are going to find the error.

Text Box in table column.GIF