Design Tip 4: Turn Any Field in a Dataview into a Hyperlink

May 14, 2008

Any field in a Dataview (single or multiple item view) can be converted into a hyperlink to allow users to jump to the item in detail.

In one of the web applications I have created, the main page shows a customised multiple item Dataview that allows the user to see all of the currently open tickets and the status they are in. There are columns for Ticket Number, Edit Ticket, Comment, etc.

The Ticket Number is a hyperlink field that takes the user to a customised Dispform.aspx page where they can see a read only version of the ticket details. The Edit Ticket column contains hyperlinks to a customised Editform.aspx. The Comment column has hyperlinks which take the user to a customised Newform.aspx page to enter comments (in a different list).

The one thing that all of the lists in the application have in common is the Ticket number field. The hyperlink for the Comment column looks like this:

<a href=”http..sharepointsite/lists/newform.aspx&Ticket={@Title}” OnClick=”GoToLink(this);return false;”  target=”_self”>Comment</a>

Because the hyperlink is contained within a Dataview, you can access the variables from the dataview. The system will place the “Title” field value into the URL for the ticket I am clicking on. If I click the Comment hyperlink on ticket 12, it will place a 12 in the URL. The target form uses a Query String to access the Ticket variable and the new Comment is created for that ticket.

Click here to learn about defaulting values on a new item form:

http://splittingshares.wordpress.com/2008/04/22/defaulting-a-hidden-field-on-a-form/

Entry Filed under: SharePoint Tips and Tricks. Tags: , , , .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Top Posts

Archives