Page 1 of 1

Storing Reference in model. VLWEB

Posted: Thu Sep 12, 2019 12:55 pm
by soa
I have a collection in my model and I want to store a reference to the currently selected item. When I load a List from my collection I have.

Add_Entry To_List(#List)
#List.CurrentItem.RelatedReference <= #list

And in the Item click event I want to store the selected item

#model.CurrentVisotRef <= #CurrentItem.Related Reference

My problem is in defining the property. I have

Define_Com Class(#M01VisitEntry) Name(#m_SelectedVisit)

but

Define_Pty Name(SelectedVisitRef) Get(*AUTO #m_SelectedVisit)Set(#m_SelectedVisit)

tells me #m_SelectedVisit is not a valid name. Class M01VISEN does not contain a default property

Trying to create a property Set does the same thing.

ANy ideass about what I'm doing wrong?

Re: Storing Reference in model. VLWEB

Posted: Thu Sep 12, 2019 12:59 pm
by dannyoorburg
Hi,

Aren't you just missing *AUTO in the Set?

Cheers,
Danny

Re: Storing Reference in model. VLWEB

Posted: Thu Sep 12, 2019 1:27 pm
by dannyoorburg
Ah. Just looked again. Your reference is not *dynamic either....

Re: Storing Reference in model. VLWEB

Posted: Fri Sep 13, 2019 10:39 am
by dannyoorburg
Correction (that will teach me quickly answering from my phone on the train trying to look clever :) )

Try this:

Code: Select all

Define_Com Class(#PRIM_OBJT) Name(#MyObject) Reference(*DYNAMIC)

Define_Pty Name(Object) Get(*REFERENCE #MyObject) Set(*REFERENCE #MyObject)

Re: Storing Reference in model. VLWEB

Posted: Fri Sep 13, 2019 10:51 am
by soa
Thanks Danny. That makes a difference!