cancel
Showing results for 
Search instead for 
Did you mean: 

need to pass the user selected value to database as input and get output

Former Member
0 Kudos

hai ,

i have an input field (value help).when i select a value from that i need to pass that particular value to database as input(eg material) and get the output from database(eg amount).I tried doing this by marking the calculated attribute as true for the input field in context and tried ti get the value selected in the method get(attributename) but i see a blank screen as output and the application is not running.please help me in this issue .Its very urgent

public void wdDoInit()

{

//@@begin wdDoInit()

IWDAttributeInfo a=wdContext.getNodeInfo().getAttribute(IPrivateSssView.IContextElement.NAME);

ISimpleTypeModifiable stm=a.getModifiableSimpleType();

IModifiableSimpleValueSet svs=stm.getSVServices().getModifiableSimpleValueSet();

svs.put("1","First");

svs.put("2","Second");

//@@end

}

till i give the calculated attribute as true i find this value help field with the options first and second as given above.

public int getName(IPrivateSssView.IContextElement element)

{

//@@begin getName(IPrivateSssView.IContextElement)

int val=element.getName();

String res=null;

if(val==1)

{ res="Fahad";

}

if(val==2)

{

res="Pradeep";

}

wdComponentAPI.getMessageManager().reportSuccess(res);

return val;

//@@end

}

this is included after setting the calculated attribute as true.suggest me if there is any other method for doin this.

regards

sharanya

Edited by: Sharanya R on Jan 4, 2008 5:58 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

For calculated attributes if you want to change the value's you need to have a set method to do this from the properties of the attribute set the readonly property to false then you will be able to see the setter method created.

Setter method have a parameter called value which returns you the newly selected value.

Regards

Ayyapparaj

Former Member
0 Kudos

hai

now iam not doing it with database as initially i just want to check if this way works for getting a user selcted value.i have checked it with the if condition as given in my code.The read only property is set to false oly.

Former Member
0 Kudos

Hi,

Are you able to see the setter method for the attribute?

Then try to print the value which is one of the parameter to this method.

wdComponentAPI.getMessageManager().reportSuccess(String.valueOf(value));

Regards

Ayyapparaj

Former Member
0 Kudos

hai ayappa ,i dont find my application running when the calculated attribute is set to true.suggest me some other method for doing the same

Former Member
0 Kudos

Hi,

set the readonly to false

You application is not rendering just bcoz their is a recursive call.

Comment the following line which is the culprit.

int val=element.getName();

Regards

Ayyapparaj

Former Member
0 Kudos

hai ayappa,

yes the application is now running when i commented the line.but now iam not able to select the value in my value help at run time.how to get the value which is selected by the user at run time in the getName method which is generated when i set the calculated attribute to true(refer code).

regds

sharanya

Former Member
0 Kudos

Hi,

You need to have the setName, and the setName will have a parameter called value

Which returns you the selected value.

Rgards

Ayyapparaj

Former Member
0 Kudos

hai ayappa,

Thanks a lot.my problem is solved.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shranaya,

Please let us know what is the output of statement

"wdComponentAPI.getMessageManager().reportSuccess(res);" and where you are calling getName() method.

Other way can be set external break point for functrion module, and debug and check what is value being passed to back end.

Regards,

Ganga.

Former Member
0 Kudos

hai gangadharaya,

The application is not running when i set the calculated attribute to true.there is no output.is there anyother way to get user selected value in value help and give that vale as input to get the required output