Reputation: 43
On Click no result.
Here is code repeat control of my xpage:
<xp:repeat
id="repeat2"
rows="5"
var="viewEntryEscalation">
<xp:this.value><![CDATA[#{javascript:
var viewEscalation : NotesView = database.getView("(subEscalation)");
var viewEntryCollectionEscalation : NotesViewEntryCollection = viewEscalation.getAllEntriesByKey(currentDocument.getDocument().getParentDocumentUNID());
return viewEntryCollectionEscalation}]]>
</xp:this.value>
<xp:button
style="margin-right:10.0px"
id="Button"
disableTheme="true">
<xp:this.value><![CDATA[#{javascript:
translateString('Level')+" "+ viewEntryEscalation.getDocument().getItemValueString("Level")
}]]></xp:this.value>
<xp:this.disabled><![CDATA[#{javascript:
viewEntryEscalation.getDocument().getItemValueString("Level")==currentDocument.getItemValueString("Level")
}]]></xp:this.disabled>
<xp:eventHandler
event="onclick"
submit="false"
id="eventHandler14">
<xp:this.script><![CDATA[
XSP.openDialog('#{id:dialogReason}', '', { "FieldName" : "Level" , "DataValue" : viewEntryEscalation.getDocument().getItemValueString("Level") });
]]></xp:this.script>
</xp:eventHandler>
</xp:button>
</xp:repeat>
How I can run this CSJS button code in repeat control ?
Upvotes: 1
Views: 65
Reputation: 30960
XSP.openDialog(...
gets executed on client, but your third parameter contains definitely server side code.
Execute the server side code before the code gets send to client with #{javascript: ...}
:
XSP.openDialog('#{id:dialogReason}',
'',
{ "FieldName" : "Level" ,
"DataValue" :
'#{javascript: viewEntryEscalation.getDocument().getItemValueString("Level")}'
});
Upvotes: 2