B4J Question Change Object reference by code

Pelky

Active Member
Licensed User
Longtime User
I have a number (many) decription objects on a screen and depending on the contents
of another field I need to change the contents of some other object:-

desc1.text desc2.text desc3.text desc4.text ......(many) ......

MyDescription needs to update desc3.text ....

Is there a way for me to create the reference using code?
 

Pelky

Active Member
Licensed User
Longtime User
Sorry not sure how to describe sections of B4X ...

I have a number of 'labels' - basically they look like column headers that need to change based on the information that I get
from reading a list. Also other Labels - loads of them that need to change
 
Upvote 0

Pelky

Active Member
Licensed User
Longtime User
okay now if you have lots of them :-
desc1.text
desc2.text
desc3.text
..
.
and want one line of code to change one of them - say desc2.text
desc?.text = "fred"
 
Upvote 0

Pelky

Active Member
Licensed User
Longtime User
Depends on how you are going to select the one you want to change. You can use Sender in an event, or look the object instance up from a Map or ....

More information needed, the possibilities are too wide.
i have a pane which contains many panes within it. About 40 panes. Each pane has 5 labels within it. All the labels are defined in a specific order.
When I read the list there will be records which are to be held in specific panes depending the record.
What I want to do update a specific panes contents
 
Upvote 0

Pelky

Active Member
Licensed User
Longtime User
a list created from an sql table of bookings made. I read the sql table and create a list.
The list contains (amongst other info) a Booth Name, A booking Reference, Time of booking etc. of bookings made. I have a screen which contains
a panel for each available booking place. I read the table of bookings made and need to place them in the specific pane holders so there may be gaps where
bookings have not been made and are available.
 
Upvote 0

Pelky

Active Member
Licensed User
Longtime User
Hey HO I have cracked it - the solution i have used may not be elegant but it works.
Activity.GetAllViewsRecursive
find the label i want and then change it to the what I want it to be.

Thank you so much for your help agraham - your assistance was much appreciated.
 
Upvote 0
Top