dinsdag 5 april 2011

problemen met toevoegen van list items via web services

Situatie: een lijst "Uitleningen" met daarin o.a.:
- Opmerkingen: een tekstveld, dat eerst "Title" was.
- Materiaal: verwijzing naar lijst "materiaal", keuzeveld
- Campussen: interne lijst
Bij deze kolommen was er een probleem als ik een lijstitem wou toevoegen.
Bij Opmerkingen was de interne naam "Title", en bij Campussen "Campus2".
Bij Materiaal moest de ID worden doorgegeven,
aangezien het om een lijstje ging!
Dit is dan opgelost door het materiaal te laden in een listbox, en daarvan dan de selected id te gebruiken,
aangezien ze in de zelfde volgorde in de listbox komen te staan :)

Voorts kwam ik nog iets belangrijk tegen:
de "verantwoordelijke" wordt sowieso de naam die op voorhand ingegeven wordt in de code,
in dit geval een default gebruiker.
Deze staat ook zo op het contract dan,
maar vanaf dat de verantwoordelijke de status van de uitlening van "gereserveerd" naar "uitgeleend" verandert, verandert dit gegeven in de naam van degene die het aanpast, dus deze wordt dan verantwoordelijke. Opgelost!

Nog een probleem:
bij het genereren van het contract,
komt er op de plaats van waar normaal gezien het materiaal moet staan het id van het materiaal!
En ik kan niet aan de campussen, omdat deze een interne lijst is in het systeem.
Deze problemen heb ik opgelost door 2 extra lijsten te maken,
eentje voor het materiaal, en eentje voor de campussen (allebei tekstvakken),
en daarin wordt de naam van de campus en het materiaal in opgeslagen,
zodat deze ook correct op het document verschijnen.

Filtering a column while typing

I had the problem that I wanted to filter a column while the filter was being typed in a textbox

animation

This image is a copy from: JVossers codeplex page

How to use this:

Download txt, js or wsp file from codeplex. Instal options are written at the bottem of the page.


When you want to use the Content Editor Web Part, you have to paste the code from the txt file in the source editor and NOT in the RTF editor

vrijdag 1 april 2011

Verbonden lijsten

Hoe kan je 2 lijsten maken, waarbij de ene lijst afhangt van de selectie van een andere lijst?
En dat dan nog zonder code?
Met sharepoint!
Gewoon de 2 lijsten maken, de ene dan verbinden met de andere lijst,
de juiste kolom aanwijzen waar de andere lijst van afhankelijk moet zijn,
en klaar is kees!

How to deploy a custom web part in SharePoint 2007

Build you created web part in VS2008. Using Windows Explorer you go to you Debug  or Release map from your project:

… \Documents\Visual Studio 2008\Projects\TestSPWebPart\TestSPWebPart\bin\Debug\

Afterwards you copy the .dll file to the bin map from you SharePoint server (C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin\)

Now you have to open the web.config file (location: C:\inetpub\wwwroot\wss\VirtualDirectories\80\), in that file you have to enter a SafeControl in the correct format,

<SafeControl Assembly="<Assembly name>" Namespace="<namespace of the assembly>" TypeName="*" Safe="True" AllowRemoteDesigner="True"/>

For instance:
<SafeControl Assembly="TestSPWebPart" Namespace="TestSPWebPart" TypeName="*" Safe="True" AllowRemoteDesigner="True"/>

When you have don that you open the root page of your SharePoint site, this is also accessible using localhost. When Internet Explorer opens the page you go to the Site-Actions in the upper right of the corner and open all the Site Settings – afterwards you choose for Web Part under Galleries.

image

There you choose “New”, normally on the bottom of that list you will find your web part, then after you have selected the web part you go back to the top and click “Populate Gallery”.

 

imageimage

After you have populated your gallery of web parts, you can use the web part in a all pages, even in other sites.

maandag 28 maart 2011

Using CAML Query with JQuery

When you want to have a filtered lookup with your CascadeDropdowns or other from JQuery, you can use the CAML Query. With this query you can “tell” the list dropdown list what items it has to contain.

A very useful program to create CAML Query is U2U CAML Query Builder

Naamloos

For instance (personal usage):

I wanted that my dropdown list only contained who where available for loan, my products needed to be filtered by what type they are part of, so I used the Cascade Dropdown service from JQuery.

My code that realizes my needs:

These following script tags  pinpoint to the 2 files that enables the JQuery usage

<script type="text/javascript" language="javascript" src="../../../JQuery Library/jquery-1.5.1.js"></script>
<script type="text/javascript" language="javascript" src="../../../JQuery Library/jquery.SPServices-0.6.0.js"></script>

The following script bloc is the code that I’ve placed in my newItem.aspx

<script type="text/javascript" language="javascript">

$().SPServices.SPCascadeDropdowns({
                relationshipList:"Toestellen",
                relationshipListParentColumn:"Toesteltyp",
                relationshipListChildColumn:"Title",
                parentColumn:"Type toestel",
                childColumn:"Toestelnaam",
                CAMLQuery:"<Eq><FieldRef Name='Status' /><Value Type='Choice'>Beschikbaar</Value></Eq>",
                promptText:"Kies een {0}",
                debug:true
            });

</script>

zondag 27 maart 2011

Developing for Microsoft Office SharePoint Server 2007 (64-bit)

After I’ve installed  the SharePoint server 2007 64-bit and Visual Studio 2008. I’ve tried to create a Web part. But no options were available in VS2008 for SharePoint server 2007 64-bit. Afterwards I’ve, alongside VS2008, I’ve installed VS2010. But there it was possible to create something for SharePoint Server 2007 32-bit, not for the 64-bit version.

When you tried to create a Web part for instance you get following error:

fout visual studio

After checking out the internet for this problem, I found on msdn from Microsoft and on the msdn blog. That it was impossible to create a part for SharePoint Server 2007 64-bit. My boss then found a installer on the Kamp’s Blog. But after installing it didn’t work.

Our final solution was to reinstall Windows Server 2008 and SharePoint Server 2007 but everything in 32-bit modus.