Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Let's say we have a SP list : "Parents" and a SP list "Children". The later have a lookup field to the former.

In the dispform of the parent, I want to have :

  • the detail of the parent (OOB)
  • the list of children related to the current parent
  • a form to create a new child related to the current parent.

Of course, the lookup mechanisms must completely wrapped in the page.

How can I achieve that ? (preferably using SPD)

The only way I found is to create a custom webpart for the children and putting it in the parent dispform. This is quite a mess as I have to maintain the code beside the children list structure.

share|improve this question
add comment

2 Answers 2

You can do this by adding a Data View Web Part (DVWP) to the page in SharePoint Designer. In your DVWP you'd use an AggregateDataSource containing both the parent and child lists. The DVWP can grab the item ID from the Query String and use it as a filter value.

It sounds like what I'm proposing is what you're already doing, perhaps, but this should at least serve as validation for the approach.

EDIT (based on question below):

I don't have an exact link for this method. However, I have a demo you could look at. Go here http://www.sympraxisconsulting.com/Demos/default.aspx and grab the "Middle Tier - SharePoint Fest Denver 2011" solution. Set it up in your environment and look at EditFormCustom for the Navigation SubAreas list.

share|improve this answer
    
do you have any link ? When I talked about the custom webpart, I mean a coded in VS web part... I'm quite new to SPD. thx –  Steve B May 27 '11 at 15:33
    
Sorry for the late response. I took a look at your sample. However, it only answer partially to the question (showing child items). I succeeded already to show child data using a simple filtering connection between webpart. What I still don't know how to do (at least without writing code), is to add in the dispform.aspx of "parent", a form for the "child". In you sample, when you want to add a new "navigation items", you still have to select the sub area. The form does not know you are in a sub area –  Steve B Jun 1 '11 at 12:37
    
I'm not sure I understand where you're trying to go with this. –  Marc D Anderson Jun 3 '11 at 3:20
    
my display form must contains (no popup): 1. the detail of parent 2. the list of children related to the displayed parent and 3. a form to create a new child, without having to select the parent (the current parent must be the parent) –  Steve B Jun 3 '11 at 7:54
    
Ah. If you have a column in the child form which contains the parent ID, you can hide that column and populate it with script based on the ID on the Query String. –  Marc D Anderson Jun 3 '11 at 18:48
add comment
up vote 1 down vote accepted

I finally found the solution (helped by Marc and this blog post).

Steps to success :

  1. Open in SPD the OOB dispform.aspx of the parent list
  2. In the same page, add a standard XsltViewWebPart or a DataFormWebPart. Use WebPart connexions to filter the data (Consume a filter from the OOB listformwebpart)
    • This may also work with filtering data from the url instead of a WP connection, but I did not tried.
  3. for the last part (inserting a child from the parent form), insert a standard DataFormWebPart (of kind newform to the children list).
  4. add to the DFWP a parameter "ParentID" that takes the ID from the querystring
  5. within the dvt_1.rowinsert xslt template, a textbox like this :

            <tr style="display:none">
                <td>
                    <asp:TextBox text="{$ParentID}" runat="server" id="ff5{$Pos}" __designer:bind="{ddwrt:DataBind('i',concat('ff5',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Parent.')}" />
    
                </td>
            </tr>
    

The important part is text="{$ParentID}" which populates the TextBox with the value of the parameter.

share|improve this answer
    
The only lack of this method is that the attachments are not working –  Steve B Jun 6 '11 at 12:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.