Monday, December 9, 2019

#1 2019-11-17 11:33:53 am

Registered: 2012-09-13
Posts: 28

setDoubleAction problem

Can anybody help with a setDoubleAction problem. I have started an ApplescriptObjC project that displays a window containing a multiple column table. When I double click on the window it only ever gives me the first line of the table. If I double click on a line in the table that does not contain an entry the subsequent double click works perfectly. I’m not sure how much code to display here, any help would save my sanity!

[code]property theData : {}
    property tempList : {}
    property firstWindow : missing value
    property secondWindow : missing value
    property theArrayController : missing value
    property lineTable : missing value

    property theDate : missing value
    property theType : missing value
    property theCategory : missing value

on buildList(theRecord)
    set end of tempList to {theDate:text item 1 of theRecord,theType:text item 2 of     theRecord,theCategory:text item 3 of theRecord, theOriginator:text item 4 of     theRecord,theDescription:text item 5 of theRecord, theReference:text item 6 of theRecord,     theValue:text item 7 of theRecord,theStatus:text item 8 of theRecord} -- build list of required     elements for display
        theArrayController's removeObjects:(theArrayController's arrangedObjects()) -- remove previous display
        tell theArrayController to addObjects_(tempList) -- load new display
        secondWindow's orderOut_(me)
        firstWindow's makeKeyAndOrderFront_(me)
        tell lineTable to setDoubleAction_("displaySelection:")
end bulidList_

on displaySelection_(sender)
        set theSelection to theArrayController's selectedObjects() as list
        set theDate to theDate of item 1 of theSelection -- extract individual elements
        set theType to theType of item 1 of theSelection
        set theCategory to theCategory of item 1 of theSelection
end displaySelection_[/code]



#2 2019-11-18 12:21:46 am

Registered: 2017-12-14
Posts: 125

Re: setDoubleAction problem

Did you drag the delegate outlet from
You tableView to your array controller?

That will trigger any selections that happen to iy



#3 2019-11-18 10:23:21 am

Registered: 2012-09-13
Posts: 28

Re: setDoubleAction problem

Thanks for reply, I must have checked every attribute and binding a hundred times. You suggested checking the array controller bindings, everything looked OK but noticed the 'Selected Inserted Objects' was ticked, unticked it and now everything works, not sure why but it does! Many thanks for pointing me in the right direction.



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)