Hallo,
in my document-based application I build in the window a split view with two table views. For every table view I assigned a document typ in the Taget˜s properties-pane for saving them accessing the data and load data representation event handler. I can save them properly, because the save panel has an additional popup button for choosing the document types.
When I˜m opening the first document, the content appears on the right place (every table view has an on clicked-handler for attaching the right data source).
And now my trouble starts: When I˜m opening the second document an empty window appears ( but the content is on the right place in the first window too).
How can I prevent the second empty window?
Short to say: I want both documents in the same window.
Heiner
Browser: Safari 525.13
Operating System: Mac OS X (10.5)
I’ll post what I’ve done up to now:
on data representation theObject of type ofType
if ofType is "Korrekturblatt" then
set theTableView to table view "korrekturblatt" of scroll view "korrekturblatt" of split view "splitView" of box "splitView" of window "main"
set theDataSource to data source of theTableView
set dieSchuelerDaten to contents of every data cell of every data row of theDataSource
set theData to {ergebnisse:dieSchuelerDaten}
return theData
else if ofType is "Notenbuch" then
set theTableView to table view "notenbuch" of scroll view "notenbuch" of split view "splitView" of box "splitView" of window "main"
set theDataSource to data source of theTableView
set dieSchuelerDaten to contents of every data cell of every data row of theDataSource
set theData to {schuelerdaten:dieSchuelerDaten}
return theData
end if
end data representation
on load data representation theObject of type ofType with data theData
if ofType is "Korrekturblatt" then
set theTable to table view "korrekturblatt" of scroll view "korrekturblatt" of split view "splitView" of box "splitView" of window "main"
set theDataSource to data source of theTable
append the theDataSource with (ergebnisse of theData)
else if ofType is "Notenbuch" then
set tableView to table view "notenbuch" of scroll view "notenbuch" of split view "splitView" of box "splitView" of window "main"
set theDataSource to data source of tableView
append the theDataSource with (schuelerdaten of theData)
end if
return true
end load data representation
Once again:
I can save the contents of the two table views into two different files.
I can open the two files in a common (first) window, but get an additional (second) empty Window.
How can I prevent the second empty window?
Heiner