Re: Using listbox as output form replacement

2018-10-24 Thread Kirk Brooks via 4D_Tech
Hi Jim,
I have a couple of thoughts about this. First, for user mode output forms I
stick with plain, old 4D output forms. It's really the best.

Second, I totally support the direction you're going with using a Dialog
and a listbox instead of MODIFY/DISPLAY SELECTION. I would encourage you to
try doing this with arrays instead of selections though. Here are some
reasons I've come to favor this which I'll preface by saying for years I've
been working on a C/S db that's accessed by clients via HTTP so optimizing
transfer rates has been particularly important to me. Also if you do have a
table with lots and lots of fields you likely want to show (or let the user
pick) a smaller selection that's useful in a list. I'm not one who likes to
show listboxes with more than about 20 columns and rarely that many.

Selections can involve a lot more data: when you display a record as part
of a selection 4D moves the entire record from the server to the client.
That can be a lot of data. This can be optimized using the 'store outside
of datafile' option on blobs, text and so forth (which is what that is
really for I believe). So if you are displaying 8 or 10 fields of a record
with dozens or hundreds of fields there's a lot of extra transfer you don't
need.

You have fewer record locking issues: your display form/process can be read
only. Open records for detail viewing/editing in a separate process window
and manage the read/write issues there.

Array operations are fast: Both loading and working with arrays is very
quick. Years ago having enough memory for large selections could have been
an issue but not so much today.

User interactions are faster: there's rarely a comparison between how fast
an array based listbox can respond vs. a selection based one if you've got
a selection of any size.

Use an object array if you can.


My general workflow is:

user inputs some query criteria
send this to the server (execute on server method) to do the query and
return the arrays.


If I am using an object array I populate it with objects containing the
relevant data for each record.
If I'm using arrays I pass pointers to the arrays to the query method.
In both cases you can get a performance boost by declaring local arrays you
need in the query method and use COPY ARRAY to populate the return objects.


On Tue, Oct 23, 2018 at 5:14 PM Jim Crate via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I have a form with a selection-based listbox which I use as an output
> form. In runtime mode, you just use DIALOG instead of DISPLAY SELECTION. If
> I set that form as the output form, it doesn’t work in User mode, it just
> says “There is no form selected to display the records of: [My_Table]”. Is
> there a way to get this to work in User mode?
>

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using listbox as output form replacement

2018-10-24 Thread Two Way Communications via 4D_Tech
Hi Jim,

No, this will not work in user mode. To use a listbox in that way (generic), 
you need to put it in an input form, to start with. You can only use it by 
programming, using DIALOG.

Regards,

Rudy Mortier
Two Way Communications bvba 



> On 24 Oct 2018, at 02:13, Jim Crate via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> I have a form with a selection-based listbox which I use as an output form. 
> In runtime mode, you just use DIALOG instead of DISPLAY SELECTION. If I set 
> that form as the output form, it doesn’t work in User mode, it just says 
> “There is no form selected to display the records of: [My_Table]”. Is there a 
> way to get this to work in User mode? 
> 
> Jim Crate
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using listbox as output form replacement

2018-10-23 Thread Jim Crate via 4D_Tech
On Oct 23, 2018, at 5:37 PM, Jim Crate via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> On Oct 23, 2018, at 5:21 PM, Timothy Penner via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
>> 
>> Hi Jim,
>> 
>>> Is there a way to get this to work in User mode?
>> 
>> User Mode? Maybe the following items will help -
>> 
>> Tech Tip: User Mode is now a part of Design Mode
>> http://kb.4d.com/assetid=47243
> 
> I don’t really need any old User mode functionality. So I’ll re-phrase: a 
> normal output form with header, detail, footer sections displays properly in 
> the Design mode window that displays the form with data. A form using a 
> listbox for the detail section does not seem to display properly. 
> 
> I have figured out that if the detail area specified by the form markers is 
> not zero, the form displays. The listbox displays fine in the header or 
> footer. However, I’m not sure where to put the markers so that the listbox 
> will take up the available space, like a regular listing. It works well 
> enough, I suppose, if I move the markers down far enough for the header to 
> take up the space that I use for that window. 

Actually the listbox growth properties aren’t respected, so the listbox also 
has to take up the space. I didn’t notice that moving the marker resized my 
listbox.

Anyway, close enough, I suppose. Setting it up like that doesn’t affect the 
display using the DIALOG command.

Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using listbox as output form replacement

2018-10-23 Thread Jim Crate via 4D_Tech
On Oct 23, 2018, at 5:21 PM, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Hi Jim,
> 
>> Is there a way to get this to work in User mode?
> 
> User Mode? Maybe the following items will help -
> 
> Tech Tip: User Mode is now a part of Design Mode
> http://kb.4d.com/assetid=47243

I don’t really need any old User mode functionality. So I’ll re-phrase: a 
normal output form with header, detail, footer sections displays properly in 
the Design mode window that displays the form with data. A form using a listbox 
for the detail section does not seem to display properly. 

I have figured out that if the detail area specified by the form markers is not 
zero, the form displays. The listbox displays fine in the header or footer. 
However, I’m not sure where to put the markers so that the listbox will take up 
the available space, like a regular listing. It works well enough, I suppose, 
if I move the markers down far enough for the header to take up the space that 
I use for that window. 

Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Using listbox as output form replacement

2018-10-23 Thread Timothy Penner via 4D_Tech
Hi Jim,

> Is there a way to get this to work in User mode?

User Mode? Maybe the following items will help -

Tech Tip: User Mode is now a part of Design Mode
http://kb.4d.com/assetid=47243

Tech Tip: Converting Databases that used "User Mode"
http://kb.4d.com/assetid=75239

Tech Note: User Mode Component  (for databases prior to v12)
http://kb.4d.com/assetid=75777

Tech Tip: Virtual User Mode (for databases v12 and higher)
http://kb.4d.com/assetid=76942
https://github.com/miyako/4d-tips-virtual-user-mode

-Tim



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**