Setting a Field to an Element Name

Questions, tips and tricks and techniques for scripting in Servoy

Setting a Field to an Element Name

Postby aklodner » Fri Sep 19, 2003 6:49 pm

Hey guys,

What I'd like to do is create a method that sets a global to the name of an element, more precisely an element that is a button. Is this possible and if so any ideas are greatly appreciated.

thanks,
Adam
aklodner
 
Posts: 26
Joined: Thu Sep 04, 2003 9:48 pm
Location: Cooper City, FL

Postby jcompagner » Mon Sep 22, 2003 11:16 pm

If you could get that name, what would you do with it?
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby aklodner » Mon Sep 22, 2003 11:28 pm

Well, in this instance, I'd like to put the element name into a global to establish a link to a related file to display related data. This would keep me from having to write several different methods whose only purpose is to set this global.
aklodner
 
Posts: 26
Joined: Thu Sep 04, 2003 9:48 pm
Location: Cooper City, FL

Postby jcompagner » Tue Sep 23, 2003 5:50 pm

I don't know what you exactly are trying to do, Are you planning to use the name of the button to lookup a relation??

But the name is FIXED in a solution so you will always show the same relation.

Can't you just add a dataproviderid to the button (so the button has then a value of the current record, which it displays) and use this value for the relation?
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby aklodner » Tue Sep 23, 2003 5:59 pm

Here's the scenario in a little more detail. I'm working on a help type file. I'd like the user to be able to click on an information graphic and have that related help record be displayed. Here's the trick, one record could have many of these type of graphics. Even though the graphic is the same, I give them each a different name so they pull up a different related record. So, your solution would work if I had only one instance of this.
aklodner
 
Posts: 26
Joined: Thu Sep 04, 2003 9:48 pm
Location: Cooper City, FL

Postby maarten » Wed Sep 24, 2003 11:27 am

hmm, pretty cool.
This way you can identify which button is clicked within a record, giving you the upportunity to attach one generic script or relation to multiple buttons.
Can be a great time saver.
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 1 guest