cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Type null pointer

Former Member
0 Kudos

OK I thought I had this figured out but...

I am getting a null pointer error on this code:

ISimpleValueSet valueset = wdContext.getNodeInfo().getAttribute(IContextElement.element).getSimpleType().getSVServices().getValues();

I tried breaking it down into this:

IWDAttributeInfo attributeinfo = wdContext.getNodeInfo().getAttribute(IContextElement.element);

ISimpleType simpleType = attributeinfo.getSimpleType();

ISimpleValueSet valueset = simpleType.getSVServices().getValues();

And found that the error occurs here: ISimpleType simpleType = attributeinfo.getSimpleType();

Any suggestions as to why this may be happening?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I have resolved this issue, for anyone who may be interested the problem was that I had bound the fields to the Original View (where the values were set) which were tied to the Component controller but did not have the fields on the Secondary View (where the values are displayed) tied to the Component controller.

Once I created the fields in the Secondary View Context and tied them to the fields in the Component Controller context all was well!!)

nikhil_bose
Active Contributor
0 Kudos

plz refer following code.


ISimpleValueSet valueset =  
    wdContext
    .getNodeInfo()
    .getAttribute(IPrivate<CompName>View.IContextElement.ELEMENT) // or enter attribute name instead
    .getSimpleType()
    .getSVServices()
    .getValues();

nikhil

Former Member
0 Kudos

Hi,

please use the following code:

ISimpleValueSet valueset =

wdContext

.getNodeInfo()

.getAttribute(IPrivate<CompName>View.IContextElement.ELEMENT) // or enter attribute name instead

.getSimpleType()

.getSVServices()

.getValues();

and please check if u bind the simple type to

context attribute --> element or not.

Former Member
0 Kudos

What is the name of your context attribute? Does the following compile?


wdContext.getNodeInfo().getAttribute(IContextElement.element);

If yes, what is the type of attribute "element"?

Armin

former_member197348
Active Contributor
0 Kudos

Hi,

Actual problem probably in this statement

IWDAttributeInfo attributeinfo = wdContext.getNodeInfo().getAttribute(IContextElement.element);

particularly in IContextElement.element. (I hope you are giving upper case like

IContextElement.<YOUR ELEMENT NAME IN UPPER CASE> ) Check whether it is returning proper value. Print this value

wdComponentAPI.getMessageManager().reportSuccess("AttributeInfo "+ attributeinfo);

Regards,

Siva