Ronald Hofmann | 17 Jun 2012 13:22
Picon

Re: What's the widget's variable name?

mh, may be I don't understand what the problem is.
But anytime I want to know the variable name in a GUI I use Self which gives
you a pointer to the variable.
Very simple and reliable.

Any reason why this simple solution is not working?

GR
---

--
View this message in context: http://4d.1045681.n5.nabble.com/What-s-the-widget-s-variable-name-tp5714084p5714095.html
Sent from the 4D Tech mailing list archive at Nabble.com.

**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

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

Pat Bensky | 18 Jun 2012 01:36
Picon

Re: What's the widget's variable name?

Self is deprecated in v12. It's replaced by Object Current or Focus Object
or whatever.
The problem is that the variable is dynamic. Yes, Self gives you a pointer
to the variable. But I need to find out WHICH variable the pointer refers
to and whether it is the search object variable. But I don't know what the
search object variable's name is because its name is assigned dynamically
each time the form is loaded. So one time the variable might be
called $form.5.C and another time it might be $form.9.C or $form.10.C or
whatever. I do not care what the CONTENT of the variable is. I need to know
if the variable whose data was just modified is the search object variable,
which might be named $form.9.C or $form.5.C or something else..

PB

On 17 June 2012 12:22, Ronald Hofmann <prolog@...> wrote:

> mh, may be I don't understand what the problem is.
> But anytime I want to know the variable name in a GUI I use Self which
> gives
> you a pointer to the variable.
> Very simple and reliable.
>
> Any reason why this simple solution is not working?
>
> GR
> ---
>
> --
> View this message in context:
> http://4d.1045681.n5.nabble.com/What-s-the-widget-s-variable-name-tp5714084p5714095.html
(Continue reading)

David Dancy | 18 Jun 2012 01:54
Picon

Re: What's the widget's variable name?

If you know the search object's Object Name, you can match that with the
object's Variable Name using FORM GET OBJECTS.

(Caveat: haven't tried it doing what you're doing though).

David Dancy
Sydney, Australia

On 18 June 2012 09:36, Pat Bensky <pbensky@...> wrote:

> Self is deprecated in v12. It's replaced by Object Current or Focus Object
> or whatever.
> The problem is that the variable is dynamic. Yes, Self gives you a pointer
> to the variable. But I need to find out WHICH variable the pointer refers
> to and whether it is the search object variable. But I don't know what the
> search object variable's name is because its name is assigned dynamically
> each time the form is loaded. So one time the variable might be
> called $form.5.C and another time it might be $form.9.C or $form.10.C or
> whatever. I do not care what the CONTENT of the variable is. I need to know
> if the variable whose data was just modified is the search object variable,
> which might be named $form.9.C or $form.5.C or something else..
>
> PB
>
> On 17 June 2012 12:22, Ronald Hofmann <prolog@...> wrote:
>
> > mh, may be I don't understand what the problem is.
> > But anytime I want to know the variable name in a GUI I use Self which
> > gives
> > you a pointer to the variable.
(Continue reading)

Pat Bensky | 18 Jun 2012 08:30
Picon

Re: What's the widget's variable name?

Nope - doesn't work because (I guess) the variable that you enter the
search into, which is PART of the search object, is on a subform.

PB

On 18 June 2012 00:54, David Dancy <david.dancy@...> wrote:

> If you know the search object's Object Name, you can match that with the
> object's Variable Name using FORM GET OBJECTS.
>
> (Caveat: haven't tried it doing what you're doing though).
>
> David Dancy
> Sydney, Australia
>
>
> On 18 June 2012 09:36, Pat Bensky <pbensky@...> wrote:
>
> > Self is deprecated in v12. It's replaced by Object Current or Focus
> Object
> > or whatever.
> > The problem is that the variable is dynamic. Yes, Self gives you a
> pointer
> > to the variable. But I need to find out WHICH variable the pointer refers
> > to and whether it is the search object variable. But I don't know what
> the
> > search object variable's name is because its name is assigned dynamically
> > each time the form is loaded. So one time the variable might be
> > called $form.5.C and another time it might be $form.9.C or $form.10.C or
> > whatever. I do not care what the CONTENT of the variable is. I need to
(Continue reading)

Keisuke Miyako | 18 Jun 2012 02:40

Re: What's the widget's variable name?


On 2012/06/18, at 8:36, Pat Bensky wrote:

> Self is deprecated in v12. It's replaced by Object Current or Focus Object
> or whatever.
> The problem is that the variable is dynamic. Yes, Self gives you a pointer
> to the variable. But I need to find out WHICH variable the pointer refers
> to and whether it is the search object variable. But I don't know what the
> search object variable's name is because its name is assigned dynamically
> each time the form is loaded.

again, that is not a problem at all.
we don't need to know the name of a dynamic variable, ever.

I think the real problem is that,
if I understand correctly,
you prefer to put all code in the form method, not the object method.

the whole point of using widgets is that it abstracts a collection of form objects and represent it as a
single variable.

you really shouldn't care about what event fired in which object inside the widget, at all.
it could be On Data Change, On After Edit, On Click, On Double Click, On Timer...
but the bottom line is, regardless of what really happened inside the widget,
if the event qualifies as updating the bounding variable,
an On Data Change event is sent to the container.

in your case, the actual event that fired inside the widget happens to be On Data Change,
which is a bit confusing,
but I think the search picker catches On After Edit as well,
(Continue reading)

Ronald Hofmann | 18 Jun 2012 05:16
Picon

Re: What's the widget's variable name?

Hi Pat,
thanks for your explanation, I missed that Self is deprecated ;)
On the other hand I agree with Miyako. To me it sounds like you see a
problem which actually doesn´t exist.

Although it doesn't seem to be quit forward how to use this widget.

Ronald
---

--
View this message in context: http://4d.1045681.n5.nabble.com/What-s-the-widget-s-variable-name-tp5714084p5714108.html
Sent from the 4D Tech mailing list archive at Nabble.com.

**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

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

Jérôme Pupier | 18 Jun 2012 05:35
Picon
Gravatar

Re: What's the widget's variable name?

Hi all,

Self is not deprecated at all.. It's exactly the same command as
Object get pointer. Both commad do exactly the same thing
As you may have noticed, Self command has not been converted to
'Object get pointer' in your old code when converting to v12. 'Object
get pointer' is a new command that respect new naming rules.

'Self' has been kept because it is far more easy to write than the
'Object get pointer'. I usually use the first without parameter and
use the second with parameters.
//
$ptr1:=Self
$ptr2:=OBJECT Get pointer(Object named;"Button15")
//
Even if I don't recommand this syntax,  you can do the following, it works fine

$ptr1:=Self(Object named;"Button15")
$ptr2:=OBJECT Get pointer(Object named;"Button15")

Amicalement,

Jérôme
----------------------------------------------
Your ad here.. Call the frontdesk
----------------------------------------------

On Mon, Jun 18, 2012 at 1:16 PM, Ronald Hofmann <prolog@...> wrote:
> Hi Pat,
> thanks for your explanation, I missed that Self is deprecated ;)
(Continue reading)

Ronald Hofmann | 18 Jun 2012 05:46
Picon

Re: What's the widget's variable name?

Well, the manual says:
This command is kept only for compatibility reasons.
Starting with version 12 of 4D, it is recommended to use the OBJECT Get
pointer command.

This means, that sometime in the future, it will be killed. 
Thats the way 4D did it in the past.

Ronald
---

--
View this message in context: http://4d.1045681.n5.nabble.com/What-s-the-widget-s-variable-name-tp5714084p5714110.html
Sent from the 4D Tech mailing list archive at Nabble.com.

**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

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

Jérôme Pupier | 18 Jun 2012 06:02
Picon
Gravatar

Re: What's the widget's variable name?

> This means, that sometime in the future, it will be killed.
Pretty sure it will not.. Otherwise, the new command would have taken
the place/number of the old one..

Amicalement,

Jérôme
----------------------------------------------
Your ad here.. Call the frontdesk
----------------------------------------------

On Mon, Jun 18, 2012 at 1:46 PM, Ronald Hofmann <prolog@...> wrote:
> Well, the manual says:
> This command is kept only for compatibility reasons.
> Starting with version 12 of 4D, it is recommended to use the OBJECT Get
> pointer command.
>
> This means, that sometime in the future, it will be killed.
> Thats the way 4D did it in the past.
>
> Ronald
> ---
>
> --
> View this message in context: http://4d.1045681.n5.nabble.com/What-s-the-widget-s-variable-name-tp5714084p5714110.html
> Sent from the 4D Tech mailing list archive at Nabble.com.
>
> **********************************************************************
> 4D v13 is available now - with more than 200 new features to make
> your applications richer and faster
(Continue reading)

Ronald Hofmann | 18 Jun 2012 06:15
Picon

Re: What's the widget's variable name?

I hear you, but I don´t think you are right.
We had many issues like that in the past. 

>>Otherwise, the new command would have taken...
not necessarily. Sometime 4D keeps similar commands side by side.

Ronald
---

--
View this message in context: http://4d.1045681.n5.nabble.com/What-s-the-widget-s-variable-name-tp5714084p5714112.html
Sent from the 4D Tech mailing list archive at Nabble.com.

**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

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

Pat Bensky | 18 Jun 2012 08:41
Picon

Re: What's the widget's variable name?

>
> if, for whatever reason, you need to handle it in the form method,
> then you need to first catch the event in the object method,
> then implement some way of identification so that you can tell the form
> method that the search picker is where the event took place.

Yes, exactly. I need to handle it in the form method because there is code
in the On Data Change event which sets a flag if the data in any field or
variable on the form has been modified. But I do not want that flag set if
it's the search object's field that was modified - that does not count as a
data change in this context. So I need to know the name of the search
object's field in order to know if that was what was modified. The only way
to get that (as far as I can see) is to set it when that field is modified
- i.e., in the object's On Data Change event.:

RESOLVE POINTER(Focus
object;tQuickSearchVarName;$focustablenum;$focusfieldnum)

pb

On 18 June 2012 01:40, Keisuke Miyako <Keisuke.Miyako@...> wrote:

>
>
> On 2012/06/18, at 8:36, Pat Bensky wrote:
>
> > Self is deprecated in v12. It's replaced by Object Current or Focus
> Object
> > or whatever.
> > The problem is that the variable is dynamic. Yes, Self gives you a
(Continue reading)

David Lieb | 18 Jun 2012 14:07
Picon
Favicon

Re: What's the widget's variable name?

Hi Pat,

I'm repeating what I posted before in case you misssed it.

David

On Sun, Jun 17, 2012 at 6:42 AM, David Lieb <david_lieb@...>
 wrote:

> Pat,
>
> I don't think you need to know the name of the object's variable (which
> is dynamic in this case). Knowing the name of that object itself (which
> is never dynamic) should do.
>
> So instead of
>
> RESOLVE POINTER(Focus object;$varname;$focustablenum;$focusfieldnum)
> if($varname#tSearchPickerDynamicVarName)
>   yModified:=True
> end if
>
> try
>
> $objName:=OBJECT get name(Object with focus)
> if($objName#tSearchPickerObjName)
>   yModified:=True
> end if
>
> where tSearchPickerObjName is the name of the object. I just tried
(Continue reading)


Gmane