Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Sun May 19, 2013 7:09 am

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Unregister Page
PostPosted: Wed May 04, 2011 11:38 am 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
Hi eric

I have created a unregister editform template in register.aspx to unregister the class. Since I have changed the Session Id column from look up fied to Number field the Javascript to Change "Title to DELETE" is malfunctioning. ie. It is changing the title item in the registeration to "DELETE" but it is changing these value based on Registration list item ID(ie. let say 1 2 3... it deletes the first item ID which is 1 and the session ID value is display from 2 digits(75) to 1,234 ) not by Session ID (the session item which suppose to be Deleted remains unchanged).

Thanks


Top
 Profile  
 
 Post subject: Re: Unregister Page
PostPosted: Wed May 04, 2011 11:50 am 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
That's the way it is supposed to work, it unregisters one user only based on the Registrations List ID value, so it knows what item to remove.

If you're looking to do a bulk unregistration based on session id, you'll need to come up with something completely different. Something with jQuery and SPServices would work, where you'd query the registrations list for items with your session ID, then loop through them, updating the title to Delete to trigger the workflow.


Top
 Profile  
 
 Post subject: Re: Unregister Page
PostPosted: Wed May 04, 2011 11:53 am 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
Sorry for not making it clear. 'm trying to delete one item at a time. But here its not actually deleting the the current item. it is deleting the previous item or whichever is older in the registeration list.


Top
 Profile  
 
 Post subject: Re: Unregister Page
PostPosted: Wed May 04, 2011 12:24 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
Now I unhide the Edit form template and what I see it it is displaying all the item in the registration list in Edit mode. How do I display only the current item?


<xsl:template name="dvt_2.body">
<xsl:param name="Rows"/>
<tr>
<td class="ms-toolbar" nowrap="">
<table>
<tr>
<td class="ms-standardheader ms-WPTitle" nowrap="" style="height: 30px"> To unregister from this class. Please click OK
</td>
<td width="99%" class="ms-toolbar" nowrap="" style="height: 30px"><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
<td class="ms-toolbar" nowrap="" style="height: 30px">
<SharePoint:SaveButton runat="server" ControlMode="Edit" id="savebutton1"/>
</td>
<td class="ms-separator" style="height: 30px"></td>
<td class="ms-toolbar" nowrap="" align="right" style="height: 30px">
<SharePoint:GoBackButton runat="server" ControlMode="Edit" id="gobackbutton1"/>
</td>
</tr>
</table>
</td>
</tr>
<xsl:for-each select="$Rows">
<xsl:call-template name="dvt_2.rowedit">
<xsl:with-param name="Pos" select="concat('_', position())" />
</xsl:call-template>

</xsl:for-each>
<tr>
<td class="ms-toolbar" nowrap="">
<table>
<tr>
<td class="ms-descriptiontext" nowrap="">
<SharePoint:CreatedModifiedInfo ControlMode="Edit" runat="server"/>
</td>
<td width="99%" class="ms-toolbar" nowrap=""><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
<td class="ms-toolbar" nowrap="">
<SharePoint:SaveButton runat="server" ControlMode="Edit" id="savebutton2"/>
</td>
<td class="ms-separator">&#160;</td>
<td class="ms-toolbar" nowrap="" align="right">
<SharePoint:GoBackButton runat="server" ControlMode="Edit" id="gobackbutton2"/>
</td>
</tr>
</table>
</td>
</tr>
</xsl:template>
<xsl:template name="dvt_2.rowedit">
<xsl:param name="Pos" />
<tr>
<td>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Session ID<span class="ms-formvalidation"> *</span>
</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Session_x0020_ID" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Session_x0020_ID')}"/>
<SharePoint:FieldDescription runat="server" id="ff1description{$Pos}" FieldName="Session_x0020_ID" ControlMode="Edit"/>
</td>
</tr>

<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Title</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff2{$Pos}" controlmode="Edit" fieldname="Title" __designer:bind="{ddwrt:DataBind('u',concat('ff2',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}" />
<SharePoint:FieldDescription runat="server" id="ff2description{$Pos}" FieldName="Title" ControlMode="Edit"/>
</td>
</tr>
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<tr>
<td colspan="99" class="ms-vb">
<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
</td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</xsl:template>

Thanks


Last edited by lasertracs on Wed May 04, 2011 12:47 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Unregister Page
PostPosted: Wed May 04, 2011 12:43 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
Ah, I'm sorry, I misunderstood. I have seen what you are describing, I'm not certain if it's a bug I may have introduced or not. I think there's some bad code somewhere in the web part that gives the user the link to unregister. In the implementations of the template we have deployed, some of the course information is replicated into the registrations list, so I rebuilt the web part and that seems to have fixed the occurances of the issue here.


Top
 Profile  
 
 Post subject: Re: Unregister Page
PostPosted: Wed May 04, 2011 12:52 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
It was actually working when I was testing, when I copied the unregister template code to register.aspx and displayed the form instead of navigation to another page. Now I cant figure it out why it is not displaying the selected item instead it display all the item but i should able to display the current in edit mode.


Top
 Profile  
 
 Post subject: Re: Unregister Page
PostPosted: Wed May 04, 2011 1:48 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
In order to have the unregister and register be on the same page, you'll need to pass in the Registration list itemID in the query string. You'll need to add a parameter to the DVWP that looks for this and if present should display your unregistration logic. If it doesn't exist, it should assume the user hasn't registered and will allow them to do so.

You need the Registraion list id to be sure you are properly selecting the right item, if not you start unregistering random people. It might have been working when you were testing it because you were the only one registering/unregistering so there was only 1 item to handle and it was getting it right out of luck.


Top
 Profile  
 
 Post subject: Re: Unregister Page
PostPosted: Wed May 04, 2011 3:22 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
Thats true!!! Yes u're right !!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group