Thoma Bigueres
Thoma Bigueres

Reputation: 141

Create a View for my list

I have a quick question. I have a custom list, and i wanted to create views of this lists. To do that, i've created view nodes in the of the Schema.xml of the list.

 <Views>
      <View Name="{53EB3C9C-A765-4629-A938-7B912E04083B}" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="Tous les éléments" Url="/circulationaccords/Lists/FicheAccord/AllItems.aspx"  BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/generic.png">
        <Query>
          <OrderBy>
            <FieldRef Name="ID"/>
          </OrderBy>
        </Query>
        <ViewFields>
          <FieldRef Name="Attachments"/>
          <FieldRef Name="LinkTitle"/>
        </ViewFields>
        <RowLimit Paged="TRUE">30</RowLimit>
      </View>
      <View Name="{7AB6A3F1-E8A4-49D7-9B95-BFC9DE7D52A9}" MobileView="TRUE" Type="HTML" DisplayName="ParDateDeDemande" Url="/circulationaccords/Lists/FicheAccord/ParDateDeDemande.aspx"  BaseViewID="2" ContentTypeID="0x" ImageUrl="/_layouts/images/generic.png">
        <Query>
          <GroupBy Collapse="TRUE" GroupLimit="30">
            <FieldRef Name="DateDemande"/>
          </GroupBy>
          <OrderBy>
            <FieldRef Name="DateDemande"/>
          </OrderBy>
        </Query>
        <ViewFields>
          <FieldRef Name="Attachments"/>
          <FieldRef Name="LinkTitle"/>
          <FieldRef Name="EtapeEnCours"/>
          <FieldRef Name="IdentiteFournisseur"/>
          <FieldRef Name="NomEtablissement"/>
          <FieldRef Name="NomDemandeur"/>
          <FieldRef Name="ObjetCommande"/>
          <FieldRef Name="StatutDemande"/>
          <FieldRef Name="ActeurEnCours"/>
          <FieldRef Name="DateDemande"/>
        </ViewFields>
        <RowLimit Paged="TRUE">30</RowLimit>
        <Aggregations Value="Off"/>
      </View>
    </Views>

The problem here is that views are not created, but when i go into the list parameters to see views, i see the views as model of views. I would like to directly get the views.

Does someone have any idea how this could work ?

Upvotes: 0

Views: 947

Answers (1)

Rich Bennema
Rich Bennema

Reputation: 10335

Try defining the attributes your View elements like this:

<View 
    DefaultView="TRUE"
    MobileView="TRUE"
    MobileDefaultView="TRUE"
    Type="HTML"
    DisplayName="Tous les éléments"
    Url="AllItems.aspx"
    BaseViewID="1"
    SetupPath="pages\viewpage.aspx"
    ImageUrl="/_layouts/images/generic.png">
<View 
    MobileView="TRUE"
    Type="HTML"
    DisplayName="ParDateDeDemande"
    Url="ParDateDeDemande.aspx"
    BaseViewID="2"
    SetupPath="pages\viewpage.aspx"
    ImageUrl="/_layouts/images/generic.png">

I think the absence of the SetupPath attribute and an overly specific Url attribute might be the reason your views are not displaying as expected.

Upvotes: 1

Related Questions