Welcome Guest Search | Active Topics | Sign In | Register

TreeView.ItemCheckStateChanged Event Options
Michael Earley
Posted: Thursday, June 21, 2007 4:12:04 AM
Rank: Newbie
Groups: Member

Joined: 6/16/2007
Posts: 8
TreeView

With RaisesServerEvent set to True, the TreeView.ItemCheckStateChanged event is not called.

The following is the routine associated with the TreeView.ItemCheckStateChanged Event

Protected Sub TreeView1_ItemCheckStateChanged(ByVal sender As Object, ByVal e As EO.Web.TreeNodeCheckStateChangedEventArgs) Handles TreeView1.ItemCheckStateChanged

If e.Node.IsLeafNode Then
If e.OldCheckState = False Then
NewsItemDB.addNewsSubject(NewsItem.ID, e.Node.ItemID)
Else
NewsItemDB.deleteNewsSubject(NewsItem.ID, e.Node.ItemID)
End If
End If

End Sub

Michael
eo_support
Posted: Thursday, June 21, 2007 5:02:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,095
Hi Michael,

Thanks for posting your question here. We will look into it and see what we can find.

Thanks
eo_support
Posted: Wednesday, June 27, 2007 7:53:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,095
Hi Michael,

This issue is now fixed. Please download the latest build (2007.1.20) from our download page and let us know how it goes!

Thanks
Michael Earley
Posted: Tuesday, July 3, 2007 10:27:01 AM
Rank: Newbie
Groups: Member

Joined: 6/16/2007
Posts: 8
I have applied version 2007.1.20 and with no success.

The following is the control object definition:

<eo:TreeView id="TreeView1" runat="server" Width="495px" Height="500px" ControlSkinID="None" AutoCheckChildren="True" AutoUncheckChildren="True" RaisesServerEvent="True" TargetWindow="_new" SaveStateCrossPages="True" StateCookieName="Subjects">
<CheckBoxImages Margin="3" Visible="True"></CheckBoxImages>
<LookNodes><eo:TreeNode ExpandedImageUrl="00030302" ItemID="_Default" SelectedStyle-CssText="background-color:#316ac5;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:White;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;" NormalStyle-CssText="PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; COLOR: black; BORDER-TOP-STYLE: none; PADDING-TOP: 1px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none" DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;color:Gray;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;" CollapsedImageUrl="00030301" ImageUrl="00030301">
<SubGroup ShowCheckBox="True"></SubGroup>
</eo:TreeNode>

And the following is the routine that is raised by the changecheckstate event:

Protected Sub TreeView1_ItemCheckStateChanged(ByVal sender As Object, ByVal e As EO.Web.TreeNodeCheckStateChangedEventArgs) Handles TreeView1.ItemCheckStateChanged

NewsItem = NewsItemDB.selectNewsItem(Request.QueryString("id"))

If e.Node.IsLeafNode Then
If e.OldCheckState = False Then
NewsItemDB.addNewsSubject(NewsItem.ID, e.Node.ItemID)
Else
NewsItemDB.deleteNewsSubject(NewsItem.ID, e.Node.ItemID)
End If
End If

End Sub
eo_support
Posted: Tuesday, July 3, 2007 10:28:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,095
hi, Michael
Hmmm, looks like it still has some problem.
I tried the same code and TreeView1_ItemCheckStateChanged won't get called until you click that item.
I checked the checkbox of an item, nothing was post back to server. Then I click the item, I noticed on server side, TreeView1_ItemCheckStateChanged gets fired first, and then TreeView1_ItemClick. I will check with our engineers and see if this is the way they designed or it is a bug.
Thanks for your report and have a nice holiday
EO Support Team
eo_support
Posted: Tuesday, July 10, 2007 3:19:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,095
Hi Michael,

We have verified that ItemCheckStateChanged is a delayed event. Clicking the check box will not fire the event immediately. Instead it waits until the page is posted back and then fires the event. However the event DOES get fired when the page posts back. Please verify whether this is your case.

Thanks
Michael Earley
Posted: Wednesday, July 11, 2007 1:36:44 AM
Rank: Newbie
Groups: Member

Joined: 6/16/2007
Posts: 8
Yes it does fire when the page is posted back. I had previously used my own AJAX type implementation on my own tree implementations to call a procedure on the server which updated immediatly when the checkbox was ticked. A lot of users have got used to this effect and forget to click on the Save button to force a post back. I will need to find to way to work around this one.
Thanks,
Michael


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.