xpages - Adding values to multi-value field and displaying them -
i have 3 multi-value fields , have inserted values in them. of fields text type, edible. i'm trying want add functionality in xpages, can add new values fields. here's got far:
the code triggers on save button:
var statuss = document1.getitemvalue("statuss"); var stat_vec:java.util.vector = document1.getitemvalue("statuss_update"); stat_vec.add(statuss); document1.replaceitemvalue("statuss_update", stat_vec); var vards = session.geteffectiveusername(); var vards_vec:java.util.vector = document1.getitemvalue("name_update"); vards_vec.add(vards); document1.replaceitemvalue("name_update", vards_vec); var laiks = session.createdatetime("today"); var laiks_vec:java.util.vector = document1.getitemvalue("time_update"); laiks_vec.add(laiks); document1.replaceitemvalue("time_update", laiks_vec); document1.save();
the code have atteched computedfield, values displayed 3 multi value fields + refreshes when insert new values:
var x = document1.getitemvalue("statuss_update"); var y = document1.getitemvalue("name_update"); var z = document1.getitemvalue("time_update"); var html = "<head><link rel=\"stylesheet\" type = \"text/css\" href=\"test.css\"></head><table id=\"tabula\">"; (i = 0 ; < x.size()-1; i++){ html= html + "<tr><td>" + x[i] + "</td><td>" + y[i] + "</td><td>" +z[i] + "</td></tr>"; } html = html + "</table>";
i can insert values , displayed in html table problem saving edits. whenever try save document (i have save button has save document event attached it) error:
could not save document 1b06 notesexception: unknown or unsupported object type in vector
as far understand i'm trying savesomething in field, values type not supported. can give me hint doing wrong or problem? been stuck pretty long time.
is part?
var statuss = document1.getitemvalue("statuss"); var stat_vec:java.util.vector = document1.getitemvalue("statuss_update"); stat_vec.add(statuss);
it looks you're getting statuss
item's values (potentially vector??) , adding vector statuss_update
. if it's 1 value, getitemvaluestring()
work better.
i'm nnot sure if right, mention fields text type, looks you're passing datetime third one.
it might worth analysing contents of vectors before it's doing save, make sure contain expect.