xpages - How can I add a default value to an editable date field bound to a datasource? -


I created an expense as a data source with a form. It has 8 fields in one field, I want to be able to set a default value (like today's date), but allow the user to change it.

I have a format that is bound to a date field on my form. If I put a default value in the editing box control, it does not seem as long as I do not just read the field.

I have tried to add value to earlier and later events.

Nothing works

It should be easy and I'm looking a little easier Please help.

  var today = new date (); Var dd = today.getDate (); Var mm = today.getMonth () + 1; // is January! Var yyyy = today.getFullYear (); If (dd & lt; 10) {dd = '0' + dd} if (mm> 10) {mm = '0' +}} today = mm + '/' + dd + '/' + Yyyy; Var Doctor: Notes document = TimeInterior.jet document (); // var thisDB: notes document = session.getCurrentDatabase () // var document: notes document = thisD if (doc.isNewNote ()) {//doc.getComponent("date1").setValue(today); Doc.replaceItemValue ("Date", Today); }}     

Here is an example of an edit box control that defaults to a date field Valid values ​​are:

  & lt; Xp: inputText id = "date" value = "# {document.Date}" defaultValue = "# {javascript: @Today ()}" & gt; & Lt; XP: this.converter & gt; & Lt; Xp: convertdate type = "date" /> & Lt; / XP: this.converter & gt; & Lt; Xp: datetimeholder id = "datetime haler 2" /> & Lt; / XP: inputText>  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -