labelFor issue

Servoy 3.5.6:

I can’t get “elements.fld_item1.getLabelForElementNames()” to return anything. Can someone confirm that this is broken?

And I can’t access labelFor elements independently because they disappear from the element tree as soon as you put something in the labelFor property.

Or maybe I’m doing something wrong…

So you got a label with a name and as soon as you also fill the labelFor property, the element disappears from the elements list of the form in the Method Editor?

If so, that doesn’t sound right. Can you please file a case in our support system?

Paul

Figured out that this only happens in table view – so I’m not sure if this is expected behavior.

I’m trying to get “display tags” behavior in table view headers (column header names change dynamically depending on the data) which seems to be an impossible thing. I also can’t put the column headers in labels in the title part because this part doesn’t scroll right-to-left with the body part.

So I’m having to use a list view, use a graphic for the “header” background, and duplicate the sort functionality of table view to get what I want. I can’t duplicate the user ability to drag columns around though.

I really like table view – would love to get more control over the header part.

David,

Currently, the control you have over TableView headers is through attaching a label to the field using a labelFor relation. And the label you can then style, directly using properties of the label element, or using StyleSheets.

At this moment, that is only a designtime thing, since the label element is removed intentionally from the elements list when you assign the labelfor relation.

If you want to be able to script against it at runtime, please file a feature request for this, preferably with as much detail on what exactly you want to script.

Using display tags in TableView headers is not likely to start working though, as the overhead of this is too much.

Regards,

Paul

pbakker:
Using display tags in TableView headers is not likely to start working though, as the overhead of this is too much.

How about adding in display tags for the labelFor elements? Same overhead issue?

Currently you can do display tags on the tooltips for table fields…which is how I’m giving some indication of what the tag names of the columns are (setting them to the values of global fields which I switch from record to record).

It seems to me that that the overhead wouldn’t be different between labelFor elements and tooltips. Being able to switch header text at runtime has a lot of application.

Pics are an example of a mail merge workflow where the columns of the recipients table is based on external mapping that the user sets up when defining merge templates. To accommodate, the column names in the backend storage table have generic names that are easy to process in a loop. Being able to show the user mapping in the column heading (and not just in the tooltip) instead of the generic backend column names would be cool.

Hi David, Servoyans

We also would like to set the column text dynamically in table view, so we would like to make a vote for this as well. Table view is our most used form view, but setting the text dynamically is missing.
BTW, we also like table view a lot, as it is the one view you get what users typically need. If we get even a bit more control on it, that would be really great, as table views speed up the human interface development in a very good way (my opinion only .-)

Best regards, Robert

david:
Figured out that this only happens in table view – so I’m not sure if this is expected behavior.

I’m trying to get “display tags” behavior in table view headers (column header names change dynamically depending on the data) which seems to be an impossible thing. I also can’t put the column headers in labels in the title part because this part doesn’t scroll right-to-left with the body part.

So I’m having to use a list view, use a graphic for the “header” background, and duplicate the sort functionality of table view to get what I want. I can’t duplicate the user ability to drag columns around though.

I really like table view – would love to get more control over the header part.

Hi all,

I already filed a case some time ago (casenr. 153655). I thought (same as David) that this was an issue, but my case has changed to ‘feature request’. I have been responded that this feature is not possible at the moment, but the functionality will be added later.
My guess is that it all will be solved in 4.1. (looking at the great new features we will get in there… :-) )

I am not sure will be solved in 4.1 as its priority is not very high.

Does anyone have an update on this? Is it possible now to change the column names dynamically? It seems like for Web Client, this is a “must have”.

hsummerhays:
Does anyone have an update on this? Is it possible now to change the column names dynamically? It seems like for Web Client, this is a “must have”.

Case from Marc has been closed with resolution:

We have added the right click support on header via labelfor label in tableview and then we also reevaluated this issue. We are not going to make headers in tableview scriptable. If you need some more properties of the label to be applied to tableview header please open separate case(s).

What exactly do you want to achieve ?

Hi Laurian,

I wanted to be able to update the text property of the label at runtime. It seems that the titletext property of the field is also not updatable at runtime. Here is a related topic: viewtopic.php?t=15528&start=15. If we had CSS for headers and could change titletext at runtime, then we wouldn’t need to mess with labelfor. Also, I was thinking that a work around for now might be to use an html iframe and get the text from a custom html page that accepts some parameters. However, for my current needs I decided to simply show the data that needed the custom headers in a detail view below a table.

hsummerhays:
Hi Laurian,

I wanted to be able to update the text property of the label at runtime. It seems that the titletext property of the field is also not updatable at runtime. Here is a related topic: viewtopic.php?t=15528&start=15. If we had CSS for headers and could change titletext at runtime, then we wouldn’t need to mess with labelfor. Also, I was thinking that a work around for now might be to use an html iframe and get the text from a custom html page that accepts some parameters. However, for my current needs I decided to simply show the data that needed the custom headers in a detail view below a table.

  1. You can change titletext property via solution model.
  2. You can assign to labelfor text a tag (form variable for example); (there may be some refresh issue with this solution)
  3. There is a case for adding a header css class, not sure if/when it will be implemented, anyway you can style the labelfor label which seems more powerful.

So, there are ways to achieve what you want, these workarounds are not enough for your solution?

Thank you for your suggestions. As I get more familiar with Servoy, I realize that the runtime components are fairly inflexible, but the SolutionModel makes up for that. Sadly, it’s just not very intuitive - I think I understand a little bit why it is the way it is, but it is a bit unusual and clunky. That said, Servoy definitely has its strengths and v6 has some excellent improvements, otherwise I am not sure I would have felt comfortable moving forward with it. Thanks again for your help - this forum is great and Servoy does a good job of following up.

I need to add a checkbox to table view header with “checkall” option. There is a column with checkboxes and we need a feature with a “check all” box in the header (like in some email clients for example). I wasn’t able to add a checkbox directly to the header and tried an approach with html tag but can’t seem to change elements..text property. I also tried imageURL property which also didn’t work. It says that the element is undefined. Also as soon as I set action method for a label it changes to button. Doesn’t seem intuitive.

What workaround would you suggest?

Wow this is kicking up old stuff…
Nevertheless this ‘old stuff’ hasn’t changed much.
As you can read in the previous posts scriptable headers hasn’t made it as a new feature.

I guess the ‘best’ solution you can get is this:
On a tableview use a label with the labelFor property set to bind it to a body element.
Now the label will be displayed as custom header.
You can apply styles to your custom header, you can show images using html in the text property for example, but you can’t change the element type: it is and will be a label, no matter what.
So if you want a ‘checkbox’ there: find yourself a nice icon and use it.

As it is a header, it will behave as such.
If you click it, it will ‘sort’ the column that you bind it to.
In case you want to change that behaviour, you’ll need to attach a custom function to the ‘onSort’ event of the form.

The onSort event will receive a couple of arguments. Which will enable you to distinguish which column header was clicked.
This should be the replacement for your ‘onAction’ question.

Hope this helps.