Re: List box edit questions

2017-11-23 Thread CostCon NZ via 4D_Tech
Hi  John

That is good to hear - I am working in v13.5 + v16.2

Regards

Jocelyn

On Fri, Nov 24, 2017 at 11:21 AM, CostCon NZ <4d.jocel...@gmail.com> wrote:

> Hi John
>
> Should be in the entry theme of the property list of the array on the list
> box.
>
> Regards
>
> Jocelyn
>
> On Fri, Nov 24, 2017 at 10:21 AM, John Baughman via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>> Jocelyn,
>>
>> Thanks, however, after checking Focusable I can’t find a “cells
>> column” or anything that sys “Enterable". Are we still in the Property list?
>>
>> John
>>
>> > On Nov 23, 2017, at 10:57 AM, CostCon NZ via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>> >
>> > "The docs says that in order for a list box cell to be enterable the
>> cell’s
>> > column must have been set to Enterable. How do you do that?"
>> >
>> >
>> >
>> > On the list box properties ensure in the Entry theme that the focusable
>> > check box is ticked. Then you can see and then click enterable checkbox
>> on
>> > the cells column.
>> >
>> >
>> >
>> > Hope this helps
>> >
>> >
>> >
>> > Regards
>> >
>> >
>> >
>> > Jocelyn
>> >
>> > On Fri, Nov 24, 2017 at 8:43 AM, John Baughman via 4D_Tech <
>> > 4d_tech@lists.4d.com> wrote:
>> >
>> >> Trying to make a list box editable without any success.
>> >>
>> >> On the form the array based list box contains 1 column. The list box
>> has
>> >> the single-click edit property checked. The llist box method contains…
>> >>
>> >>
>> >> Case of
>> >>: (Form event=On Before Data Entry)
>> >>$columnPtr:=LISTBOX GET CELL POSITION(albTimesheets;$col;$row)
>> >>If ($col=1)
>> >>   $0:=-1
>> >>End if
>> >>
>> >> End case
>> >>
>> >> On load I am adding a bunch of columns like this…
>> >>
>> >> For ($k;1;Day of($lastDayOfMonth))
>> >> $Last:=LISTBOX Get number of columns(albTimesheets)+1
>> >> $arrayPtr:=Get pointer("aDay"+String($K))-
>> >> LISTBOX INSERT COLUMN(albTimesheets;$Last;"
>> >> Day"+String($k);$arrayPtr->;"Day"+String($k)+"Header";$nillPtr->)
>> >> LISTBOX SET COLUMN WIDTH(*;"Day"+String($k);$colWidth)
>> >> OBJECT SET FORMAT(*;"Day"+String($k);"###,###.00;;")
>> >> OBJECT SET FONT SIZE(*;"Day"+String($k);11)
>> >> OBJECT SET HORIZONTAL ALIGNMENT(*;"Day"+String($k);Align center)
>> >> OBJECT SET TITLE(*;"Day"+String($k)+"Header";Padbeforev_Jut
>> >> (String($k);0;1))
>> >>
>> >> End for
>> >>
>> >> When I click column 1 the row is selected, as expected. When I click a
>> >> column cell, however, nothing happens. the currently selected row
>> remains
>> >> selected and the cell does not go into editing mode.
>> >>
>> >> Do I need to do something in the On Before Data Entry event to get into
>> >> the cell?
>> >>
>> >> The docs says that in order for a list box cell to be enterable the
>> cell’s
>> >> column must have been set to Enterable. How do you do that? I tried
>> adding
>> >> an Object Set Enterable  to the for loop adding the columns…
>> >>
>> >> OBJECT SET ENTERABLE(*;"Day"+String($k);True)
>> >>
>> >> Any help is appreciated.
>> >>
>> >> John
>> >>
>> >> John Baughman
>> >> Kailua, Hawaii
>> >> (808) 262-0328
>> >> john...@hawaii.rr.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
>> >> **
>> > **
>> > 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
>> > **
>>
>> John Baughman
>> Kailua, Hawaii
>> (808) 262-0328
>> john...@hawaii.rr.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
>> **
>>
>
>
**
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: List box edit questions

2017-11-23 Thread John Baughman via 4D_Tech
Jocely,

Got it now. This is v16 R4. Maybe the property list is different now. 
All I needed to do was check the focusable checkbox and as long as the 
single-click edit check box is checked it works.

Thanks again.

John


> On Nov 23, 2017, at 11:21 AM, John Baughman  wrote:
> 
> Jocelyn,
> 
>   Thanks, however, after checking Focusable I can’t find a “cells column” 
> or anything that sys “Enterable". Are we still in the Property list?
> 
> John
> 
>> On Nov 23, 2017, at 10:57 AM, CostCon NZ via 4D_Tech <4d_tech@lists.4d.com 
>> > wrote:
>> 
>> "The docs says that in order for a list box cell to be enterable the cell’s
>> column must have been set to Enterable. How do you do that?"
>> 
>> 
>> 
>> On the list box properties ensure in the Entry theme that the focusable
>> check box is ticked. Then you can see and then click enterable checkbox on
>> the cells column.
>> 
>> 
>> 
>> Hope this helps
>> 
>> 
>> 
>> Regards
>> 
>> 
>> 
>> Jocelyn
>> 
>> On Fri, Nov 24, 2017 at 8:43 AM, John Baughman via 4D_Tech <
>> 4d_tech@lists.4d.com > wrote:
>> 
>>> Trying to make a list box editable without any success.
>>> 
>>> On the form the array based list box contains 1 column. The list box has
>>> the single-click edit property checked. The llist box method contains…
>>> 
>>> 
>>> Case of
>>>: (Form event=On Before Data Entry)
>>>$columnPtr:=LISTBOX GET CELL POSITION(albTimesheets;$col;$row)
>>>If ($col=1)
>>>   $0:=-1
>>>End if
>>> 
>>> End case
>>> 
>>> On load I am adding a bunch of columns like this…
>>> 
>>> For ($k;1;Day of($lastDayOfMonth))
>>> $Last:=LISTBOX Get number of columns(albTimesheets)+1
>>> $arrayPtr:=Get pointer("aDay"+String($K))-
>>> LISTBOX INSERT COLUMN(albTimesheets;$Last;"
>>> Day"+String($k);$arrayPtr->;"Day"+String($k)+"Header";$nillPtr->)
>>> LISTBOX SET COLUMN WIDTH(*;"Day"+String($k);$colWidth)
>>> OBJECT SET FORMAT(*;"Day"+String($k);"###,###.00;;")
>>> OBJECT SET FONT SIZE(*;"Day"+String($k);11)
>>> OBJECT SET HORIZONTAL ALIGNMENT(*;"Day"+String($k);Align center)
>>> OBJECT SET TITLE(*;"Day"+String($k)+"Header";Padbeforev_Jut
>>> (String($k);0;1))
>>> 
>>> End for
>>> 
>>> When I click column 1 the row is selected, as expected. When I click a
>>> column cell, however, nothing happens. the currently selected row remains
>>> selected and the cell does not go into editing mode.
>>> 
>>> Do I need to do something in the On Before Data Entry event to get into
>>> the cell?
>>> 
>>> The docs says that in order for a list box cell to be enterable the cell’s
>>> column must have been set to Enterable. How do you do that? I tried adding
>>> an Object Set Enterable  to the for loop adding the columns…
>>> 
>>> OBJECT SET ENTERABLE(*;"Day"+String($k);True)
>>> 
>>> Any help is appreciated.
>>> 
>>> John
>>> 
>>> John Baughman
>>> Kailua, Hawaii
>>> (808) 262-0328
>>> john...@hawaii.rr.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
>>> **
>> **
>> 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 
>> 
>> **
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com 
> 
> 
> 
> 
> 

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.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: List box edit questions

2017-11-23 Thread John Baughman via 4D_Tech
Jocelyn,

Thanks, however, after checking Focusable I can’t find a “cells column” 
or anything that sys “Enterable". Are we still in the Property list?

John

> On Nov 23, 2017, at 10:57 AM, CostCon NZ via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> "The docs says that in order for a list box cell to be enterable the cell’s
> column must have been set to Enterable. How do you do that?"
> 
> 
> 
> On the list box properties ensure in the Entry theme that the focusable
> check box is ticked. Then you can see and then click enterable checkbox on
> the cells column.
> 
> 
> 
> Hope this helps
> 
> 
> 
> Regards
> 
> 
> 
> Jocelyn
> 
> On Fri, Nov 24, 2017 at 8:43 AM, John Baughman via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Trying to make a list box editable without any success.
>> 
>> On the form the array based list box contains 1 column. The list box has
>> the single-click edit property checked. The llist box method contains…
>> 
>> 
>> Case of
>>: (Form event=On Before Data Entry)
>>$columnPtr:=LISTBOX GET CELL POSITION(albTimesheets;$col;$row)
>>If ($col=1)
>>   $0:=-1
>>End if
>> 
>> End case
>> 
>> On load I am adding a bunch of columns like this…
>> 
>> For ($k;1;Day of($lastDayOfMonth))
>> $Last:=LISTBOX Get number of columns(albTimesheets)+1
>> $arrayPtr:=Get pointer("aDay"+String($K))-
>> LISTBOX INSERT COLUMN(albTimesheets;$Last;"
>> Day"+String($k);$arrayPtr->;"Day"+String($k)+"Header";$nillPtr->)
>> LISTBOX SET COLUMN WIDTH(*;"Day"+String($k);$colWidth)
>> OBJECT SET FORMAT(*;"Day"+String($k);"###,###.00;;")
>> OBJECT SET FONT SIZE(*;"Day"+String($k);11)
>> OBJECT SET HORIZONTAL ALIGNMENT(*;"Day"+String($k);Align center)
>> OBJECT SET TITLE(*;"Day"+String($k)+"Header";Padbeforev_Jut
>> (String($k);0;1))
>> 
>> End for
>> 
>> When I click column 1 the row is selected, as expected. When I click a
>> column cell, however, nothing happens. the currently selected row remains
>> selected and the cell does not go into editing mode.
>> 
>> Do I need to do something in the On Before Data Entry event to get into
>> the cell?
>> 
>> The docs says that in order for a list box cell to be enterable the cell’s
>> column must have been set to Enterable. How do you do that? I tried adding
>> an Object Set Enterable  to the for loop adding the columns…
>> 
>> OBJECT SET ENTERABLE(*;"Day"+String($k);True)
>> 
>> Any help is appreciated.
>> 
>> John
>> 
>> John Baughman
>> Kailua, Hawaii
>> (808) 262-0328
>> john...@hawaii.rr.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
>> **
> **
> 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
> **

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.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
**

Listbox resize

2017-11-23 Thread Peter Mew via 4D_Tech
Hi
I have a Listbox with 8 columns.
The Listbox and all the columns are set to grow horizontally
The Listbox will grow when resized to the right, but it wont shrink if
pulled to the left.
How can I make it do that
The Listbox is in a type 8 window.
4D v13 Mac Yosemite

thanks
-pm
**
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
**

List box edit questions

2017-11-23 Thread John Baughman via 4D_Tech
Trying to make a list box editable without any success. 

On the form the array based list box contains 1 column. The list box has the 
single-click edit property checked. The llist box method contains…


Case of 
: (Form event=On Before Data Entry)
$columnPtr:=LISTBOX GET CELL POSITION(albTimesheets;$col;$row)
If ($col=1)
   $0:=-1
End if 

End case 

On load I am adding a bunch of columns like this…

For ($k;1;Day of($lastDayOfMonth))  
 $Last:=LISTBOX Get number of columns(albTimesheets)+1
 $arrayPtr:=Get pointer("aDay"+String($K))-
 LISTBOX INSERT 
COLUMN(albTimesheets;$Last;"Day"+String($k);$arrayPtr->;"Day"+String($k)+"Header";$nillPtr->)
 LISTBOX SET COLUMN WIDTH(*;"Day"+String($k);$colWidth)
 OBJECT SET FORMAT(*;"Day"+String($k);"###,###.00;;")
 OBJECT SET FONT SIZE(*;"Day"+String($k);11)
 OBJECT SET HORIZONTAL ALIGNMENT(*;"Day"+String($k);Align center)
 OBJECT SET TITLE(*;"Day"+String($k)+"Header";Padbeforev_Jut 
(String($k);0;1))

End for

When I click column 1 the row is selected, as expected. When I click a column 
cell, however, nothing happens. the currently selected row remains selected and 
the cell does not go into editing mode.

Do I need to do something in the On Before Data Entry event to get into the 
cell?

The docs says that in order for a list box cell to be enterable the cell’s 
column must have been set to Enterable. How do you do that? I tried adding an 
Object Set Enterable  to the for loop adding the columns…

 OBJECT SET ENTERABLE(*;"Day"+String($k);True)

Any help is appreciated.

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.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: Subform initialize logic

2017-11-23 Thread Kirk Brooks via 4D_Tech
Piotr,

On Thu, Nov 23, 2017 at 11:01 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have to do this “On Page Change”
>
​Yep, this is exactly the sort of situation that makes having the subform
config code in a process method useful - the subform doesn't need to even
know what page it's on because the parent form is controlling when it
configures itself. ​

​Is it the case your subform on page 2 changes configuration while the
parent form is displayed?​


-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
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: Subform initialize logic

2017-11-23 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi Kirk,

Thanks for your comprehensive explanation.
I think I am on the right track.
A lot of things you are saying I am already doing, based on some example 
components

My widget is a “custom dropdown list” widget
I am converting system dropdown lists to this widget
The system dropdowns are populated by arrays in the form on load event
However, in the process of converting, I have to remember that populating the 
custom ones on load has no effect when the widget is not on page 0 or 1
I have to do this “On Page Change”

Gr,

Piotr


Piotr,

On Thu, Nov 23, 2017 at 5:14 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_t...@xxx.xxx> wrote:

> As I understand correctly, when not on page 1, this subform is only
> initialized when the page is loaded
>

​I assume you are talking about a subform you placed in the design
environment and not one where you used OBJECT SET SUBFORM.
I'll also assume by "initialized" you mean it fires an On load form event.

When and how often a subform gets the On Load form event depends on what
page it's on, as you have noticed.
If the subform is on:

page 0 - On Load ONLY the first time the parent form is loaded
page 1 - When the form is loaded AND each time you re-load page 1
(assuming the parent form has more than 1 page)
page 2+ - Each time that page is loaded - which means each time you use
GOTO PAGE (n)


​You can see this for yourself: make a simple subform with a single
variable. The form method simply writes the form event to this variable and
then calls the parent method. Make a 2 page form and put this subform on
Page 0, 1 and 2 (label them to keep them straight). Load the parent form
and watch the how each form event is handled.


> In my widget I have an attribute defined called "enabled"
> When using a dropdown for example, I can disable the dropdown "On load",
> even when the dropdown is on page 2
> Because the widget is not initialized on load (because it is on page 2), I
> have to "remember" the disabled state in a variable, or re-execute the
> disable logic, when changing to page 2
>
​
Now we're talking about strategies for managing subforms. As with most
things 4D there isn't a single strategy that's 'best' for every situation
and especially with subforms because they can be used in so many different
ways. ​With that in mind my preferred strategy for handling subform config
is to put the subform config in a process method and call it from the
parent form.

There's no rule that says the subform has to initialize itself or if it
does the code has to be in the subform method. Sometimes it's easier if you
control when this happens. So just move all the subform config code to a
process method and call it using EXECUTE METHOD IN
SUBFORM("subform";"Subform_config_method"). A bonus here is you can pass
params, like a c-obj, to dial in the setup. You can also call it from the
subform method if you need to.

​This is especially handy if, as you describe, you want to do all the
config while the parent form is loading. This way you can. ​Or to circle
back to the case of using OBJECT SET SUBFORM this is a reliable way to
handle config.

While trying to eliminate variables I have to introduce others. This
> doesn't make sense to me
>
​True but it's a matter of scope. ​A subform, especially a widget, is like
a mini-process within the parent form that can have its own variables and
it's own set of form events it responds to. That can be quite useful but it
means you have to have a little more infrastructure on the subform to take
advantage of it. Again a couple of strategies:

you can have invisible subform variables

you can use duplicate object to populate a subform with specific objects

you can use the parent form object as the data object

​#3 is especially useful in v16 since the subform object can be a c-object.
​In your specific case I bet you already have a form boolean var called
'enabled'. You know it doesn't have to be visible and it doesn't have to be
big - you can set it's coords to 0 width and 0 height.

Gr,
>
​Hope this gives you some ideas.
​
--
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
**

File Paths to Hierarchical List

2017-11-23 Thread Douglas von Roeder via 4D_Tech
I want to display the content of the array from Document list in a
hierarchical list.

I've checked the knowledge base and 4D Today looking for code or a
component to do this but am not finding anything.

Does anyone have code for this or, perhaps, can point to a source for that
code?

--
Douglas von Roeder
949-336-2902
**
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: Subform initialize logic

2017-11-23 Thread Kirk Brooks via 4D_Tech
Piotr,

On Thu, Nov 23, 2017 at 5:14 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> As I understand correctly, when not on page 1, this subform is only
> initialized when the page is loaded
>

​I assume you are talking about a subform you placed in the design
environment and not one where you used OBJECT SET SUBFORM.
I'll also assume by "initialized" you mean it fires an On load form event.

When and how often a subform gets the On Load form event depends on what
page it's on, as you have noticed.
If the subform is on:

page 0 -   On Load ONLY the first time the parent form is loaded
page 1 -   When the form is loaded AND each time you re-load page 1
(assuming the parent form has more than 1 page)
page 2+ - Each time that page is loaded - which means each time you use
GOTO PAGE (n)


​You can see this for yourself: make a simple subform with a single
variable. The form method simply writes the form event to this variable and
then calls the parent method. Make a 2 page form and put this subform on
Page 0, 1 and 2 (label them to keep them straight). Load the parent form
and watch the how each form event is handled.


> In my widget I have an attribute defined called "enabled"
> When using a dropdown for example, I can disable the dropdown "On load",
> even when the dropdown is on page 2
> Because the widget is not initialized on load (because it is on page 2), I
> have to "remember" the disabled state in a variable, or re-execute the
> disable logic, when changing to page 2
>
​
Now we're talking about strategies for managing subforms. As with most
things 4D there isn't a single strategy that's 'best' for every situation
and especially with subforms because they can be used in so many different
ways. ​With that in mind my preferred strategy for handling subform config
is to put the subform config in a process method and call it from the
parent form.

There's no rule that says the subform has to initialize itself or if it
does the code has to be in the subform method. Sometimes it's easier if you
control when this happens. So just move all the subform config code to a
process method and call it using EXECUTE METHOD IN
SUBFORM("subform";"Subform_config_method"). A bonus here is you can pass
params, like a c-obj, to dial in the setup. You can also call it from the
subform method if you need to.

​This is especially handy if, as you describe, you want to do all the
config while the parent form is loading. This way you can. ​Or to circle
back to the case of using OBJECT SET SUBFORM this is a reliable way to
handle config.

While trying to eliminate variables I have to introduce others. This
> doesn't make sense to me
>
​True but it's a matter of scope. ​A subform, especially a widget, is like
a mini-process within the parent form that can have its own variables and
it's own set of form events it responds to. That can be quite useful but it
means you have to have a little more infrastructure on the subform to take
advantage of it. Again a couple of strategies:

you can have invisible subform variables

you can use duplicate object to populate a subform with specific objects

you can use the parent form object as the data object

​#3 is especially useful in v16 since the subform object can be a c-object.
​In your specific case I bet you already have a form boolean var called
'enabled'. You know it doesn't have to be visible and it doesn't have to be
big - you can set it's coords to 0 width and 0 height.

Gr,
>
​Hope this gives you some ideas.
​
-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
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
**

Subform initialize logic

2017-11-23 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi,

4D v16.2
I am using a subform in my app (a widget)
As I understand correctly, when not on page 1, this subform is only initialized 
when the page is loaded
In my widget I have an attribute defined called "enabled"
When using a dropdown for example, I can disable the dropdown "On load", even 
when the dropdown is on page 2
Because the widget is not initialized on load (because it is on page 2), I have 
to "remember" the disabled state in a variable, or re-execute the disable 
logic, when changing to page 2

Am I correct in this? Or am I missing something.
While trying to eliminate variables I have to introduce others. This doesn't 
make sense to me

Gr,

Piotr
**
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
**