Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

Locale ID's explained

Thank you Mr/Ms Sharethelearning here are locale ID's are explained so you get the date showing as you would want it to be http://sharethelearning.blogspot.com/2007/05/formatflag-in-ddwrtformatdate-method.html

Sharepoint and redirects.

What I have learnt - using the source in the url is all very well but I have not found it to be universally useable SO.
If you just want to submit a form and have it wizz off to somewhere other than the all items view then you want somethig like this

<input type="button" value="Form Action" name="btnFormAction" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={your address goes here with no quotes}')}" /&gp;

However if you want the redirect to be dynamic - and of course that is what you want
then MR autosponge has the answer here

http://autosponge.spaces.live.com/blog/cns!D7F85948C20F0293!233.entry

However what this post doesn't say explicitly is what to do when you want to redirect to a child site that or to a child list so you need the ID of the item to generate the URL - here's what I used


<xsl:variable name="dvt_1_automode">0</xsl:variable>
<xsl:param name="ListItemId">


<xsl:variable name="rec"<>xsl:value-of select="@Title"></xsl:variable>
<xsl:variable name="RedirectLoc">https://blah/sites/isms/<xsl:value-of select="/dsQueryResponse/Rows/Row/@Title"></xsl:variable

or

<xsl:variable name="RedirectLoc">https://blah.com/auditrecnfollowups.aspx?recid=<xsl:value-of select="/dsQueryResponse/Rows/Row/@Title"/>%lt;/xsl:variable>


the xpath /dsquery/Rows/Row/@Title is the important bit that uniquely identifies the attribute. This cost me much swearing, the chief reason being that when the redirect url is wrong IN ANY WAY it just does nothing and gives you a 404 so the only way to test this is to have the $redirectloc redisplayed on the screen till its right.

Creating one to many relationships between Sharepoint Lists

People will say that creating two (or more lists) that are joined in sharepoint is difficult / impossible/ involves 3rd party web parts well its just not true. Admittedly its not exactly like doing it in 'normal' database, but it can be done and furthermore there are numerous ways to do it:
  1. Assuming that you have list A and list b then you could simply use a lookup. To view them is to connect the web parts. Assuming that the two lists are on the same page then you can use a radio button (and it can only be a radio button) to produce (master details views). I have to admit this a little limited but I have use it and when the details is actually a library this represents quite a lot of advantages. Users can create a list entry for each project lets say and then see all the documents related to a particular project - actually its a lot like folders.
  2. To return to classic example list M for master and list D for details - how to create a 'Detail' entry from within a Master entry. The scenario I have in mind is that the user chooses a particular company and then they want to 'add a new employer'. I've seen various options for doing this but this one worked for me- assuming that you only want to ever edit the child details and master details seperately then create a link column on the master list called something like 'add a employee' to do this you'll need to know how to create an html calculated column http://pathtosharepoint.wordpress.com/category/the-html-calculated-column/
    and into this you'll need to put a unique key from the parent column. In my case each master had a RecID which was a GUID (we were trying to port a database into sharepoint), this RecID was used to tie the two lists together, you can use this column later to do joins. This column can be of almost any type -e.g. date and time suggests itself and here is a microsoft article detailing the steps to pulling the contents from the query string - and pre-populating some part of a new item form http://blogs.msdn.com/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx . They use a similar trick to put default values into lists.
  3. To create views from multiple lists again lots of options
    http://blah.winsmarts.com/2007-10-Performing_joins_between_SharePoint_lists.aspx - though its not necessary you can just put the two lists into dataviews and attach the same querystring filter to both of them - assuming that the two lists share the same column. If you are feeling very naughty and assuming that you have to produce some sort of report of masters and details then you can create a formula column with a querystring in the url and use that to populate an iframe (make sure you create a blank master page , or it will take up too much space) . Strictly speaking this is v bad for accessibility and all sorts of other best practice, however in my case it was to produce printable reports so it didn't matter.
  4. In my case I had a siutation where the master and child lists needed to be edited together, after much swearing, because I was trying to edit two lists on the same page, which I couldn't do, the only way I found to fix this was to update the entries in the master and use workflow to copy them to them to the details list.

sharepoint and jquery - hmmm interesting

Those smarty pants at sharepointenduser have some terrific stuff about jquery

http://www.endusersharepoint.com/?cat=457

Accessibility

Take heart it can be done:

http://www.plymouthhospitals.nhs.uk/Pages/Home.aspx - check out the source - look no tables.
or if you prefer why not admire:
http://www.wise-woman.net/Pages/default.aspx

Sharepoint and accessibility - two problems first what do you have to do ? and second how are you going to do it- well it depends who you ask:

as can be seen from this very clear article http://www.21apps.com/sharepoint/sharepoint-accessibility-is-moss-2007-accessible/ its a slightly mixed up picture.

But here is a check list for the various standards that one might hope to adopt http://www.w3.org/TR/1999/WAI-WEBCONTENT-19990324/full-checklist.html

so can it be done?

well microsoft have a whole site dedicated to the proposition that you can http://msdn.microsoft.com/en-us/accessibility/default.aspx

if you want something a bit more graspable have a look at this word document giving some best practice about the subject http://go.microsoft.com/fwlink/?LinkId=121877

The Microsoft/AKS accessibility standard lives here http://aks.hisoftware.com/index.html

My fear with some of this stuff is that it is really important one adopt A STRICT attitude toward editing pages. i.e. enforced change management, though notice that neither of the sites at the top use the STRICT tag in their XHTML - this is fine for public sites. Big intranets intranets are easily messed up by the keen user with a copy of SharePoint Designer - what is a fellow to do?