Manage Results from SQL Searches

Questions, tips and tricks and techniques for scripting in Servoy

Postby jcompagner » Sat Feb 21, 2004 11:35 am

then why not make a formpanel that shows it self as a tableview.. And fill the table view with the data you want? (add the formpanel in a tabpanel as non related)

see http://forum.servoy.com/viewtopic.php?p=5692

I don't know what youre are selecting in the dataset of yours but if it is just one table data or data then can be accessed through a relation then above works perfectly
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby pbakker » Sat Feb 21, 2004 7:03 pm

Basically, there are two things:

First: I like the ability of Portals to reorder and resize columns + the sorting. So, it a portal could show any dataset, this functionallity can be offered in the GUI more easily.

Secondly: Some functions give back an array of data (for example getUsers). Now the only way to display this info is through HTML. Threfor, I would like to be able to format the look and feel of the HTML, but the available functions are limited. For example, I'd like the tableview in HTML to have not so thick lines as borders + It want to set the width of the A HREF component to the same width as the cell in the HTML table, thus creating a sort of "Record Selection"

So, basically, two needs, that can be combined in one sollution..

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby jcompagner » Sat Feb 21, 2004 8:11 pm

First: I like the ability of Portals to reorder and resize columns + the sorting.


tableview does all that as well...


Secondly: Some functions give back an array of data (for example getUsers).


but that will be a problem anyway.. Because for now you can only show data that can be translated to a table of one of youre servers.
And users table can't be accessed like normal data. (not permitted by us)

so you can show any kind of sql statement to a table view (see form by query for example)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby pbakker » Mon Mar 22, 2004 9:27 pm

Johan,

It's been a while, but i'm still struggling with this issue....

You say that a table view, in combination with the form by query function can display just abou anything. It probably can, but the thing is that you still have to define the displayed column in develloper....

What I'm looking for is a portal/tableview like component, that can display any dataset, without having to define the colums in Develloper first.

For example, I build myself a report generator, where I would like to add new reports all the time. I do not want to have to go to develloper to define a new form for each new report. Therefor it would be very nice to have an element (or view) where you can display any dataset, without having to define the colums first.

I know you could use an HTML field with a table, but this has the disadvantages of not being able to sort, resize etc (or you have to do major coding) + the fact that with the current HTMl area, the frmatting options are very limited....

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby jcompagner » Tue Mar 23, 2004 10:19 pm

that is just a very special component. Will add this to the planning..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby pbakker » Wed Mar 24, 2004 10:17 am

Very special, but very handy :D (according to me)

Tnx for adding it. any idea if it will make the next beta?
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby patrick » Wed Mar 24, 2004 11:16 am

same here! that would be a very powerful feature. I have long time requests by customers who want to be able to build their own lists. We could then offer to save a list layout by just saving the columns needed, a very neat feature!
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby chris » Thu Mar 25, 2004 7:03 am

Agreed - I think having this level of end-user flexibility would push Servoy into the mega-realm - I think this is what would really excite Corporate clients - not Corporate IT, but smart managers who want to stop being so reliant on IT. It's the promise FM makes but can't quite deliver on...
chris
 
Posts: 82
Joined: Wed Dec 31, 2003 8:24 pm

Postby jcompagner » Thu Mar 25, 2004 10:17 am

i don't think we can make it happen in 2.0.
but it will be on the feature list right after that..

what kind of support would you have on such a table??
because i think you want to know if a person selected/clicked on a row...
What else?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby pbakker » Thu Mar 25, 2004 10:56 am

I think that the standard portal functionallity extended with the feature to show any dataset would work great. Then again, In list view you have the OnRecordSelect trigger, which would be very handy.

To me, this would be a portal like element and not a new view (or extended existing view), since I would like the element to be able to show any dataset, regardless connection to a form.

If the element can show any dataset, it will also be possible to show a "grouped by" dataset. I know you loose the link with PK, but in my mind that is not really an issue. As a developer, you just have to realize it.

What would be very cool is that if you click your right mousebutton on the columnheader, you can trigger a method. The developer could than show a dialog, in which the user can select the columns to be shown.... (I do not know the keyboard equivalant of the right mousebutton).

Since we allready have tools to access a dataset through scripting, I do not see extra needs there....

Hope this helps...

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby patrick » Thu Mar 25, 2004 1:58 pm

in my case I'd already be happy to dynamically set dataproviders in a table view. My (FileMaker) customers have always requested to make their own lists. All they basically want is to choose the fields that show up on a list. This could be so eays since you can move and resize columns and sort on any of them. For that reason I have requested earlier to hide a column. Then I'd just make a table view with all relevant fields and just hide the un-needed. Much nicer, of course, is if a user was able to simply choose the relevant fields himself. Of course developers would need control over this, since a user might for example want to save a list layout. So for me, now, it'd be enough to have something like form.elements.addDataProvider...
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Riccardino » Thu Mar 25, 2004 6:24 pm

bcusick wrote:Paul,

What you want to end up with is a string that looks like this:

<a href="javascript:methodName()">Underline Link</a>

If you are passing a parameter to your method - then you want to end up with:

<a href="javascript:methodName('value')">Underline Link</a>

The SINGLE QUOTES with the parameter are MANDATORY.



I managed to get a formatted HTML table with a href to a method (a very powerful feature), but I don't understand HOW the destination method can actually receive the parameter: for instance, if my query gives me a list of items_id's, and I have a method that opens the form ItemDetails, how can I tell this method to retrieve the item whose id I'm clicking on?
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby pbakker » Thu Mar 25, 2004 6:35 pm

Riccardino,

did you try the example I posted in this tread?

var pkdataset = security.getUsers()
var HTML = '<html><table>' //var HTML receives all html code
for( var i = 1 ; i <= pkdataset.getMaxRowIndex() ; i++ )
{
pkdataset.rowIndex = i;
HTML += '<tr><td>'+ pkdataset[1]+'</td><td><a href="javascript:test2('+"'"+pkdataset[2]+"'"+')">'+ pkdataset[2]+'</a></td></tr>';
}
HTML += '</table></html>'
globals.userlist = HTML;

It's a lot of quotes and double quotes, but if you are carefull and copy it properly, this code does work

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Riccardino » Thu Mar 25, 2004 7:16 pm

pbakker wrote:Riccardino,

did you try the example I posted in this tread?

var pkdataset = security.getUsers()
var HTML = '<html><table>' //var HTML receives all html code
for( var i = 1 ; i <= pkdataset.getMaxRowIndex() ; i++ )
{
pkdataset.rowIndex = i;
HTML += '<tr><td>'+ pkdataset[1]+'</td><td><a href="javascript:test2('+"'"+pkdataset[2]+"'"+')">'+ pkdataset[2]+'</a></td></tr>';
}
HTML += '</table></html>'
globals.userlist = HTML;

It's a lot of quotes and double quotes, but if you are carefull and copy it properly, this code does work

Paul


I'm not having problem with this code, but with - to use your example - the method test2... It launches, but it tells me that it could not evaluate the string 'Test2('90')' (where 90 is the id of the record I click on).

Which instruction should I use in the destination method to get the parameter present into the html table? I thought that storing the parameter value in a variable would be the right approach, but I'm missing something...
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby pbakker » Thu Mar 25, 2004 7:28 pm

var x = arg[0] in your method should retrieve the variable you passed into the method...

But the "Could not evaluate...." message I often got as well and solved that by putting the right quotes and double quotes in the HTML...

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

PreviousNext

Return to Methods

Who is online

Users browsing this forum: No registered users and 5 guests

cron