Re: Form objects remaining disabled between forms

2016-09-19 Thread Chip Scheide
IF this is occurring in the same process - then this is expected 
behavior.
If NOT the same process, then it is something I have not seen (through 
v13), and maybe a bug or corruption of the system.

On Sat, 17 Sep 2016 18:11:44 +0200, Peter Jakobsson wrote:
> Hi
> 
> This is a phenomenon I (we ?) have lived with for a couple of 
> centuries and just thought I’d bring it up for discussion since the 
> new OBJECT SET ENABLED command seems to inherit the old behaviour.
> 
> Lets say you have a text array process variable manifesting as a 
> pop-up menu on one form and you disable it on that form.
> 
> If you then open a different form which uses that same variable in a 
> pop-up menu, it remains disabled there as well. 4D never seems to 
> reset the enabled state to some default. What this means is that I 
> always have to explicitly set pop-up menus to “enabled” in the On 
> Load phase, even though there may be no state management required in 
> a particular form.
> 
> What do other people do to address this ? (Or am I missing something 
> in front of my nose).
> 
> Regards !
> 
> Peter
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Form objects remaining disabled between forms

2016-09-17 Thread Tim Nevels
On Sep 17, 2016, at 2:00 PM, Peter Jakobssonwrote:

> This is a phenomenon I (we ?) have lived with for a couple of centuries and 
> just thought I’d bring it up for discussion since the new OBJECT SET ENABLED 
> command seems to inherit the old behaviour.
> 
> Lets say you have a text array process variable manifesting as a pop-up menu 
> on one form and you disable it on that form.
> 
> If you then open a different form which uses that same variable in a pop-up 
> menu, it remains disabled there as well. 4D never seems to reset the enabled 
> state to some default. What this means is that I always have to explicitly 
> set pop-up menus to “enabled” in the On Load phase, even though there may be 
> no state management required in a particular form.
> 
> What do other people do to address this ? (Or am I missing something in front 
> of my nose).

You have discovered the secret reason why using object names is preferred over 
using variable names. 

Setting a object property based on a variable name can allow it to persist 
after a form is displayed because the process variables continue to exist. 
Using object names guarantees that will not happen. 

Yeah… I know. Now that you think about it, it makes sense :)

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com


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

Re: Form objects remaining disabled between forms

2016-09-17 Thread Kirk Brooks
Hey Peter,


On Sat, Sep 17, 2016 at 9:30 AM, Peter Jakobsson 
wrote:

> sounds interesting. Do you mean present the menu as a button and then
> display the pop-up menu dynamically when the user clicks on the button ?
>
​Exactly. Something like this:
​

​$menu:=create menu
For($i;1;size of array(aArray))

APPEND MENU ITEM($menu;$aArray{$i})

SET MENU PARAMETER($menu;-1;string($i))// put the array index in the param

or
SET MENU PARAMETER($menu;-1;$aArray{$i})// to put the array value in the
param

End for​

​$result:=Dynamic popup menu($menu) // returns the param set above
RELEASE MENU($menu)

if($result#"")// means the user chose something

//  deal with it

end if​

​I'm doing that from memory so the syntax may need tweaking but that's how
easy it is. ​



> Also, what is a “form object array” ?
>
​If you were displaying the array itself (though I don't know why you
wouldn't put it in a listbox) you ​could let that be a dynamic variable 4D
manages and you just copy your array to it.

>
> I like process variables on forms because they can proxy for a numeric ID
> and provide realtime state feedback via a paired array which makes the data
> entry process very reliable. But maybe there are better approaches that
> acheive the same result - just got many old habit like that ;)
>
You can just as easily do the sorts of things you mention without process
vars - you just have to build the form to accommodate.

​This may come down to one of those issues of taste and style of
programming. I want forms to be as self-contained and modular as possible.
This is really important working with subforms but it's also a good design
principle, I think. For one thing it makes it easier to actually test the
functionality of form actions. I'm not talking about things like drawing
variables or fields but testing what the form does to the data.

I think the 'old habit' comes from learning to work with 4D years ago when
you had to load all sorts of stuff into arrays and variables to get a
decently fast user experience. You can achieve those things now with a
different approach and tools that weren't available then.

-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Form objects remaining disabled between forms

2016-09-17 Thread Peter Jakobsson
…just an update to this phenomenon.

I can’t reproduce it in a new database. 4D does seem to reset the enabled state 
between forms with all else eliminated.

So it may be some other factor. Will investigate.

Peter

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

Re: Form objects remaining disabled between forms

2016-09-17 Thread Peter Jakobsson

On 17 Sep 2016, at 18:17, Kirk Brooks  wrote:

> Instead I'd copy it to
> either a menu or a form object array when the user clicks on it

Hi Kirk

That sounds interesting. Do you mean present the menu as a button and then 
display the pop-up menu dynamically when the user clicks on the button ?

Also, what is a “form object array” ?

I like process variables on forms because they can proxy for a numeric ID and 
provide realtime state feedback via a paired array which makes the data entry 
process very reliable. But maybe there are better approaches that acheive the 
same result - just got many old habit like that ;)

Peter

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

Re: Form objects remaining disabled between forms

2016-09-17 Thread Kirk Brooks
Peter,
I'd stop putting the actual variable on any form. Instead I'd copy it to
either a menu or a form object array when the user clicks on it, get the
user choice, process it and let it go. Unless your array is really big (in
which case it's not a good candidate for such a pop up anyway) there is no
performance issue.

This is really an example of why moving away from displaying process vars
on forms is a good idea.

On Sat, Sep 17, 2016 at 9:11 AM, Peter Jakobsson 
wrote:

> What do other people do to address this ? (Or am I missing something in
> front of my nose).
>

-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Form objects remaining disabled between forms

2016-09-17 Thread Peter Jakobsson
Hi

This is a phenomenon I (we ?) have lived with for a couple of centuries and 
just thought I’d bring it up for discussion since the new OBJECT SET ENABLED 
command seems to inherit the old behaviour.

Lets say you have a text array process variable manifesting as a pop-up menu on 
one form and you disable it on that form.

If you then open a different form which uses that same variable in a pop-up 
menu, it remains disabled there as well. 4D never seems to reset the enabled 
state to some default. What this means is that I always have to explicitly set 
pop-up menus to “enabled” in the On Load phase, even though there may be no 
state management required in a particular form.

What do other people do to address this ? (Or am I missing something in front 
of my nose).

Regards !

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