1

all!

I have a problem with custom new/edit form. In my listTemplate I set:

<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" >
        <WebParts>
          <AllUsersWebPart WebPartZoneID="Main" WebPartOrder="1">
            <![CDATA[
              <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
              <Assembly>Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>                        
              <TypeName>Microsoft.SharePoint.WebPartPages.ListFormWebPart</TypeName>
              <PageType>PAGE_NEWFORM</PageType>
              <CSRRenderMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">ServerRender</CSRRenderMode>
              </WebPart>
             ]]>
          </AllUsersWebPart>
        </WebParts>
      </Form>

Because in other way custom validations(C# code) for field didnt work. But if it like this rendering template for new/edit form contains two web parts (I see it in SPDesigner) and as a result two toolbars(top and bottom).

Why this happen? And how fix it?

P.S. if I delete property ServerRender - new/edit form is ok, but validation didnt work.

0

I found solution. The problem was on one attribure called UseDefaultListFormWebPart="False".

For correct work - need to use this:

  <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" UseDefaultListFormWebPart="False">
    <WebParts>
      <AllUsersWebPart WebPartZoneID="Main" WebPartOrder="1">
        <![CDATA[
          <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
          <Assembly>Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>                        
          <TypeName>Microsoft.SharePoint.WebPartPages.ListFormWebPart</TypeName>
          <PageType>PAGE_NEWFORM</PageType>
          <CSRRenderMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">ServerRender</CSRRenderMode>
          </WebPart>
         ]]>
      </AllUsersWebPart>
    </WebParts>
  </Form>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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