Storing Reference in model. VLWEB

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
soa
Posts: 289
Joined: Mon Dec 07, 2015 3:15 pm

Storing Reference in model. VLWEB

Post by soa » Thu Sep 12, 2019 12:55 pm

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?

dannyoorburg
Posts: 152
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: Storing Reference in model. VLWEB

Post by dannyoorburg » Thu Sep 12, 2019 12:59 pm

Hi,

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

Cheers,
Danny

dannyoorburg
Posts: 152
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: Storing Reference in model. VLWEB

Post by dannyoorburg » Thu Sep 12, 2019 1:27 pm

Ah. Just looked again. Your reference is not *dynamic either....

dannyoorburg
Posts: 152
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: Storing Reference in model. VLWEB

Post by dannyoorburg » Fri Sep 13, 2019 10:39 am

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)

soa
Posts: 289
Joined: Mon Dec 07, 2015 3:15 pm

Re: Storing Reference in model. VLWEB

Post by soa » Fri Sep 13, 2019 10:51 am

Thanks Danny. That makes a difference!

Post Reply