Change button text at runtime (part 2) / Update a button

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Change button text at runtime (part 2) / Update a button

Postby c.groefsema » Fri Jan 17, 2020 3:19 pm

Hi everyone,

If I change a button's text by means of elements.myButton.text = 'some text'; then the changed text should show up as soon as the entire call stack has finished - or so I believed. But it doesn't; the text only shows up after manually refreshing the page. It doesn't matter if I force a roundtrip to the ui by means of plugins.ngclientutils.getUserAgent(); or application.updateUI(500);. I have tried these lines of code both directly after the above line and as the last line in the entire call stack, to no avail. What am I overlooking here?

Actually, by manually refreshing the page I noticed that the appearance of the button changed as well: from a grey disabled state to a colored enabled state, which is exactly what I want. So along the way that has been taken care of; what I only seem to need is some code that performs a refresh on the button. I can call this code as soon as the text is changed, and then my troubles are over. How can I establish this?

Thank you, kind regards,
Coos
User avatar
c.groefsema
 
Posts: 26
Joined: Fri Feb 22, 2019 12:40 pm

Re: Change button text at runtime (part 2) / Update a button

Postby rafig » Fri Jan 17, 2020 8:58 pm

Coos, it might be worth clarifying what version of Servoy you are using and what type of client is running, to help the forum respond ;-)
Servoy Certified Developer
Image
rafig
 
Posts: 707
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Change button text at runtime (part 2) / Update a button

Postby c.groefsema » Mon Jan 20, 2020 9:15 am

Hi rafig,

Yes, of course, I should have done that.
I'm using Servoy version 8.2.1.3105, and it is an ng client.

Kind regards,
Coos
User avatar
c.groefsema
 
Posts: 26
Joined: Fri Feb 22, 2019 12:40 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 14 guests