cancel
Showing results for 
Search instead for 
Did you mean: 

setBirthday(String) in the type IPrivateForm.IContextElement

Former Member
0 Kudos

recently i was doing a tutorial on <b>A Simple Input Form</b> on page 25

there is a declared method for initialize i have problem with the code at this line

<u><b>wdContext.currentContextElement().setBirthday(new Date(0));</b></u>

as the error message is show as below

<b>The method setBirthday(String) in the type IPrivateForm.IContextElement is not applicable for the arguments (Date)</b>

wonder did any encounter the same problem and can help me up. as i saw in my IPrivateForm for the method for my setBirthday is as below

<b>public void setBirthday(java.lang.String value) {

this._birthday = value;

changed(2);

}</b>

or anyone that has do this Tutorials which is found on here

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/a%20simple%20input%20form%20with%20message%20and%20error%20service%20support.pdf">A Simple Input Form Tutorials</a>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The context attribute that you have defined is of type string and not date. If you want to set Date to that field than change its type to data.

Change the type of the context attribute BirthDay to date

Regards,

Murtuza

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jia Jun Ng,

Please check type of context attribute Birthday. If it is of type String, you can change the code to

wdContext.currentContextElement().setBirthday(new Date(0)+"");

OR

change the type of value attribute to Date.

Regards,

Ganga.

Former Member
0 Kudos

thanks i try ur code it work now my application is free that errors

Former Member
0 Kudos

Hi Jia,

Try

wdContext.currentContextElement().setBirthday(new Date(System.currentTimeMillis())) instead of new Date(0)

Regards,

Smruti

Message was edited by:

Armin Reichert