Trapping a Java value in Lotus Script (field)

Good Day Folks,

I have finally made the jump to including Java in my notes developement, but I am meeting one challenge.

I have not figured out how to either store on a form the java returned value to a particular field or grab from the java field in lotus script. This makes my save a little useless as the values are not captured.

Can anyone provide me an example or point me in the right direction… I have exhausted my sources… so any pointers would be appreciated.

Thanks,

Ken.

Subject: Trapping a Java value in Lotus Script (field)

Can you explain a bit more about this bit… “I have not figured out how to either store on a form the java returned value to a particular field or grab from the java field in lotus script.”

If you are writting Java agents then creating/reading Notes Items is almost identical to LS.

To create an item use doc.replaceItemValue( “MyField”, “My Value” ).

To read the value use something similar to doc.getItemValueString( “MyField” )

Frunobulax

Subject: RE: Trapping a Java value in Lotus Script (field)

What I am attempting to use is a Datepicker on a Form which is almost completely LS. The JS that I am using has been saved as GCappearance.js and GurtCalendar.js.

I have a field called DateLaunch which is a of notesdate/Time type - hidden.

I then have java script above this field as follows:

<script language="JavaScript" src="GCappearance.js"></script>

<script language="JavaScript" src="GurtCalendar.js"></script>

<link rel="stylesheet" href="calendar.css">

<script language="JavaScript">

		<!--		

		var MyDate = {

			'appearance': GC_APPEARANCE

		}

		new gCalendar(MyDate);

		//-->

		</script>

The question would be how do I get that value from ‘MyDate’ into the DateLaunch field??

Subject: RE: Trapping a Java value in Lotus Script (field)

I thought you were talking about Java… not JavaScript, big difference.

Are you doing this on the web or Notes Client?

Subject: RE: Trapping a Java value in Lotus Script (field)

Sorry, its FRiday and I am feeling it…

I am doing this for he web client side. I am using the normal notes date for notes client.

Subject: RE: Trapping a Java value in Lotus Script (field)

Check my first post for web date picker info.

Subject: RE: Trapping a Java value in Lotus Script (field)

Um… the first question is what does this have to do with Java? Javascript and Java are two completely different languages. You write a value to a field in javascript using the following technique:

frm.field.value = “fieldvalue”

where frm is a variable defined in the onLoad event as

frm = window.document.forms[0];

and field is the name of the field on the form you are writing to (note that the name is case sensitive, javascript shares this with the java language). define the form variable in onLoad so that it may be referenced by all of your code throughout the form.

I also wouldn’t spend a lot of time building a date picker from scratch unless you are doing it as an intellectual excersize. There are dozens of them out there, many freeware. Dynarch’s is excellent, widely used, and well-documented.