NetTalk Central

Author Topic: refresh control  (Read 5448 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
refresh control
« on: May 16, 2010, 08:14:07 PM »
Hi All,

I have a browse embedded in a form. I have tagging on the browse records. I have added a field to the form called TotalSelectedRecords and made this read only.

I would like to update/refresh this field when the user tags a record.

Is this possible?

Cheers,

Kevin

kashiash

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Email
Re: refresh control
« Reply #1 on: May 16, 2010, 09:26:34 PM »
on tagging column you have a server side code, there you can call routines for refresh value in this field
do Value::FieldToBeRefreshed

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: refresh control
« Reply #2 on: May 16, 2010, 09:41:43 PM »
My problem is that the total field is on the form not the browse - I don't think I can refresh a field on the form by an action on the browse.

I'm playing around with the custom total on the templates which is part of the browse footer as I may be able to just display the total there instead.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: refresh control
« Reply #3 on: May 16, 2010, 10:15:58 PM »
Hi Kevin,

From memory - you can refresh other fields on the form using the Client side tab. It should work for a browse just like any other field.

cheers
Bruce

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: refresh control
« Reply #4 on: May 16, 2010, 10:51:09 PM »
The Tag Field is on the browse.
The SelectedTotal Field is on the form.
None of the fields on the form appear on the client side tab in the browse.
Clicking the Tag checkbox is the event to recalc selected records and refresh the selectedtotal on the form.

Is there a way to detect if the user has checked/unchecked the tag in the browse from the form?

Cheers,

Kev

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: refresh control
« Reply #5 on: May 17, 2010, 08:24:55 AM »
i,ve not used tags, but done something similar for totals.
if in your browse you get the total to a sessionvalue.  Then on your netwebform you can get to your embedded browse referenced as a field and then reset the things(yourtotalfield) on your form (send to server, servercode etc) - when the browse is clicked.
(its been a while and i recall i had to add some additional code to ensure it was acurate in all circumstances)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: refresh control
« Reply #6 on: May 17, 2010, 03:06:38 PM »
Thanks Poul. I had missed the Client Side Tab for the Browse. My problem now is that it refreshes the total field before I have calculated the total so it is always off by one records amount.

Any suggestions?

Cheers,

Kevin

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: refresh control
« Reply #7 on: May 26, 2010, 09:36:26 AM »
i recall it  a challenge - i had somethings that was ok but was able to compartmentalize (the total on the first tab) and the browse was on a second tab - which allowed me to cheat.

My final solution was:   because i was using sql I opted to fire a stored procedure - but you could do the same in clarion i suppose - when the browse updated something I would recalculate my own total and update a sessionvalue.  and do this same logic when i opened the form - so the session value would always be accurate.  Tags my be different but the info must be persisted somewhere - so i'd say recalc/count them

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: refresh control
« Reply #8 on: May 31, 2010, 07:16:27 PM »
I think I either need to switch off Async or add a timer before it refreshes the selected records total field.

Anyone know how to switch Async on and off?

Cheers,

Kev