Manage Results from SQL Searches

pbakker:
Guys, I’ve tried all i can think of, but cannot get this to work… :(

Paul,

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

Underline Link

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

Underline Link

The SINGLE QUOTES with the parameter are MANDATORY.

Also - the method must be on the FORM - or you need to call like this:

Underline Link

Hope this helps…

Bob

:cry:

But isn’t this what I allready have???

For now I just want the method to be launched, not give it parameters, that is phase 2.

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

Underline Link

I my code it looks like this:
‘+ pkdataset[2]+’

I’m sorry, but I do not see a difference… OK, I put some more code around it to alter the layout and stuff, but that should not interact, according to me.

Paul

Figured it out… :oops:

This launching of a Servoy Method from within HTML only works on Non editable fields… it doesn’t work on Labels…

Sorry to have kept you busy with this one…

Paul

Despite all the sample code on how to use the single and double quotes, when passing variables into methods, no one got it correct :D

For the people who want to use this technique, here’s some samplecode that does the trick:

var pkdataset = security.getUsers()
var HTML = ‘

’ //var HTML receives all html code
for( var i = 1 ; i <= pkdataset.getMaxRowIndex() ; i++ )
{
pkdataset.rowIndex = i;
HTML += ‘’;
}
HTML += ‘
’+ pkdataset[1]+‘<a href="javascript:test2(’+“'”+pkdataset[2]+“'”+‘)">’+ pkdataset[2]+‘

globals.userlist = HTML;

Paul

To clearify this a little, the syntax is exacty the same as found in html specification. (and is used in many webpages)

Jan, you’re absolutel right, just took me a while to get going and wanted to share what I eventually found…

Now I have a new quest… :)

I’m trying to modify the way theHTML table looks, and came up with the following code, to include a header and to alter the lines between the cells:

var pkdataset = security.getUsers()
var HTML = ‘

’ //var HTML receives all html code
for( var i = 1 ; i <= pkdataset.getMaxColumnIndex() ; i++ )
{
HTML += ‘’;
}
HTML += ‘’
for( var i2 = 1 ; i2 <= pkdataset.getMaxRowIndex() ; i2++ )
{
pkdataset.rowIndex = i2;
HTML += ‘’;
}
HTML += ‘
’+ eval(‘pkdataset.getColumnName(’+i+‘)’)+‘
’+ pkdataset[1]+‘<a href="javascript:test2(’+“'”+pkdataset[2]+“'”+‘)">’+ pkdataset[2]+‘

globals.CustomWebSite = HTML;

Now, the problem lies with: >

There are 4 properties you can set in the border area, according to my HTML documentation: Border=x, cellpadding=X, cellspacing=X and width=X. I tried all four and only Cellpadding and width seem to have an effect on the layout.

The question is now: Does Servoy support Border=x and cellpadding=x?

Paul

you should use styles for this.
Other kind of properties aren’t very well supported in the html component.

Johan, I’ve been struggling with stylesheets in HTML now for a while. I now have hte following HTML:

table {border: 5px solid orange} td {border: 5px solid red} a {text-decoration : none; color:black}
languageid description
1 Dutch
2 English

Some of the style command do effect the look of the table in a HTML field in Servoy (for example the a {text-decoration : none; color:black}-part)

But I haven’t been able to alter the border color or width no matter what I try. I’ve looked at the same code in, for emaple IExplorer ad there I do see the layout changes in color and border width.

Am I doing something wrong here?

The support of border seems very poor in the default htmlcomponent from Sun, if this is a major problem we could try our own border creator for styles

Well, a portal like element that can display any foundset would also solve my problems :D

I notices more HTML style components do not seem to work…

Paul

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

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

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,

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

that is just a very special component. Will add this to the planning..

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

Tnx for adding it. any idea if it will make the next beta?

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!

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…

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?

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