How to change a webpart list view to another list view when a custom button is clicked on a wiki page? - sharepoint

I created a list and setup 3 views using "filters" in Sharepoint 2010. On the main wiki page, I created a custom dataview that brought the list into a wiki page and the view was the default view. I have created 3 img buttons and placed them into the datalistview just above the columns in the list so on the wiki page you see the 3 img btns (new, updated, contacts) then the default list view.
What I can't seem to get working (I am not a programmer) is when one of the buttons are clicked, I need the webpart to show the related list view to show on the wiki page, in the webpart. So if I clicked on "New" button, the "new" list view replaces the default view in the webpart. hope this makes sense....
I have been searching for days trying various code that references iframes, and even on this site looked at button click change view questions but none have actually addressed this item that I could tell. Any help would be wonderful!

Related

SharePoint 2013 people picker for publishing contact

I've created my custom page layout with custom content type (but derived from the content type page) on SharePoint 2013 in a publishing website. I have several field controls placed on the page layout (Title, some custom taxonomy fields, etc.) so I can change them directly in edit mode of the page. That works perfectly fine.
But there is the field "PublishingContact" (standard people field which comes with the content type of the article page) which can be set on the editform.aspx with the autocompletion control. I lost in placing this control on the page layout like i did with the others.
I've tried the classic "UserField" control, but this has no autocompletion. I've tried the ClientPeoplePicker but this control has no Property to map it to the corresponding field.
So has anyone an idea how to place the control of the editform on my page layout so I have the same functionality as on the editform, but on my page layout?
Thanks in advance!

List Search Box getting hidden in SharePoint 2013 List View WebPart

I am trying to add a list view webpart to my page in sharepoint 2013. I edited the webpart and checked 'Display Search Box' option in the miscellaneous section. But Once I finish editing and save the page, page refreshes and loads. But the search box is not coming at all.
I had a similar problem which occurred since I modified the styles inside the list view.
A few questions...
Have you modified the styles inside the view that webpart is using.
Is the list a new one or migrated?
Is this a Publishing site site or other?
You are using enterprise version or other?
Ensure you are using the Default style , any other style the search box does not appear

Hide / Remove Content Search Webpart when no results returned SharePoint 2013

I'm looking to find a way to hide the whole Content Search webpart (including the webpart title and border area) if there are no results coming back from the query.
What I tried
There is this property: "ShouldHideControlWhenEmpty" but it doesn't do anything when there are no results. The webpart is still visible. Webpart has a the Title and the Border around it so when there are no results the title and the border show up with no results. Like I said I want to hide the whole thing in that case.
Wrote a jQuery script that searches for the text "There are no results" message (which comes from the webpart when there are no results) and hides the webpart. However, there is a short flicker once the page loads because the webpart first gets rendered for a split second and then disappears by virtue of my jQuery script - which is not great UI experience.
So I thought I could extend the OOTB ContentBySearchWebPart and get a hold of some kind property that would get me the result count. If the results count is 0 simply I would hide the webpart server side. I looked at the documentation online - nothing I could find that I could leverage.
Help? Thanks!
The option 2 using jquery would be fine, but just flip the approach you are doing now. Instead of hiding the webpart if its empty , make the webpart hidden by default, and visible only when content is available. Here is the approach.
Add a Content Editor / Script Editor webpart with CSS code that hides(remember just mark display none / visible false, dont remove) the Content Search Webpart by default. Place the styling code above the Content search webpart to ensure when the page loads the Content search Webpart is not visible.
During pageload check if the Content search webpart contains result , if the webpart contains result , then make the webpart visible. Here you will search for the text "There are no results" message, if its present you do nothing , else you make the webpart visible as it means there are search results available.
This way you will eliminate the Flicking problem with the current approach.

Need some guidance around creating a custom page to display different views for a SharePoint List.

I'm familiar with SharePoint but would like some guidance on developing a custom page.
I have 1 list and have created 3 different views.
On my Page, I have added a webpart to show the list.
I'd like to be able to add some form items - possibly radio buttons/ a picker/ or just text links at the top that would allow the user to switch views on the list below.
I'd like to add some other information and make the experience more intuitive for the user.
In short, is there a way to add a list web part and some options to choose the view of that list in another section of the page?
Sure, just do something like this
var dview = MyList.Views["YourViewTitle"];
dview.DefaultView = true;
dview.Update();
MyList.Update();
Each view has its own URL so you just need to use some HTML and JavaScript. When a box is checked or a button is clicked then you can load the URL of the view.

View Page (DispForm.aspx) not associated properly for SharePoint list views

I've customized NewForm, EditForm and DispForm to allow users to create new, edit (with certain permission) and display service requests.
The forms work fine except in my views (e.g. Createbyme.aspx which shows all requests owned by me). Instead of pointing to my custom DispForm /[site]/Lists/[list_name]/DispForm_custom.aspx?ID=[request#], it links to /[site]/?ID=[request#].
Is there any suggestion for a fix?
I just answered this question in another post...
Restore NewForm.aspx file
To summarize,
Open the page and select the form control. Oen the propertis for that control and select the radio button "NEW ITEM FORM". After you save the page you can then select the page as a supporting file for the list and the setting will stick. Do not select the page as a supporting file first as the setting will not stick... ergo the order of your steps is important.

Resources