TabPanel - Counter on tab text

Forum to discuss the new web client version of Servoy.

TabPanel - Counter on tab text

Postby tgs » Thu Dec 20, 2018 12:10 pm

I would like to have a counter on the tabs of tabpanels.

tab_counter.png


The text ist i18n. The Reference/Locale text is something like this:
Products (%%order_order_items.maxRecordIndex%%)

The problem is, that the counter is not updating while selecting different records.
How do I get the counter updated e.g. onRecordSelection?

Best regards
You do not have the required permissions to view the files attached to this post.
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: TabPanel - Counter on tab text

Postby rafig » Thu Dec 20, 2018 1:22 pm

Hi
I am doing something similar.
I have this text
Code: Select all
Services (%%client_to_contract_current.count_current%% Current)

on a tab, with 'count_current' being an aggregate on the related table
and I do
Code: Select all
databaseManager.recalculate(client_to_contract);

in the 'onRecordSelection'
Try something like that ;-)
Servoy Certified Developer
Image
rafig
 
Posts: 707
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: TabPanel - Counter on tab text

Postby tgs » Thu Dec 20, 2018 3:14 pm

Thank you @rafig for reply.

I tired your suggestion with an aggregation 'counter' on the related table and the databaseManager.recalculate(order_order_items) function in my onRecordSelection() method.
But in NG-Client it doesn't work. The counter always stuck in the first number of count.

Best regards
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: TabPanel - Counter on tab text

Postby swingman » Thu Dec 20, 2018 6:07 pm

What about setting the text property of the tab?
Code: Select all
elements.your_element_name.setTabTextAt(tab_number, 'Some text here');
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: TabPanel - Counter on tab text

Postby tgs » Thu Dec 20, 2018 6:28 pm

Hi Christian,

I cannot do this with the TabPanel - WebComponent (bootstrapcomponents-tabpanel)!

For that I can create/add the tabs to the tabpanel by function, but not only the tab text.
In my case I have to set the tabs property on the form because of needed relations setting.


Best regards
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: TabPanel - Counter on tab text

Postby rafig » Fri Dec 21, 2018 7:34 pm

tgs wrote:Thank you @rafig for reply.

I tired your suggestion with an aggregation 'counter' on the related table and the databaseManager.recalculate(order_order_items) function in my onRecordSelection() method.
But in NG-Client it doesn't work. The counter always stuck in the first number of count.

Best regards

Not sure why, but maybe add an 'application.updateUI();' as well??
What I'm doing works for me in NG...
Servoy Certified Developer
Image
rafig
 
Posts: 707
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: TabPanel - Counter on tab text

Postby rafig » Tue Jan 22, 2019 7:53 pm

Just updating my previous post, but it is now NOT working :(
Not sure why, maybe because I have updated to latest version of Servoy, 8.4, along with associated web components update, or something else.

@Thomas, did you find a working solution?

If I manage to fix, I will post again...
Servoy Certified Developer
Image
rafig
 
Posts: 707
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: TabPanel - Counter on tab text

Postby tgs » Tue Jan 22, 2019 9:00 pm

I'm currently also on Servoy 8.4 and have always no working solution.
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 6 guests