The MOSS Show SharePoint Podcast: Episode 87 – Talking JavaScript with Marc Anderson

The MOSS ShowBack in late January, I sat down – in the virtual sense, as usual – with Hilton Giesenow (@hiltongiesenow or the slightly more active @TheMossShow) to have a chat about JavaScript for his MOSS Show SharePoint Podcast. At the time, we were in the throes of trying to figure out what had happened on Office365 with some breaking DOM changes. Breaking for us JavaScript folks, anyway. We covered a number of topics like improving the user experience in SharePoint, what’s been going on with JavaScript over the years in the SharePoint community, and more.

From Hilton’s intro to Episode 87 – Talking JavaScript with Marc Anderson:

The entire web development world seems to have had a love-hate-love-hate relationship with JavaScript over the many years of its existence, and it’s no different in the SharePoint world, albeit a few years behind in many cases. In this episode we speak with many-year industry veteran and long time SharePointer Marc Anderson about his experiences with JavaScript and SharePoint over the years, his wildly successful SPServices library, Single-Page Applications (SPAs) and lots more.

Head on over to Episode 87 – Talking JavaScript with Marc Anderson and have a listen.

2014-03-18_22-53-36

SharePoint Conference 2014 (#SPC14) Wrap Up

SharePoint Conference 2014; connect, reimagine, transform

Wow. Whew. The 2014 episode of the Microsoft SharePoint Conference aka #SPC14 is a wrap. What an amazing experience.

It seems obligatory for anyone who has more than two eyeballs on their blog to do a wrap up post after a conference like this, and I didn’t want to be the exception. So here you go…

This was what used to be called a “non-release” year. That meant that there wasn’t a new, three-year epic release coming out with the attendant marketing push from Microsoft. Now that we are living in the bold new world of Office365 with its nearly weekly updates, there’s really no such thing as a “release year” anymore. Sure, we’ve been promised a new on premises release in 2015, but odds are that it will contain the incremental improvements that we’ve been seeing on Office365 – as we recently saw with the Service Pack 1 release – and some shiny new things, but the SharePoint Product Group is all about continuous improvement now. There will still be splashes, but they won’t be as big. (Joel Oleson (@joeloleson) did a post a while back that explains how this all is going to work in great detail, if you’d like to understand more about it.)

image The keynote was a big one. Former US President Bill Clinton was the featured speaker. While he didn’t wow me with his messages, it was impressive (and no doubt expensive) for Microsoft to have him speak. From the Microsoft angle we heard from Jared Spatero (@jared_spatero – the emcee of sorts), Jeff Teper (@jeffteper), Julia White (@julwhite), Arpan Shah (@arpanshah), and Michal Gideoni.

While there were fewer “big splash” announcements, the things that were announced may prove to be impressive enhancements to the SharePoint platform once they are ready for prime time.

One big theme I was happy to see throughout the developer-focused sessions: embracing JavaScript. It’s wonderful to see the community embracing JavaScript as never before. What a difference a little time passing makes. Just a few years ago, my forays into the JavaScript world with SPServices and other methods were considered child’s play. Now many of those same naysayers have embraced the technology and new, highly useful development patterns for SharePoint pop up all the time. (Props specifically to Scot Hillier (@scothillier)here. I’ll go to one of his sessions every time I have the opportunity.)

Perhaps this change of heart is due to the splendid frameworks which have been evolving over the last few years. This isn’t your father’s JavaScript. Development approaches are evolving rapidly, with frameworks rising and falling in popularity.

Perhaps the most important session I attended from a strategic standpoint was SPC348 – Update on InfoPath and SharePoint Forms. Greg Lindhorst from the Access team and Sonya Koptyev – my new pal on the Product Group team; bless her if she’s been assigned to keep me in line – led the session.The content was extremely important to many of us in the SharePoint community. However, how the session was set up and went is even more important. Rather than simply demoing something shiny with a high wow factor and leaving it at that, the session was truly interactive.

There was an acknowledgement that progress isn’t always easy. I loved the up-front quote from Charles Kettering:

2014-03-09 19-23 page #0Greg and Sonya showed us a real timeline, with rough dates and planned enhancements.

Streamlined technical product roadmap

Streamlined technical product roadmap

As you can see, there are four planned areas of focus:

  • Excel Surveys
  • List Forms (FoSL, or Forms on SharePoint Lists)
  • Structured Documents – Maybe this will be where Word plays a role
  • App Forms – aka Access Services

Note the timeframes in the slide. (Is this really Microsoft talking?) They aren’t carved in stone, but they ought to be directionally correct. Behind those timelines, though, was a true request for all of us to participate in the journey. The Product Group doesn’t always have all the answers, and they are saying that out loud now. They want our feedback and wish list items and have set up a new User Voice to capture them at

http://officeforms.uservoice.com

Don’t think this is just some exercise to placate us by letting us make suggestions we’ll never see. The User Voice platform is already driving enhancements making it into Office365 and seems to be the main feedback mechanisms where you can make your needs known.

The reason I think that SPC348 – Update on InfoPath and SharePoint Forms was so important wasn’t about the content. It was about *how* the content was presented. To me, this is the Microsoft I’ve been trying to find: open, honest, and wanting to collaborate to attain a higher goal. That’s what I always wanted to do when I became an MVP, and it looks like they are finally catching up to me. I’m going to be all over Sonya if this Great New Attitude flags. I’ve warned her. (For an excellent, detailed write up on this session, see Nik Patel’s (@nikxpatel) post Future of InfoPath – SPC14 Notes from Office and SharePoint Forms Roadmap Update.)

Oh, and the conference was in Las Vegas, so there was some shenanigans. I managed to come out reasonably unscathed on the gambling front – merely a flesh wound! – and the parties were tadifa. From the opening attendee reception to Club SPC to the Attendee Party at the Las Vegas Motor Speeedway, there was no lack of ways for attendees to entertain themselves. Of course, this is the biggest SharePoint conference in the world (at least so far) and it’s the only time so many of us in the community manage to get together to cause trouble. This was social business at its finest.

I’m including a few of the photos I took during the conference in the slideshow below. Enjoy!

Announcing the Top 25 SharePoint Influencers for 2014

HomeLast Wednesday at the Microsoft SharePoint Conference in Las Vegas – in a clear lapse of judgment – harmon.ie named me the seventh most influential SharePoint person for 2014. Read more in Announcing the Top 25 SharePoint Influencers for 2014 on the harmon.ie blog.

I’m honored and humbled to be recognized as even in the same league as the other 24 people on the list. They are some of the smartest and most dedicated people in the SharePoint community. I hardly belong there with them. Thanks to harmon.ie for the recognition. Thanks also to anyone out there who finds my musings and activities useful and voted for me for this honor.

The Top 10

  • Andrew Connell, Co-Founder, Co-Host, Microsoft Cloud Show (@andrewconnell).
  • Joel Oleson, Global Collaboration Evangelist, Community Builder and Strategist (@joeloleson).
  • Todd Klindt, SharePoint Consultant, Rackspace Hosting (@toddklindt).
  • Christian Buckley, Chief Evangelist, Metalogix (@buckleyplanet).
  • Laura Rogers, Senior SharePoint Consultant, Rackspace Hosting (@WonderLaura).
  • Jeremy Thake, VP of Global Product Innovation, AvePoint Inc. (@jthake).
  • Marc D. Anderson, Management and Technology Consultant, Sympraxis Consulting LLC (@sympmarc).
  • Dux Raymond Sy, VP of Customer Strategy & Solutions, AvePoint Public Sector (@meetdux).
  • Jeff Willinger, Director of Collaboration, Social Business and Intranets, Rightpoint, World-wide SharePoint Speaker and Evangelist (@jwillie).
  • Spencer Harbar, Managing Director, Triumph Media Limited, Enterprise Architect, Microsoft (@harbars)

As a service to the business community, harmon.ie has commissioned the third annual ranking of the “Top 25 SharePoint Influencers.”  Prominent industry analyst Dana Gartner and Scratch Marketing + Media were tapped to identify those leaders who are helping others navigate the SharePoint/Yammer platform. Based on a finalist list of top 100 SharePoint professionals, a weighted formula was used to identify the top 25 U.S. SharePoint influencers. Selection was based on: each professional’s SharePoint knowledge and business impact; digital and social presence and influence; blog reach and frequency; depth of SharePoint topic coverage; citations by other influential bloggers; and more than 3,000 qualified community votes.

Microsoft Cloud Show Episode 016 – Interview with Marc Anderson on Recent Changes Impacting Customers on Office 365

MSCloudShow

Microsoft Cloud Show

A few weeks back, I sat down (virtually, of course) with Andrew Connell (@AndrewConnell) and Chris Johnson (@LoungeFlyZ) to record an episode of the Microsoft Cloud Show. Andrew was in Florida, I was in Boston, and Chris was way around the world in New Zealand. Ah, the wonders of modern technology.

The only place to stay up to date on everything going on in the Microsoft cloud world including Azure and Office 365.

Whether you are new to the cloud, old hat or just starting to consider what the cloud can do for you this podshow is the place to find all the latest and greatest news and information on what’s going on in the cloud universe.  Join long time Microsoft aficionados and SharePoint experts Andrew Connell and Chris Johnson as they dissect the noise and distill it down, read between the lines and offer expert opinion on what is really going on.  Just the information … no marketing … no BS, just two dudes telling you how they see it.

I was honored to be the very first guest on the show, which already had 15 excellent episodes in the can.

In Episode 016 – Interview with Marc Anderson on Recent Changes Impacting Customers on Office 365, we talked about a number of extremely important things that have been going on with Office365 lately.

I had done a post about one issue that has caused me and users of SPServices the most consternation, Office 365 Update Changes ‘Display Name’ on Required Fields and Andrew had posted about a few others one his blog in Office 365 Needs to Treat the UX as an API if Our Customizations are to Stay Off the Server.

Last week, I released SPServices 2014.01, which addresses the title changes (adding ” Required Field” to the title attribute of some required dropdowns), but there’s a bigger set of issues at play here, as Andrew alludes to in his post.

In the podcast, we talked about the impact of these changes as well as the mindset behind them from the Microsoft side.

If you do any client side development with SharePoint – and that’s where everyone is headed – you owe it to yourself to listen to the podcast. You’ll understand more about what changes to the DOM might mean for you as a developer, or even what might happen to you as a user of customizations that rely on the DOM being stable and predictable.

One things seems certain: we’ll see more changes like the ones we discussed in the podcast and they will have an impact on everyone, not just people replying on Office365. (The same issues started to crop up for people who have applied the December 2013 Cumulative Update (CU) for SharePoint 2010 on premises.)

I want to thank Chris and Andrew for inviting me in for a chat. Assuming I didn’t annoy them too much with my scatological terminology, maybe I’ll be able to visit with them again the next time a round of changes like this pop up and cause ripples in the SharePoint time-space continuum.

KnockoutJS with SharePoint: Fixing ‘Error: You cannot apply bindings multiple times to the same element.’

KnockoutJS LogoI’ve been using KnockoutJS to build functionality into SharePoint pages for a while now. (In case you’ve ever wondered, yes, it’s the same thing people mean when they simply say “Knockout” or “KO”.)

Setting everything up with KnockoutJS can take a bit longer than hard-wiring things with jQuery – depending on what you are trying to accomplish and what your background may be – but once it’s all in place, changes to functionality become much easier. Some people naturally think in the Model-View-View Model (MVVM) pattern, but it took some time for me to get my head around the idea. Early on it felt like not just a separation of church and state, but also separation of the apse from the nave and Arkansas from middle, lower Arkansas.

I’ve probably run into every newbie error in the book, and this one has gotten me multiple times.

Error: You cannot apply bindings multiple times to the same element.

Error: You cannot apply bindings multiple times to the same element.

The screen snippet above is from my favorite debugger, Firebug. The error message itself doesn’t give you much to go on. It makes basic sense, since multiple bindings on the same element would seem to be a bad idea, but it doesn’t tell you anything about why it’s happening or what you’ve done to trigger the error. It just kills the page load.

Let’s take a simple example. In one of the sets of pages I’m working on, we want to have a header section driven by one view model and a body section driven by another. The two bindings are in separate .js files because the header logic is reused across pages, while the body section is unique to individual pages. (We’re using SharePoint 2010 more as a back-end repository and identity management provider in this application and replacing virtually all the UI with custom pages.) Each of the .js files performs the binding for which it is responsible.

The markup – at a high level – looks something like this:

<div id="abc-page-header">
...
</div>
<div id="abc-page-body">
...
</div>

and the bindings occur in the JavaScript looking something like this:

ko.applyBindings(new HeaderViewModel(), document.getElementById("abc-page-header"));
...
ko.applyBindings(new BodyViewModel(), document.getElementById("abc-page-body"));

As you can see, each binding is scoped to the container for which it has responsibility. Using document.getElementById is straighforward: we should get a JavaScript object reference to the containing element with that id.

All well and good, right? The problem in this case comes in when you have no second argument, or even worse, a typo in the id. For instance, I ran myself silly with document.getElementById("ab-page-body"). Because the document.getElementById function returned null (the id wasn’t in the page), the binding occurred on the entire document, and therein arises the problem. Elements with data-bind now become bound twice, throwing the error.

It would be much better if the error told us a little more about what was happening, of course. For instance, the error might mention which binding is currently applied to the particular element where the issue arises. Even better would be some sort of warning when you attempt to apply bindings with a null parameter. Alas, this is not the case.

The simple fix is to find the place in your code where a ko.applyBindings is applied incorrectly. It’s not so hard if you know that’s the right thing to do. If you don’t, you may end up tearing down your code and starting afresh, which is rarely productive.

See Creating view models with observables for the [rather sparse] documentation on ko.applyBindings. Note that the second parameter must be a JavaScript DOM node, not a jQuery object. If you try to get fancy like this:

ko.applyBindings(new HeaderViewModel(), $("#abc-page-header"));

You’ll get a very clear error:

rror: ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node

Error: ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node

Moral of the story: always scope your bindings carefully!