NetTalk Central

Author Topic: Drop downs - defaulting to LAST item on list?  (Read 2976 times)

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Drop downs - defaulting to LAST item on list?
« on: October 25, 2011, 08:42:10 PM »
Hi all,

I was wondering, on a NetWebForm, when you have a 'drop down' field that is populated from an external file, is there an easy way to get the display to default show the LAST item in the file, not the first?

Reason being is that I am using some drop downs to gather information for a report filter, so I am wanting to do 'first/last' drop down selectors, with the 'first' selector showing the first item in the file and the 'last' selector showing the last item in the file.

Thanks!
Devan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Drop downs - defaulting to LAST item on list?
« Reply #1 on: October 25, 2011, 11:29:51 PM »
Hi Devan,

I guess the approach I'd take is by "priming" the two fields, one with the first value in the file, the other with the last value in the file.
ie by "priming" the actual fields, it'll "go there" in the drop list.

start on the priming tab, but you may need to add some embed code to open the file, read the last record, and so on (in the place where the priming occurs.)

cheers
Bruce


Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Drop downs - defaulting to LAST item on list?
« Reply #2 on: October 25, 2011, 11:33:22 PM »
Hi Devan,

There are priming options on a webform for both inserts and changes. It has a Set Field value where you name the use variable that is displayed on the form. Then there is a To Value value that the variable is primed with. Here you can add either a fixed value for the use variable or you can reference a procedure or class method which returns the required value.

Thys