Sorry I am a newbie in Servoy. Perhaps the question is too simple.
I want to evaluate it and I have the following problem.
I have created 2 tables in a Sybase database with a 1:n relationship.
Let’s say the table names are TABLE1 and TABLE2 with a 1:n relationship between TABLE1 and TABLE2.
Furthermore I have defined a relation in Servoy between these tables.
My simple task was to create a form which shows 2 rows of TABLE1 and for each row of table TABLE1
I want to see 3 rows of table TABLE2 (according to the defined relation).
Unfortunately I was not able to define scrollbars for these 2 tables. So I see only 1 row of table TABLE2.
Am I doing something wrong?
Where is it described in the developper guide how the repetition and size of one table/entity (+scrollbar)
for each table can be set?
could you please give some more background? i.e. what ‘view’ are you using for table A? record/list/table
how do you try to show the records of table B? via fields/portal/tabpanel?
It should actually be very easy to do, but as you didn’t describe how you try to accomplish this, it’s hard to say what’s wrong.
Maybe a screenshot could clarify some as well.
sorry I don’t understand you fully. But I explain my steps in more details:
1.) create new form with
form name = Table1_Table2
table = Table1
Style = Default
Template = Default
2.)
a) selected/highlighted all fields of table Table1
b) clicked on the + of the relation for TABLE1_TABLE2
c) selected the relation and all fields of TABLE2
d) Place Labels are checked
e ) Pressed Finish Button
3.) moved the labels and fields
a) labels and fields of table TABLE1 in one line
b) labels of table TABLE2 in second line
c) fields of table TABLE2 in third line
4.) saved the form
5.) started Smart Client
I will see only a scrollbar for TABLE1. But how can I define a scrollbar for the inner entity?
sorry I don’t understand you fully. But I explain my steps in more details:
1.) create new form with
form name = Table1_Table2
table = Table1
Style = Default
Template = Default
2.)
a) selected/highlighted all fields of table Table1
b) clicked on the + of the relation for TABLE1_TABLE2
c) selected the relation and all fields of TABLE2
d) Place Labels are checked
e ) Pressed Finish Button
3.) moved the labels and fields
a) labels and fields of table TABLE1 in one line
b) labels of table TABLE2 in second line
c) fields of table TABLE2 in third line
4.) saved the form
5.) started Smart Client
I will see only a scrollbar for TABLE1. But how can I define a scrollbar for the inner entity?
Thanks
Wolfgang
I think what you need here is a tabpanel (if i understand this correctly). So, make another form for table2 and put a tabpanel on first form with related (second) form. Is this what you want ?
OK, this makes sense in the way: it won’t work like you’d expect it to work.
What happens:
If you have Form 1, connected to Table 1 then you can show fields of table 1 and fields (over a relationship) of table 2.
The result is that you will see only 1 record of table 2, this will be the first record the relationship will come up with.
This solution can only work for a 1-1 relationship.
You want data based on 1-n relationship.
Create a Form 1, connected to Table 1 with the fields of table 1, this should be a view-type: ‘list-view’ (you can find this in the form properties, almost all the at the bottom)
Place a portal on Form 1, based on the 1-n relationship an select the fields this portal is supposed to show.
You may want to adjust the height of the body and add a titleheader in order to show labels above.
In this way you can show multiple records of table 1 in a listview, per body instance you will have a portal which will show all the related records of table 2.
The best thing is: it’ll show the srollbars you were looking for automatically
Hope this helps
EDIT: Laurian was a bit faster > his solution will only works when you will show the records of table 1, one at the time. (record-view mode)
On a tabpanel you basically re-use another form which might be based on a relationship (not neccessarily)
As servoy can only show 1 instance of a certain form at a time, this approach can’t work in listview/tableview as this will need more than 1 instance.