Generic Browse Dialog


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have been using the Browse Dailog on a few screens and its working out very well. Typically I use it with a text Box , say to do a look up on a cutomer file. The user would enter text into the text box, and I first do an exact lookup on the Customer table to see if the cutomer number exists. If it does, I don't call the Browse Dialog. If it does not, i assume the user has entered 'part' of the name and I call a browse dialog with a few colums ftom the customer file set up. All this is working perfectly.

Now I find  I need this funtionality on say 20 forms. What I had started to do was repeat the same text box and browse dialog on each form, but thought there must be a better way . Some guidance of setting up a Customer Lookup class (based on a text Box that calls the browse dialog) that I can then drop on each of my forms.I can manage searching the tables etc but not sure how to set up the BrowseDialog in code as opposed to from within a form.

Pseudo code of the sort of thing I'm lookin at would be:

public class Textbox : MicroFour.StrataFrame.UI.Windows.Forms.Textbox
{
private System.Drawing.Color originalBackgroudColour;
protected override void OnEnter(EventArgs e)
{
//-- Run Base Class Code
base.OnEnter(e);
protected override void OnLeave(EventArgs e)
{
//-- Run the Base Code for the textbox
base.OnLeave(e);
// Pseudo Code
SearcCustomer(this.tetBox)
If NotFound
{Call BrowseDialog}
}
} // End textBox

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 Gerard,

Take a look at the StrataFlix sample application, it does have a user control class to do the kind of search you want to do and use it in several forms. 

Sorry I don't remember the exact reference, but I know it is there.

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 Gerard.

Here is a sample on how to deal with BrowseDialogs and LookUp controls:

http://forum.strataframe.net/FindPost27794.aspx

Cheers.

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Many thanks for your replies. I'll have alook at these

Regards,Gerard

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
You're welcome, Gerard. Wink
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Ivan. I have looked through the sample and am havong some difficulty just trying to understand whats going on, mainly because of my lack of experience on meaty c# projects. Obviously some of the code is generated by the framework, and some is not, and this is part of the difficulty I am having.

At this stage, before I do any serious work on this, I'd like to know in principle if it is feasible to have a 'Black Box' scenario where , in my 'LookupClass' , there are no dependencies on Browse Dialogs or even a Business Object  being dropped on a form.

In simple terms , I would like to have say a 'TextBox' with a no. of Properties (e.g. BusinessObject I will be looking up, a subset of the browseDialog parameters to identify the style of Dialog I will be calling, and then a no. of methods where I will populate the business object).

Ideally, I dont want to be dependent on any Business Objects or browse Dialogs having to be dropped on a form and want this to be a completedly self contained piece of code. i.e. By looking at the Class, everything will be in there

Do you reckon doing something like this is feasible ?

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 Gerard.

Well, I would say that almost everything is possible given the amount of energy you are willing to put into the action.

That is how I accomplished the task using the StrataFrame way of doing things. I guess you could create properties and methods to make it generic. I tend not to fight the framework whenever I can.

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Ivan.

I will plough ahead then and see if I can develop a small Class. I initially wanted to ensure that this was feasible before devoting a lot of time and effort. I use these lookups all over the place , and in our VFP system, we have a few classes specificaly for this which are fairly generic and wanted to replicate something similar in SF if possible. I realise it may be a bit of work up front, but should pay off in the long run

Regards, Gerard

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I just took a look at the sample (nice Ivan) and then tried to "genericize" it. See the samples section for the new version of Ivan's sample that includes a couple of possible ways to make this more generic.



http://forum.strataframe.net/FindPost27814.aspx



Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Greg.

Many thanks for this and particulalrly taking the time to tease out and explain the pros and cons. I have had a quick look at it , but will need to sit down and devote some time to it, but no doubt your very detailed explanations should help a lot.

Regards,

Gerard

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