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

Probably something simple but i'm not sure what the problem is here. I create several custom list views in my schema.xml for my list. I deploy and go in sharepoint designer to make sure everything is ok. I click on the list i created but only the FIRST view in from schema.xml is listed in the Views table. Why are the other two not showing up? If i delete the first list the next appears. I want all three to be shown in the Views table. here is the portion of schema.xml

  <View BaseViewID="1" Type="HTML" Hidden="FALSE" WebPartZoneID="Main" DisplayName="Management Users" OrderedView="TRUE" DefaultView="TRUE"  MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">10</RowLimit>
    <ViewFields>
      <FieldRef Name="Photo"></FieldRef>
      <FieldRef Name="Position"></FieldRef>
      <FieldRef Name="LastName"></FieldRef>
      <FieldRef Name="FirstName"></FieldRef>
      <FieldRef Name="Email"></FieldRef>
      <FieldRef Name="PhoneNumber"></FieldRef>
      <FieldRef Name="Info"></FieldRef>
    </ViewFields>
    <Query>
      <Where>
        <Eq>
          <FieldRef Name="Group"/>
          <Value Type="Choice">Management</Value>
        </Eq>
      </Where>
      <OrderBy>
        <FieldRef Name="LastName" Ascending="TRUE"></FieldRef>
      </OrderBy>
    </Query>
    <ParameterBindings>
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
  </View>
  <View BaseViewID="2" Type="HTML" WebPartZoneID="Main" DisplayName="PPM Users" OrderedView="TRUE" DefaultView="FALSE"  MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">10</RowLimit>
    <ViewFields>
      <FieldRef Name="Photo"></FieldRef>
      <FieldRef Name="Position"></FieldRef>
      <FieldRef Name="LastName"></FieldRef>
      <FieldRef Name="FirstName"></FieldRef>
      <FieldRef Name="Email"></FieldRef>
      <FieldRef Name="PhoneNumber"></FieldRef>
      <FieldRef Name="Info"></FieldRef>
    </ViewFields>
    <Query>
      <Where>
        <Eq>
          <FieldRef Name="Group"/>
          <Value Type="Choice">PPM</Value>
        </Eq>
      </Where>
      <OrderBy>
        <FieldRef Name="LastName" Ascending="TRUE"></FieldRef>
      </OrderBy>
    </Query>
    <ParameterBindings>
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
  </View>
  <View BaseViewID="3" Type="HTML" WebPartZoneID="Main" DisplayName="PCL Users" OrderedView="TRUE" DefaultView="FALSE"  MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">10</RowLimit>
    <ViewFields>
      <FieldRef Name="Photo"></FieldRef>
      <FieldRef Name="Position"></FieldRef>
      <FieldRef Name="LastName"></FieldRef>
      <FieldRef Name="FirstName"></FieldRef>
      <FieldRef Name="Email"></FieldRef>
      <FieldRef Name="PhoneNumber"></FieldRef>
      <FieldRef Name="Info"></FieldRef>
    </ViewFields>
    <Query>
      <Where>
        <Eq>
          <FieldRef Name="Group"/>
          <Value Type="Choice">PCL</Value>
        </Eq>
      </Where>
      <OrderBy>
        <FieldRef Name="LastName" Ascending="TRUE"></FieldRef>
      </OrderBy>
    </Query>
    <ParameterBindings>
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
  </View>
</Views>

TIA

share|improve this question

1 Answer 1

up vote 4 down vote accepted

By just looking at your XML I noticed that you defined Url="AllItems.aspx" in all of your views. So every 'new' view is overwriting last one added and you end up with only one view.

You need to set different Url attribute for each view.

share|improve this answer
    
Booyah...thank you very much :) –  MikeC Sep 5 '11 at 20:50
    
helped me lol :) –  Joseph D Surgeon Oct 9 '12 at 16:49

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.