Listview and BO Synchronization


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

Overall I was just trying to show you the multiple things you can do with SF, and StrataFlix is just another example that its logic may not apply to your current project, but it is still a good place for learning how to do stuff with SF.

Still in your case, I dough an end user needs to see 10,000 invoices to choose which one to work with, so instead of allow them to bring all those 10K invoices, allow then to filter out by other means the ones then need to on the screen so they can process those as bulk or watever other process you use.

The idea of using the "ORDER BY" claused was to initially display the records the way you want it.  The listview also have support for Sorting the columns, but still if you have 10K invoices to sort, it will take a while using a listview or a grid.

He tries to find all the invoices where postage code begins with "xy" to see the invoices from a special region. He now can browse thru these invoices to have a fast look at the items selled in this region. This could be done very good with the Query by Form: Hit F3 to start QBF, Enter XY in Postage Code and hit again F3 to see the records. (OK this case was a little bit constructed, but there are a lot real world samples).

Again, I am sure you can get that feature done with SF if you really need to, but it is not incorporated into the framework.  My point was that SF Dialog Browser is very powerful and allow you (the developer) to have control over the search to be done and which fields to show up and many other things, so probably after getting to know the SF BD you may not really need the F3 QBE feature.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I need a framework, which let me do things the way I want, not the way the framework publisher thinks I maybe want to. I've learned by now, that strataframe (do you too type "startaframe" every time ?) lefts me a lot of this freedom and I like it very much by now.

I agree...and so does the rest of the StrataFrame Development Team.  StrataFrame is not written or designed to force you into our way of thinking.  I just scanned through this post as I am in a hurry here, but there are probably several things here that you should consider.

I am not a proponent of grids, but if you are loading a list with 10000 records, then a grid may be a better avenue than a ListView.  Unless you use virtualization on the ListView, it will have to load and render all of these rows, which is slow.  Grids, in their very nature are virtualized.  So this may be a good place to use a grid.  In this case, you would drop on a BusinessBindingSource, select the BO that it will wrap, and then make the BBS the data source of the grid.

Torsten Weggen
Torsten Weggen
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: Forum Members
Posts: 4, Visits: 21
Edhy,



thanks very much for spending your time helping me going around with my first steps.



In your last reply, you mentioned a few things about generally interacting between user and a modern, new style of application I am able to write with strataframe. You leaded me to the strataflix app to look at. Edhy, really, I would never roll out an application like this. There are so many situation where the user weants to have an overwiew of the data in his store. Looking at only one record at a time is not the best solution in all circumstances.



You are right when you say that pulling all the data in the mask is not state of the art, I totally agree with that. See my invoice mask. It starts in my app with a predefined filter: "Show all invoices where something is to do". Then the user can look at these invoices by clicking in the listview and navigating to the different records. Now he decides to ship three of the invoices. He uses the multiselect - feature of the listview to mark the three invoices and hit the button "Print package label" and automatically the labels for the 3 invoices are printed and the state "shipped" for these invoices is set.



Next step: He tries to find all the invoices where postage code begins with "xy" to see the invoices from a special region. He now can browse thru these invoices to have a fast look at the items selled in this region. This could be done very good with the Query by Form: Hit F3 to start QBF, Enter XY in Postage Code and hit again F3 to see the records. (OK this case was a little bit constructed, but there are a lot real world samples).



One more thing: I like the Browse-Dialog. I have something equal in my framework. I use it often, when I have to select a special record. For example when creating a new invoice, I want to select a special adress because the customer is already in my adress table. So, after adding a new record in my invoice form, I click a button which leads me to a Browsedialog on the adress table. Now I can search in the dialog for the customer by whatever I want and the hits are shown in the grid. Doubleclicking the right adress brings me back to the invoice mask with all the adress data filled from adress table.



You see, there are a lot ways to do things and you ever have to look which way fits best for your customer.



I need a framework, which let me do things the way I want, not the way the framework publisher thinks I maybe want to. I've learned by now, that strataframe (do you too type "startaframe" every time BigGrin ?) lefts me a lot of this freedom and I like it very much by now.



Edhy, you said that my form could look even better when I use a panelmanager and a ThemedPanel. You are right. I would never let this design out of my house. But it is only a proove of concept, nothing that would ever go out to anybody.



OK, back again to my last questions. You are right with the tip of "ORDER BY". But what I want is that clicking on the listview header sorts the listview ascending / descending by column. Every time going back to database and fetching the same records in another order seems not to be the best way.



That QBF is not a feature from SF is something I realized by now. I know, I have to code it by my own (and share it with the community w00t ). I only asked the advanced SF programmers for any ideas where to hook in best.







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

Glad you are finding your ways.

1.) As mentioned in my first post, setting the property "autocolumnsort" of the listview leads to a very long time of waiting before the form is shown. With my 10000 invoices in the Test-DBC, I get a timeout COM-Error after a while. Any ideas where to look at ?

You can fill your BO data in any way you want, so just add the "ORDER BY" clause to your FillByXXX method to present your data sorted.

2.) The other thing is more a question for ideas. In our VFP-Framework classmaxx, we have the opportunity of starting a thing we call "Query-By-Form". You hit a button, every data entry control unbinds from its data source and you can enter values to search for. After that, you hit the button again and a where-clause will be derived from the controls. Controls are databound again and the where-clause is used for filtering the data. Our customers love this feature and I surely have to implement this in strataframe too.

Do you have any first thoughts about how to implement this and where to go inside ?

SF does not have such a thing like "Query-By-Form" and in fact you may really don't need it.  SF has a very powerful Dialog Browser component which will let your users search for the data they need with a great deal of flexibility for them and specially you the developer and keep it easier to maintain.

As I have been told by many experience SF developers, you have to let go the VFP way and learn the new thing you can do with .NET & StrataFrame, these are a whole new type of UI concept design (See the StrataFlix sample application) with a disconnected database (MS-SQL) which in most cases does not makes sense to allow the end user to bring down all records when then will only work with one at a time. 

My suggestion here would be not to try to mimic the VFP application design, instead use its foundation and logic to rebuild a new application with SF that will get you what you want with a more fresh look (of course that will require a bit more experience) but I am a living proof it is doable and there are many other SF developers which also came from VFP environment that can probe the same thing.

Your new form looks nice, and it can look even better by adding a PanelManager or a ThemedPanel which will follow the theme of your ThemedToolStrip and much more.  Also trying to modify the child data using textboxes in the same form, you can take full advantage of the ListView Automation tools in which you can create a ChildForm to provide data access to your listview with a few powerful setting in the listview in which you will have more control of the child data and its validation.

Again look at the StrataFlix application which is a great source to show how the tools can be used.

Edhy Rijo

Torsten Weggen
Torsten Weggen
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: Forum Members
Posts: 4, Visits: 21
@ Edhy,



thank you very much, this was the right way. I ve had a little troble to convert this to C# first, but now it runs like hell BigGrin



@ All

so now my test-form is growed up some more steps, I added a parent-child relationship for the invoice-positions and everything has been a lot easier than I thought before. Nice nice.



Take a look on my actual screenshot.







Not bad for a first try, hmm ?



OK, there are 2 problems left (for now Wink ).



1.) As mentioned in my first post, setting the property "autocolumnsort" of the listview leads to a very long time of waiting before the form is shown. With my 10000 invoices in the Test-DBC, I get a timeout COM-Error after a while. Any ideas where to look at ?



2.) The other thing is more a question for ideas. In our VFP-Framework classmaxx, we have the opportunity of starting a thing we call "Query-By-Form". You hit a button, every data entry control unbinds from its data source and you can enter values to search for. After that, you hit the button again and a where-clause will be derived from the controls. Controls are databound again and the where-clause is used for filtering the data. Our customers love this feature and I surely have to implement this in strataframe too.



Do you have any first thoughts about how to implement this and where to go inside ?
Guillermo Vilas
Guillermo Vilas
StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 2.3K
Hi Torsten

Did you tried just setting the Properties of the Listview to:

BusinessObject = Primary Business Object

AutoNavigateToSelectedRecord = True



Leave the other properties alone

------------------------------------------------------------------------
I would like to change the world, but they don´t give me the source code.
MS Windows 7 Ultimate 64-Bit
Intel(R) Core(TM)2 Quad CPU Q9300 2.50 GHz
6.00 GB of RAM, NVIDIA GeForce 9800 GT

MacBook Pro i5 OSX Lion
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 Torsten and welcome to the forums.

I understand you want to use the listview to drive the navigation of the records and synch it with the SF navigation toolstrip. 

The SF listview was not designed to do that, but Greg McGuffey posted a class to handle that kind of situation, you can find all the explanations here http://forum.strataframe.net/Topic14966-26-1.aspx

If you don't want to follow that route, you can make use of the Browser Dialog (BD) to bring only the invoice record in which the end user will work with (yes one at a time) or if you need to work on a bulk invoice process, then you can use the same BD to filter out all the invoices and fill the BO with only those needed in your list. 

As you can see there are many way to deal with this, it will all come down to what are your real requirements and how you want to present that to the end user.

Edhy Rijo

Torsten Weggen
Torsten Weggen
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: Forum Members
Posts: 4, Visits: 21
Sorry, I could not edit my post , so here is the correct image:




Torsten Weggen
Torsten Weggen
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: Forum Members
Posts: 4, Visits: 21
Hi folks,



I'm new to strataframe and now in my evaluation phase. I took one form from my actual VFP-Application and want to do exact the same thing with .NET / strataframe. I think this is the best way for evaluation because you cross a lot of real world problems when doing it this way. My application is written with a Vfp-Framework not known in the english world (its german), but it uses in many ways the same approach to do things like strataframe do.



OK thats the preliminarys, now my question(s):



I have a form which is dealing with invoices. I put all the textboxes and checkboxes on my form, coupled them to the BO and everything works fine. The next step was to add a listview to the form to scroll through the invoices. (See the screenshot)







My first problem is the synchronization between listview and the data entry controls. My first try was setting the listview-property "AutoNavigateToSelectedRecord" to true but nothing happend. The next thing was using the "ItemSelectionChanged" method with the code





private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)

{

int primkey = (int)e.Item.Tag;

rechBO1.NavigateToPrimaryKey(primkey);



}





Navigation works fine with this, but what should I do, when I use a navigation-button in the form ? The "Selection-Row" of the listview is not in synch when I navigate with the BO-Navigate-Methods.



Next question is what to do with the listview, when I add a record or change the content of one record and save. Changes are not visible in the listview. Do I really have to repopulate the whole listview on every change ? This is really not the fastest thing when I have 10000 invoices in my database...



And the last question for today: The listview has a property "AutoColumnSort". In the documentation is written, that turning this property to true allows sorting by click on the listview header. But when I set this to true, my form does not start any more and after a while I get a COM Timeout-Message. Is this a bug or a feature ?



Best regards

Torsten Weggen

indisoftware GmbH

Hanover, Germany



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