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;
}
}
Solved! Go to Solution.
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
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
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.
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
I want text Box in the table builder.
Not an issue. Send me your code and i will try to debug it.
Hi ,
I am trying to achieve the same requirement.
I have a custom table builder with custom attributes column.
And I have to add text box for the attributes in table builder.
With the solution provided I could get that, I have to write a data utility as well to define the method,
But how and from where to call that from custom table builder.
Can you please help me with the solution you worked on?
I have attached table builder code and customized data utility.i have attached snap shot of the output im getting
Just Curious...is control going inside your datautility class? Where and how did you register the datautility?
yes code inside data utility is working as i had written system.out.println inside it.i hav registered it inside service.properties
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.
thanx.I will try my best
Hi ,
I am trying to achieve the same requirement.
I have a custom table builder with custom attributes column.
And I have to add text box for the attributes in table builder.
With the solution provided I could get that, I have to write a data utility as well to define the method,
But how and from where to call that from custom table builder.
Can you please help me with the solution you worked on?