PanelManagerPage Deactivation event?


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi all,



I am working on a form with an interface look similar to the SF Localization & Messaging Editor, with a TreeView on the left and a Panel Manager on the right side.



Problem I have is how would I know when a page is being deactivated?

Ex: User is modifying a record in Page A, then user clicks on another node which will activate Page B, but there is dirty data in the BO for Page A.




Where do I put code to validate above scenario and avoid Page B from being activated until the conflict have been resolved in Page A?



The same thing is done in the Localization & Messaging Editor, if I am modifying a message then click on another node while the BO is dirty a broken rule is created and I cannot leave that page until I save or cancel the record. In which event should I put the code to validate this condition?



Thanks!

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hey Edhy.

Maybe you could put code into your Treeview BeforeSelect event and then test for BO state or whatever is the condition for you to leave and if not accomplished, set "e.Cancel = True".

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ivan,



Thanks, that will work. I was focused on the page events instead of looking for a solution at other angle.

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad it helped, Edhy. Wink
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ivan,



Moving this post more on the TreeView control I have another question but first let me give a bit description of what I am after...



I had created a form based on the SF Standard class with a listview (one 2 many) and the childform have another listview which of course calls another child form. This design is not user friendly at all, but considering this was my first SF/.Net application a while a go, it passed Tongue



Now I want to make this form more user friendly and a TreeView looks like the way to go. So I am planning on playing with the form.PrimaryBusiness object to have generics calls based on the selected node, in this case I will only have 2 node levels, I am using the Node.Tag to save the record PK like the listview does, so assigning the current BO to the form.PrimaryBusinessObject allows me build generic methods and validations using the PrimaryBusinessObject.



Ok, I know, you may be thinking... Edhy where is the question?BigGrin well here it is: this is my first time in .Net working with TreeView, am I in the right direction with this control and SF?



Any suggestion, idea, greatly appreciated! Hehe

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Edhy.

I have worked with some treeviews so far, but never attempted to create a generic one like you are doing. It sounds good to me, but this doesn't realy mean a lot (:heheSmile.

Every treeview I have worked with I populated with specific BOs, so I too added the PKs to the node.Tag and usually a BO.field_name to the Node.Text. After that, I only took care of the NodeStateChanged and did whatever was necessary when the node.StateImageIndex was Checked or Unchecked.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ivan George Borges (05/31/2010)
Every treeview I have worked with I populated with specific BOs, so I too added the PKs to the node.Tag and usually a BO.field_name to the Node.Text. After that, I only took care of the NodeStateChanged and did whatever was necessary when the node.StateImageIndex was Checked or Unchecked.


Thanks Ivan,



Yeap, in my case, there will be more data manipulation like adding/deleting/updating records which involve the same manipulation for the treeview nodes in order to keep it in sync with the current view, it will be fun, at least so far it looks much easier than when I did it with VFP w00t.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search