Tableview columns

Hi,

I have tableview forms where some of the tableview forms do not have column header labels (so the labels are generated by Servoy on runtime) and some of the tableview forms do have header labels on design time (that is needed in case you have a label with display tags %%…%% on your tableview form; you can’t set the titleText for labels)

I would like to have both labels having the same look and feel (both in webclient and in smartclient)

How can I succeed to have header labels that are on my tableview forms exactly the same so that a user doesn’t see any difference if a headerlabel was generated my Servoy or programmed by developer.

I guess I need some style for those headerlabels, but I can’t get it exacty the same as the Servoy generated headers.

Anyone knows how to realize that?

Thanks

Martin

martin,

we have done this very closely, with the solutionModel & creating labelFor on the fly for every field in the body of a table-view[attachment=0]Schermafbeelding 2010-06-08 om 11.31.51.png[/attachment]
(Thanks to Marc Boegem, for helping us. :wink: )
So this works in smart-client between every different OS & Look & Feel
but the gradient (which is html) does not work in webclient! :-(
we have filed a case for this, so I hope this will be fixed.

If you don’t use gradient (so don’t use html) in the labeFor) than the smart client & webclient are pretty the same!
the only problem there is, that the height of the labelFor is not respected in the web, but this is fixed for future release.

I will file the whole script (it’s just one global method, that does this automaticly when you login) as a tip on http://www.servoycamp.com soon.

We just create headerlabels for ALL tableview columns at startup using the solutionModel.
This is done for over 800 forms and it’s barely noticeable.

I can only think of advantage (at least for our solution)

  • never bother about creating labels by hand
  • if you change an elementname you can’t forget to change the elementname in the label’s labelFor property
  • if you decide to change look & feel, just have to do it in 1 place.

Example can be something like Harjo posted. Look & feel is the thing you decide yourself

Hi Marc, Harjo,

I understand how you can do this with the solutionmodel.
While reading the fields in tableview using the SM, you can create labels and fill the text property of the label with the titleText property of the field.
But in case you have a label in the tableview, you can’t use the text property of the label. So where do you put put the “titelText” property of the label?

A while ago I already posted a request for this option (case #259909), but unfortunately, this request has not been handeled (yet)

Martin

martinh:
But in case you have a label in the tableview, you can’t use the text property of the label. So where do you put put the “titelText” property of the label?

As you will use these custom labels (having a labelFor property) on top of your existing elements, just take care of the elements having the textproperty entered correctly.
This case you can just read this property and use that text for the label.

Hi All!

If I use an image on my label in the header together with the mediaOptions set to ‘enalrge’ it doesn’t seem to work.
The image is a gradient colour picture that I would like to stretch.

Here’s my code:

var newLabel = solutionModel.getForm(formName).newLabel(titleText, x, 0, columnWidth, 30); 
newLabel.labelFor = fieldName;
newLabel.imageMedia = solutionModel.getMedia("grid_top_middle.png");
newLabel.mediaOptions = SM_MEDIAOPTION.ENLARGE;

Would there be any other way to display gradient color in the table header?

Cheers,
Maria

Hi Maria,

to have it working cross-platform, create a html-table and use the image as bg-image.
I’d say: test it first without solutionModel, than convert it into code…

mboegem:
Hi Maria,

to have it working cross-platform, create a html-table and use the image as bg-image.
I’d say: test it first without solutionModel, than convert it into code…

Thanks Marc.
I’ll give it a go.

Cheers,
Maria