Getvalue of custom UI attribute
Hi,
i don't know how to get value from custom attributes using the getCustomAttributes() method: i've many custom attribute on my UI and when i'll submit the form ( a typical task item type with other custom fields ) i need to get the value. I tried with
but when i run the code i get a NullPointerException
How can i solve ?
Thx.
i don't know how to get value from custom attributes using the getCustomAttributes() method: i've many custom attribute on my UI and when i'll submit the form ( a typical task item type with other custom fields ) i need to get the value. I tried with
List<IAttributeHandle> attributes = newState.getCustomAttributes();
for (IAttributeHandle iah : attributes){
Object obj = ((IAttribute)iah.getOrigin()).getValue(null, newState, monitor);
}
but when i run the code i get a NullPointerException
How can i solve ?
Thx.
4 answers
well, getValue() requires a non-null first parameter
Object com.ibm.team.workitem.common.model.IAttribute.getValue(IAuditableCommon auditableCommon, IWorkItem workItem, IProgressMonitor monitor) throws TeamRepositoryException
Returns the current -- calculated -- value of this attribute.
Parameters:
auditableCommon the common auditable library
workItem
monitor a progress monitor or null
------------------------------------------------------------
The auditable library provides access to IAuditables as an interface available on both the client and the server. On the client it can be obtained as a client library, on the server as a service.
================
Sam
Object com.ibm.team.workitem.common.model.IAttribute.getValue(IAuditableCommon auditableCommon, IWorkItem workItem, IProgressMonitor monitor) throws TeamRepositoryException
Returns the current -- calculated -- value of this attribute.
Parameters:
auditableCommon the common auditable library
workItem
monitor a progress monitor or null
------------------------------------------------------------
The auditable library provides access to IAuditables as an interface available on both the client and the server. On the client it can be obtained as a client library, on the server as a service.
================
Sam
I think you are building an advisor or particpant.
If you are, then the AuditableCommon object is provided as part of the parameters to your advisor code.. (took me a while to find it too)
Sam
If you are, then the AuditableCommon object is provided as part of the parameters to your advisor code.. (took me a while to find it too)
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
Sam
I think you are building an advisor or particpant.
If you are, then the AuditableCommon object is provided as part of the parameters to your advisor code.. (took me a while to find it too)
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
Sam
Please let me know what should this 'data' to be initialises?
thanks
Sundar