Page 1 of 1

Possible to switch from Browser to Rec.-View in a Listbox?

PostPosted: Sun Feb 03, 2008 2:25 pm
by ukoenig
Hello, from Germany

I want to switch from Browse-Mode
to Record-Mode to edit the selected
Record in a listbox.
The first browser is a < normal > browser
The 2. shows just 1 record with field- and type infos.

Picture :
http://www.pflegeplus.com/pictures/outlook.jpg

In the first Col, i want to show the fieldnames.
In the second Col, i want to edit the fields.
The Listbox needs to have a scrollbar.

That means, the MATRIX of the browser has to be different.
In a normal browser, you have for each var a col and
each record a row.
The browser i need, has to show just 1 record.
I need 1 col for the varnames and the second col
for the var-contents. In the browser, i want to skip
to another record.

In some DB-Tools, i have seen somthing like that.
I can put the Record-Informations in a 2 dimensional-Array.
It works, but i have so save the array back to the database.
Is there maybe another way, to create it directly with database-fields ?

Regards
Uwe :lol:

PostPosted: Mon Feb 04, 2008 9:56 am
by Antonio Linares
Uwe,

This will give you an idea about how to implement it:
Code: Select all  Expand view
METHOD SetEdit() CLASS TWBrowse

   ::bLogicLen = { || RecCount() * ( FCount() + 1 ) }
   ::cAlias = "_EDIT"

   ::Refresh()

return nil   

Code: Select all  Expand view
   do case
         case ::cAlias == "_EDIT"
            DbGoTop()
            DbSkip( Int( nRow / ( FCount() + 1 ) ) )
       nField = ( nRow + 1 ) % ( FCount() + 1 )
                 return If( nField == 0, If( nCol == 0, "-------------", "-------------------------------------" ),;
                 If( nCol == 0, FieldName( nField ), cValToChar( FieldGet( nField ) ) ) ) 

Code: Select all  Expand view
   @ 48, 20 LISTBOX oBrw FIELDS "", "" HEADERS "FieldName", "Value" ;
      OF oWnd SIZE 672, 363 ALIAS Alias()

PostPosted: Sat Feb 09, 2008 3:19 pm
by Roger Seiler
Is this what you want?

- Roger

Image

PostPosted: Sat Feb 09, 2008 3:26 pm
by Rick Lipkin
Roger

I like your database tool .. would you mind sharing the code ?? I would like to adapt it to ADO for Sql Server ..

Thanks,

Rick Lipkin
lipkinrm29063@yahoo.com

DB-Tools as a public-project

PostPosted: Sat Feb 09, 2008 4:18 pm
by ukoenig
Hello, from Germany

I'm planning a project, all users of the forum can join.

The Tools will have a practical-section, that means,
to handle everything, what you need for database-administration.
As well, it is a sample, how all classes can work together :
xBrowse, Office2007, Outlook2003
Included, there will be a section, for tryouts of any problems.
For the moment, the tools are in German and English.
For other languages we need somebody for translation.

The actual release should be shown in the forum
like : DBTools_2_8.zip ( like FWH )
The Topic must have a Descripton of changes in the new release.

The Basics are nearly finished. I still have to do some cleanings
and the English-Translation.
With the time, it could be the answer of many questions.

Regards
Uwe König

PostPosted: Sat Feb 09, 2008 4:33 pm
by Manuel Valdenebro
It is a pleasure for me if I can colaborate for spanish translation.

Roger: Beatiful yours browse.

PostPosted: Sat Feb 09, 2008 4:46 pm
by Otto
Thanks to NageswaraRao we have a working sample for

Synchronization of row and redord browse with xBrowser

on

http://www.fwcodesnips.com

Regards,
Otto

PostPosted: Sat Feb 09, 2008 8:36 pm
by Roger Seiler
Hi Rick,

Yes, glad to share my code for synchronizing a browse with a record-edit. Just click below to download a zip file with my stuff.

http://www.leadersoft.com/files/browedit.zip

And here is another screenshot with another version where I've synched a browse with folders in a companion record-edit dialog...

Image

This example is from our election campaign management software, and anyone selected from the browse of registered voters on the left gets their record data displayed in tabs on the right. One can edit data on either the browse or the tabs, and updates are synchronized between the displays. Also one can doubleclick on the column heading to change the index and reorder the browse display. Note the buttons in the lower middle whereby cell editing of a field in any column can be be set to exit either down or right. In this case, the "List" button displays another dialog for demographically selecting voters' names for mailing, "walking" and phoning lists, etc.

- Roger

Examples

PostPosted: Sat Feb 09, 2008 9:29 pm
by TimStone
Here is the way I handle it in a regular program ...

Image

Tim

Listbox in xBrowse for 1 Record

PostPosted: Sun Feb 10, 2008 12:46 pm
by ukoenig
Hello Roger,

Your sample looks very nice.
When you open a unknown database,
you don't have a resource with the placed fields.
For your inhouse-software you create one.
For a DB-Tool, it is the only way, to create a Browser
together with a Listbox for the selected record
when you want to see the field-informations.
I have seen a tool DBADMIN ( it is done with Visual-Object )
There, they go to edit-mode for a single record
in a extra dialog with no field-Information and no
connection with the main-browser.
Like it is shown in your sample, it is much better
to handle.

Greetings from Germany
Uwe

PostPosted: Tue Feb 12, 2008 7:44 pm
by Roger Seiler
Glad you like it, Uwe.

Hopefully, you can adapt some of the concepts to do what you want to do, regardless of which browse tool you are using. Though I'm using a much advanced version of Tcbrowse, Tsbrowse is close enough to it that these concepts should be easy to implement there.

Good luck!

- Roger