I have deployed SharePoint hosted app on SharePoint Online server. I have a custom page that shows list view of my custom list, that is stored on app web. List view is created using "XsltListViewWebPart" and added to my aspx app page.
Here is the list view web part code:
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<div id="listUsers" class="listView">
<WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="WebPartZone1">
<WebPartPages:XsltListViewWebPart ID="UsersListWebPart_AppWeb"
runat="server" ListUrl="Lists/Users" IsIncluded="True"
NoDefaultStyle="TRUE" Title="Users" PageType="PAGE_NORMALVIEW"
Default="False" ViewContentTypeId="0x">
</WebPartPages:XsltListViewWebPart>
</WebPartPages:WebPartZone>
</div>
</asp:Content>
The problem is that the list is never deployed correctly on server. It's always read-only, and it does not have any additional options to search add or edit items:
However, I've managed to find a solution when running in debug mode. I open the web part contents management page by adding "?Contents=1" to the URL of the current page. I delete there this web part. Because I'm still running in debug mode, I do some change in my aspx page in Visual Studio, like adding a space character. When saved, page changes are automatically deployed to the server, and web part shows up correctly:
The problem is that I can do this only in debugging mode. When I pack the solution and deploy it manually to the server, there's no way I can to this workaround.
Any ideas why this happens and what could be alternative solution? Thanks!
The only solution I've found is to re-create custom list in Visual Studio. It should work after that.