View Issue Details

IDProjectCategoryView StatusLast Update
0002864JEDI VCL00 JVCL Componentspublic2005-05-18 09:15
ReporterivobauerAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.10 
Summary0002864: JvTabBar doesn't preserve the currently selected tab item
DescriptionWhen attempting to change the currently selected tab at *design time* by setting the Selected property of that particular TJvTabBarItem to True, this change is not persistent, i.e. the changed value of the Selected property doesn't get written into DFM because it was told not to do so - see the 'stored False' specifier at the end of Selected property. Andreas, is there any reason for this?
Steps To Reproduce1) Create a new project.
2) Drop TJvTabBar onto the form.
3) Create some tab items.
4) Activate some tab item other than the first one.
5) Set its Selected property to True.
6) Run this app and you'll see that the selected item is always the first tab item no matter what you set at design time.
Additional InformationAlthough this might look like a banality, it leads to a serious problems when TJvTabBar is used in conjunction with TJvPageList (selected tab item and active page properties could easily get out of sync).
TagsNo tags attached.

Activities

ivobauer

2005-04-12 04:59

reporter   ~0006933

I've taken a quick look at the code and believe that the following modifications can fix the current situation (not tested though):

(1) Remove the 'stored False' specifier from the declaration of Selected property of TJvTabItem. Instead, some 'default False' specifier would be more appropriate, IMO.

(2) In TJvCustomTabBar introduce an overridden Loaded method whose implementation would look like this one:

function TJvCustomTabBar.Loaded;
begin
  inherited;
  SelectedTab := FindSelectableTab(nil);
end;

What do you think?

obones

2005-05-18 06:13

administrator   ~0007192

Do you have a sample application for this?

ivobauer

2005-05-18 06:59

reporter   ~0007205

Although this bug is quite reproducible, I'm afraid it's not feasible for me to prepare a test case. You have to do it yourself, it's very simple - just please follow those 6 steps I mentioned in 'Steps to reproduce' section.

I try to explain why the test case can't be prepared. The problem is that when I set Selected property of some TJvTabBarItem to True, this change isn't propagated to the DFM file *because* this property has 'stored False' in its declaration. If I prepare a test case for this bug on my machine and send it to you, you will simply see nothing wrong with the test case.

Hope I made it clear.

AHUser

2005-05-18 09:15

developer   ~0007216

> (1)

I haven't stored the Item.Selected property because it was "calculated" from the TabBar. But while designing the component I must missed the fact that I do not have a published property that stores the selected tab index in the whole component.

This is fixed in CVS by replacing "stored False" by "default False" and the Loaded method is added.

Issue History

Date Modified Username Field Change
2005-04-12 02:24 ivobauer New Issue
2005-04-12 04:59 ivobauer Note Added: 0006933
2005-05-18 06:13 obones Note Added: 0007192
2005-05-18 06:13 obones Status new => feedback
2005-05-18 06:59 ivobauer Note Added: 0007205
2005-05-18 09:15 AHUser Status feedback => resolved
2005-05-18 09:15 AHUser Resolution open => fixed
2005-05-18 09:15 AHUser Assigned To => AHUser
2005-05-18 09:15 AHUser Note Added: 0007216