I have one form where I use a table view (locked) to display some information.
However the alignment of the elements gets messed up when I run the application. I use a header section to display the labels for each column. When I run the solution, the headers do not align with the columns. And the alignment differs from web to smart client.
You can use the label for functionality. So, if you have a field ( with a given name) and a label where labelfor property is field name the label will be used to render the header of that field in tableview ( using style properties of label ).
lvostinar:
You can use the label for functionality. So, if you have a field ( with a given name) and a label where labelfor property is field name the label will be used to render the header of that field in tableview ( using style properties of label ).
I tried this, but the result is still the same. I don’t get the results as I see them on my designer. I have aligned the labels with the fields, and now I have filled in the ‘label for’ property, but still its distorted at run time. Does the field length (not label) vary according to the length of the data during run time? I cant think of any other reason
The idea is that you don’t have to manually align stuff because it probably won’t look nice. So you don’t need any header part(for this). Just put the labels in Body and they will used to render the header for labelfor field. Or you can use the default header (with look and feel), if you set a name and a text to the field, the text will show up in the header.
lvostinar can explain a little more. What do you mean by “default header”? If I include the text in the field and remove the header, in table view, the label will repeat for the number of records i have.
Default table header is the header from Java table based on look and feel. If you have only the body and some fields ( each one has a name and a text) you get the default table header, with the text from fields. If you have a label with labelfor for the field the label will be used to render the table header( so using style properties from label like: font, background color …). Also then the text of the label will show up in the header. So, you don’t actually need the header part of the form to render the headers of the tableview.