Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2006, 12:00 PM
Far Far is offline
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default bugbase: priority display in addedit is always 3


Hello,

If you edit a bug and change the status and priority, the status changes but the priority display on this page is still 3.
http://localhost:3166/BugBase/Bugs/A...plicationId=29

In fact all bugs if you select edit are listed with a priority of 3.

However if you select the bug by it's hyperlink on the title and go to:

http://localhost:3166/BugBase/Bugs/ViewBug.aspx?ID=128

You will find that the priority has really changed. The search feature also confirms that the change has happen since it shows up at the right priority.

I would like fix the code. But I am not sure.

Here is what I think needs to be done:
1. Add in ListTYpe, Priority

But BugManagerDb.vb does have priority listed and the stored procedure also shows that it uses "sprocBugInsertUpdateSingleItem"

I am lost at as what to change to get priority to be listed correctly in when the edit button is selected for the bug.

Imar, can you help?
Anyone, please advise.

Thanks,Far

 
Old April 25th, 2006, 01:12 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Far,

Yep, that's indeed a bug. (I just logged it in my on-line version of the BugBase ;) )

Fortunately, it's easy to fix. None of the data access or business logic code needs to be touched, as that all works fine. It's in the presentation layer (in the code behind of AddEditBug.aspx to be exact) where the right item in the list is not selected. Here's how to fix it:

1. Open AddEditBug.aspx.vb from the Bugs folder.

2. Scroll down to around line number 75

3. Right below the End If of the code that sets the selected item for the lstStatus, and before the line that sets the page title, add the code in bold:
Code:
If lstStatus.Items.FindByValue(myBug.Status.Value.ToString()) IsNot Nothing Then
  lstStatus.Items.FindByValue(myBug.Status.Value.ToString()).Selected = True
End If
lstPriority.ClearSelection()
If lstPriority.Items.FindByValue(myBug.Priority.ToString()) IsNot Nothing Then
  lstPriority.Items.FindByValue(myBug.Priority.ToString()).Selected = True
End If
txtTitle.Text = myBug.Title
txtDescription.Text = myBug.Description
This code clears the current selection (the default Selected item of "3", set in the markup for the lstPriority control) and then sets its new selected index by looking at the Priority property of the bug.

(Sorry about the long lines; didn't want to mess with the original code by adding line breaks or underscores, to make it easier for you to see where you need to add what.)

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Avon by Queens of the Stone Age (Track 2 from the album: Queens of the Stone Age) What's This?
 
Old April 25th, 2006, 01:29 PM
Far Far is offline
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perfect!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Rows Priority Wise Muhammad Zeeshan SQL Language 0 November 23rd, 2007 03:48 AM
Code in Java for priority queue kishor_shrestha Java GUI 3 November 13th, 2004 08:08 PM
Set base priority of exe lmadhavi Visual C++ 0 September 6th, 2004 05:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.