Feature request: show context information on a form (e.g. newform.aspx)

Sep 6, 2009 at 12:32 PM

I hae done some very basic testing around the idea of adding some context information to a standard form, like newform.aspx, using jQuery. 

Example: we have a contact list that has name, address, phone number, etc.

I have a form with a lookup tied to the name in the contact list.

When I'm on newforms.aspx, I can use the regular lookup column to select my contact.  It would be nice to automatically display relevant data from the contact directly onto newform.aspx underneath the drop-down, such as phone number, address.

If you can make this more generic then you have created a wonderful tool.

 

Coordinator
Sep 6, 2009 at 12:42 PM
Edited Sep 8, 2009 at 2:59 AM

This is a great idea, Paul. I'm thinking that we could display the
related information below the LFWP on the lookup value's selection.
The function could accept the following options: lookup column name,
[related columns to display].

Does this mesh with your thinking?

M.

Sep 6, 2009 at 1:40 PM

That sounds right.  It would be very nice to have that feature available and easy to plug into forms.

I'd want to use it newforms and dispforms and editforms.  I don't know if that would impact the core logic or if it would just mean that you need to put the jquery stuff onto each of those forms' pages.

It would also be interested to extend this to add built-in queries to other places, like search within WSS/MOSS (keyword search) and search to external sources.  It would be neat to have a "search recent financial news for this customer" that does a search for that company's sticker symbol on yahoo financials or something.

I'm getting ahead of myself, though :)

If you get the basic context thing working, that would make a big splash.  I'm sure Mark Miller would eat that up for his site.

Coordinator
Sep 6, 2009 at 2:57 PM

We should be able to do this by simply adding the jQuery call to the form pages.  (The core logic remains intact.)  I'll need to think about how we can get this to work with the cascading dropdowns (or any other future functions).  I could see someone wanting to load up the forms with a combination of these functions to make their forms much richer.

I'll try to get something quick and dirty dummied up in the next few days for you to look at.  (Family weekend, and all, but I'd love to get this one implemented.)

M.

Coordinator
Sep 8, 2009 at 9:11 PM
Edited Sep 9, 2009 at 9:24 PM

Paul:

I've got a prototype of this up and running.  Here's a screen shot as it stands: http://ow.ly/i/4W

Now that I've been thinking about it for a while, there are so many variations that could be useful, I'm not sure exactly how to think them all through.  For instance, based on what you said in your first comment above, when I select a State in my dropdown, I'm displaying the Region, State, and State Abbreviation below the dropdown in a table.  However, you could easily see all of the variations below being useful:

Placement

  • within the dropdown table cell (as implemented now)
  • to the right of the table cell
  • at the bottom of the form (below the OK/Cancel buttons)

Format

  • table format with or without headers
  • vertical format (like the form itself), with or without row labels

Columns

  • control over the formatting of each individual related column
  • etc.

I can provide options for each of these, and I think it could be pretty multipurpose, but maybe overloaded for the average user.  I'm going to post the currrent code under the SPServices 0.2.9 release if you'd like to take a look.  Here's how I'm calling the function in my test environment:

$().SPServices.SPDisplayRelatedInfo({ 
    columnName: "State",               // The display name of the column in the form
    relatedWebURL: "/Intranet/JQueryLib",           // [Optional] The name of the Web (site) which contains the related list
    relatedList: "States",               // The name of the related list
    relatedListColumn: "Title",              // The internal name of the column in the related list
    relatedColumns: ["Region_x0020_Name", "Title", "State_x0020_Abbreviation"],  // An array of related columns to display
    displayFormat: "table"               // The format to use in displaying the related information.  Possible values are: "table" (not yet implemented).
   });

Let me know what you think!

M.

Coordinator
Sep 14, 2009 at 1:26 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.