Custom picklist – code here


So lets go to the code. What needs to happen to make the picklist work for more then one field.

If you use the Sample from Mark then change the CC value as :

  1.  “onReturn” set to Scope Value
  2. add the ID of the TR that you like to refresh
  3. Copy paste the JS  that is here below into “ssjsSelectfuntion”
  4. “datasc” should be the VIEW that you are pulling from
  5. Add as many Column into viewcolumn that you are pulling from.
  6. “select” should be UNID

Thats it – pretty cool .  I had some great help from a really good Xpages guy in Germany ,Tim Pistor  so am not taking credit for this myself.

but if you have a sample of xpages picklist that does this better or better yet a Custom control please shear it with us.

if you like to test this out then you can here

UPDATE :  IF anyone like to have the DB then please let me know

JS CODE

var unid = viewScope.unid;

if(typeof unid != “undefined” && unid != null)
{
var doc = database.getDocumentByUNID(unid);
var val1 = doc.getItemValueString(“FIELDONFORM”);
var val2 = doc.getItemValueString(“FIELDONFORM1”);
var val3 = doc.getItemValueString(“FIELDONFORM2”);

getComponent(“ID1”).setValue(val1);

getComponent(“ID3”).setValue(val2);

getComponent(“ID2”).setValue(val3);

}

 Screen Shot 2013-08-25 at 1.01.58 PM

Advertisements

4 thoughts on “Custom picklist – code here

  1. Hi Palmi, i spent a lot of time to search this function of picklist
    Could you please send me nsf database with this example, because I not absolutely understood as works p.2 ‘add the ID of the TR that you like to refresh’
    Many Thanks

  2. Hi palmi, why on screenshort the “refreshID” component = line2 ? Where “line2” is mentioned in code?
    thanks

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s