This is driving me batty, but it's pretty simple, so it must be
something I'm missing. I removed everything complex from my page, and
still can't get it to work.
In this source below,
computedfield3 is giving me 'doc is null' errors. Computedfield2 is
fine, and displays the correct date format, so I know I'm able to access
my collection ('rowData'). Why does this fail:
var doc:NotesDocument = rowData.getDocument();
doc.getItemValueString("sched_location")
Long-time
LS developer, new to xpages, but I thought a 'getDocument' would return me
a valid document object that I could run a getItemValueString on to
pull a value. I have workarounds, but eventually I will need to get a handle on the doc object to modify and save it. Can someone give me a hint?
SOURCE
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoView var="view1" viewName="by Week Ending"></xp:dominoView>
</xp:this.data>
<xp:repeat id="repeat1" rows="30" value="#{view1}" var="rowData">
<xp:panel>
<xp:this.data>
<xp:dominoView var="view2" viewName="by Week Ending"></xp:dominoView>
</xp:this.data>
<xp:br></xp:br>
<xp:text escape="true" id="computedField1" value="#{rowData.sched_age}">
</xp:text><xp:br></xp:br><xp:text escape="true"
id="computedField2"
value="#{rowData.sched_name}"></xp:text><xp:br></xp:br><xp:inputText
id="inputText1"
value="#{rowData}"><xp:this.defaultValue><![CDATA[#{javascript:var
sdt:NotesDateTime = rowData.getColumnValue( "MonStartFull" );
var edt:NotesDateTime = rowData.getColumnValue( "MonEndFull" );
var tempS = rowData.getColumnValue( "MonStart" );
var tempL = rowData.getColumnValue( "sched_location");
if (tempS == '' ) {
'Off'
}else{
var shrs = sdt.getHours();
var smins = sdt.getMinutes();
var ehrs = edt.getHours();
var emins = edt.getMinutes();
if (shrs > 12){
shrs = shrs - 12;
var spmFlag = 'pm';
}
if (ehrs > 12){
ehrs = ehrs - 12;
var epmFlag = 'pm';
}
if (emins == 0){
emins = ''
}else{
emins = ':' + emins
}
if (smins == 0){
smins = ''
}else{
smins = ':' + smins
}
shrs + smins + spmFlag + '-' + ehrs + emins + epmFlag + ' ' + tempL;
}
}]]></xp:this.defaultValue></xp:inputText>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:text escape="true" id="computedField3"><xp:this.value><![CDATA[#{javascript:
var doc:NotesDocument = rowData.getDocument();
doc.getItemValueString("sched_location")}]]></xp:this.value></xp:text></xp:panel>
</xp:repeat>
</xp:view>