Noob Question regarding jPoint and Lists

Mar 10, 2010 at 3:19 PM

hi all

this is a (very) beginner question.  I am just starting to examine how to implement jQuery into my SharePoint sites and am a bit lost as to where typical SP objects should end and where jQuery should begin.

I have a requirment to build what would amount to a small events list that will contain a paged list of 5 events on a web page.  The events will take some basic info:  Title, Location, Date and Time, Description, and the CreatedBy field included in any custom list.  The requirment for this list is to auto page change after a certain time (or scroll items individually if at all possible) and it would also be nice to be able to add some other functionality like perhaps having a row expand to show more information when clicked on or highlite colours on mouse over, etc.  

My question is - can i use something like jPoint to create this? and if so how do i access the list and present the data.  Is it something that should be completely created from jQuery and just pull the list data via a web service or something?  Or should i create a custom data view and modify the XSLT to create my "list" as i want it - then try to mimic the page changing event in a timer script just like as if it was clicking on the "previous" or "next" buttons.

From my noobish point of view it would seem to me that in theory i could either just grab the data and present it completely using jQuery / javascript.  OR i could build out a list using XSLT and hook jquery into various elements of the list to manipulate it.

What's the best way i should approach this?  Or the first thing i should try?

thanks in advance,

 

Coordinator
Mar 10, 2010 at 4:58 PM

There is probably more then one way to do this, but you can definitely complete your task with jPoint.

You can think of jPoint as data layer in this case. 

Then when you have data from SP list pulled using jPoint you can use jQuery to present data to users.

We have done several things by using jQuery plugins (many of them out there for table representation) on top of jPoint.

You can display for example title and data in table and add "details" link to the row.

If user clicks on "details" link you can use jPoint to pull data from selected list on that particular row list ID (so initially you don't need to bring entire splist back on page render).

Check following

jP.Lists.getList(SiteURL, ListName) //Here you set your site and list both strings

jP.Lists["ListName"].getSPItemsWithQuery(CamlQuery, rowLimit) //here you call caml query to that list , if rowLimit is not passed in it returns all rows

jP..Lists["ListName"].getSPItem(ListItemID) //This can be used for details link since ListItemID can be retrieved from getSPItemsWithQuery on page load.

Hope this helps.

Mar 10, 2010 at 5:25 PM

thanks so much for this info.

 couple more noob questions.

The site i will be doing this on is a fairly major corporate intranet that is very locked down.   I have site collection admin rights and can do most anything i need to regarding "power usage" stuff (design and customization with SP Designer) but CodeBehind is a no go!  I was reading in the doc for jPoint about how it accesses list data via a web service.  I am fairly certain all web services are disabled in this environment.  Will that prevent jPoint acting as the DL in this case?

Or is it enough to just have a list with all your data on the page (think DVWP) and then call this jp.getList?  I guess what i am asking is does the getList function just get data from a list already on a page?  or does it use the list.asmx web service to get the data?   If the former is true - is there any other workaround you can think of that maybe is more DVWP and less Data Layer js?

thanks again its really helpful and once i get it done i would be glad to contribute an example or something.

Coordinator
Mar 10, 2010 at 5:42 PM

That is a fair question.

Since jPoint is not server side code, you do not need access to server like you would if you were to develop custom .NET webparts for example.

Webservices are not locked and are exposed to any internal SharePoint page.

Webservices also follow SharePoint security rules for access rights.

We had already lots of people in your situation and were able to use jPoint as their only way of getting around restrictions.

For starters make sure you extract jPoint.zip and download it into a site library (it can be Shared Documents or if you have some common /code folder under SharePoint even better)

Follow install procedures and linking to jQuery and jPoint as described on "home" page.

Get firefox plugin called firebug for debugging!

Give it a go.

Mar 10, 2010 at 5:48 PM
Ouch. The experts will reply for sure but would webservices be locked
down for approved users? You can test it simply enough with jPoint
either way. Worse case scenario you can use jQuery to trigger the
"click" on pagination on a DVWP.

http://api.jquery.com/trigger/

and there are ways to do timing with jQuery as well:

http://stackoverflow.com/questions/2208626/jquery-timed-event

http://plugins.jquery.com/project/timers

Of course you still have to find your pagination link to trigger.

Ah samirsijercic beat me to it. :P Firebug (or IE8's developer tools,
though I prefer Firebug) is essential to helping figure out what you
need to access and testing. I also use CharlesProxy
<http://www.charlesproxy.com/> to view and debug web service calls
My *limited* experience says that building the list by dropping it on
the page with a DVWP is easier than using jPoint just because you can do
that instantly with filtering, etc. But if you want nice interaction
with that list then jPoint/jQuery are the way to go. With jPoint you
will have to do error checking before rendering out stuff to make sure
you have data unless there is ALWAYS something that will be returned.
That isn't a limitation of jPoint, just working with web services in
general. The DVWP handles that for you on the page.

Michael

mcmcom wrote:
>
> From: mcmcom
>
> thanks so much for this info.
>
> couple more noob questions.
>
> The site i will be doing this on is a fairly major corporate intranet
> that is very locked down. I have site collection admin rights and
> can do most anything i need to regarding "power usage" stuff (design
> and customization with SP Designer) but CodeBehind is a no go! I was
> reading in the doc for jPoint about how it accesses list data via a
> web service. I am fairly certain all web services are disabled in
> this environment. Will that prevent jPoint acting as the DL in this case?
>
> Or is it enough to just have a list with all your data on the page
> (think DVWP) and then call this jp.getList? I guess what i am asking
> is does the getList function just get data from a list already on a
> page? or does it use the list.asmx web service to get the data? If
> the former is true - is there any other workaround you can think of
> that maybe is more DVWP and less Data Layer js?
>
> thanks again its really helpful and once i get it done i would be glad
> to contribute an example or something.
>
> Read the full discussion online
> <http://jpoint.codeplex.com/Thread/View.aspx?ThreadId=204462&ANCHOR#Post416483>.
>
> To add a post to this discussion, reply to this email
> ([email removed]
> <mailto:[email removed]?subject=%5BjPoint:204462%5D>)
>
> To start a new discussion for this project, email
> [email removed] <mailto:[email removed]>
>
> You are receiving this email because you subscribed to this discussion
> on CodePlex. You can unsubscribe or change your settings
> <https://jpoint.codeplex.com/subscriptions/thread/project/edit> on
> codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any
> posts to this discussion will also be available online at codeplex.com
>
Mar 10, 2010 at 5:54 PM

Hey Guys,

thanks both for the posts.  Perhaps i am mistaken and this web service is accessible. I will try both options (the trigger too) Actually the trigger thign was what i started doing last night.  I managed to use XSL variables in some named divs to get the necessary NextPage data and all that.  Just didn't know how to trigger the page change.   After reading these threads i am starting to think that it will be able to implement one of the two proposed ideas.  I will update this thread once i get a proof of concept done.  

thanks for the info on firebug and IE 8 dev.  Since i am a .NET dev i do use the IE 8 dev tools extensively as well as firebug.  They are essentials when working with this type of thing.

thanks again guys.

 

Coordinator
Mar 10, 2010 at 5:55 PM

Michael is right,

You can go either way, but you will need jQuery in both ways.

BTW firebug has request/response information from webservices under Console tab.

Mar 10, 2010 at 6:37 PM
Yeah I like CharlesProxy because of how it parses and displays and logs
all the interactions. The drill-down in CharlesProxy has been better for
me to use than the one in Firebug and it wa a big help for me especially
when I started learning.

For anyone new to firebug who reads this, just remember to enable the
request viewing by selecting "Show XmlHttpRequests" by clicking on the
console dropdown arrow and choosing it in the dropdown list.

Michael

samirsijercic wrote:
>
> From: samirsijercic
>
> Michael is right,
>
> You can go either way, but you will need jQuery in both ways.
>
> BTW firebug has request/response information from webservices under
> Console tab.
>
> Read the full discussion online
> <http://jpoint.codeplex.com/Thread/View.aspx?ThreadId=204462&ANCHOR#Post416492>.
>
> To add a post to this discussion, reply to this email
> ([email removed]
> <mailto:[email removed]?subject=%5BjPoint:204462%5D>)
>
> To start a new discussion for this project, email
> [email removed] <mailto:[email removed]>
>
> You are receiving this email because you subscribed to this discussion
> on CodePlex. You can unsubscribe or change your settings
> <https://jpoint.codeplex.com/subscriptions/thread/project/edit> on
> codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any
> posts to this discussion will also be available online at codeplex.com
>
Mar 10, 2010 at 8:03 PM

thanks guys.

managed to cobble together two simple examples.  One using the jP.List["blah"] stuff to act as a DL and the other with timers and triggers to force clicks on an already existing DVWP.

Pretty cool stuff.  as a proof of concept goes it seems reasonable.  I think i will push for the all jQuery + jP way as i would like to have it as visually interesting as possible and prevent any postbacks

thanks for the help ill provide a complete overview once i actually do something nice looking