0
votes

I'm using a Name Picker on an XPage which in itself works well and adds a value correctly to a field with the XPage in edit mode. Immediately after the new value has been placed in the field, I would like to take that value and add it to a label elsewhere on the XPage. I've tried using Dojo together with the onchange event of the field but it doesn't work (I presume because the new value is not yet present in the document's HTML). Is there any other way of doing this?

In The Notes Client, I do this using @SetField and then refreshing the document.

1
I solved this using dojo.attr(id,"value") :-)user1358852
Enter the solution as an answer to your own question and accept it to make it easier for others searching for a similar solution to find.Tim Tripcony

1 Answers

1
votes

My Dojo solution for this problem below -

var idCE = "#{id:CurrentEditor}";
var idPM = "#{id:PersonalManager}";
var pm = dojo.attr(idPM,"value");
dojo.byId(idCE).innerHTML = pm;

I use dojo.attr to get the value of an input field in an as yet unsaved document and then add it to a label using dojo.byId("id").innerHTML.

If CurrentEditor were an input field, I would use

dojo.attr(idCE,"value",pm)