Pre populate contacts list with Jpoint

Jul 6, 2010 at 10:44 PM
I need to populate the Contact form fields in the UI after a person is selected from the people picker. After a person is selected in the people picker i was going to use jpoint to get information from the User Information List and write to the newform.aspx without saving the item first. Is this possible? I am able to get the current logged in user and data from the User Information List for the logged in user, but i need to do a lookup based on who is selected in the people picker. I also cannot seem to attach a focus event on the people picker which is a textarea field. I can do it to other fields such as the Company field but no luck with the People Picker field. Does anyone have any ideas or code samples to point me in the right direction? Thanks in adavance D
Coordinator
Jul 8, 2010 at 6:17 AM

I'll break your issues down into 3 tough areas.

  1. How to get ID from people picker field.  This is very difficult to do while on the newform or editform before a save and even more difficult to get write in all the different browsers since Microsoft renders it differently for IE and non-IE browsers.
  2. Once you have the ID of the user chosen in the people picker, you can get the User Information using the jPUserProfile plugin available at  http://www.sharejpoint.com/src/jpoint/plugins/jPoint.userprofile.js.
    You can check out this solution by going to http://www.sharejPoint.com/examples, logging in with the demouser credentials, and clicking on User Profile in the Quicklaunch Bar.   
  3. How to set a focus event on the people picker field.  I have not gotten into this, but I'll check around because this may have been done before.  Also, you again may have the cross browser compatibility issue.

So, that's 1 out of 3, hopefully.  It is a lot of work to solve these types of solutions correctly.  If you make progress, could you please share?  I am sure a lot of others could use this information also.

 

Thanks,

Will

Jul 8, 2010 at 2:29 PM

Thanks for taking the time to respond Will.  Ok at least now I know why all my attempts at getting the people picker value were futile. 

As far as cross browser, our environment is controled and we only drop IE to our users, so cross browser won't be an issue.

However I think the best approach would be to extend the people picker functionality as it writes back the name to the text field, it also writes to the other fields on the contact form.

What do you think?  I havn;t been able to find complete documentation online on how to do this.  Basically I would want to create a custom field that extends the functionality of the people picker field.  I can easily get a handle on the user profiles populated in the ssp.

Thanks!

Darrell