How can I copy a checked row from one objectlistview to another?

120 views Asked by At

I'm trying to copy the checked rows from one objectlistviewtable to another. I've tried a lot of thing. I've tried

 GetobjectsAddPlotList = self.notebook.PageOne.tempmeasurements.GetSelectedObjects()
 GetobjectsAddPlotList = self.notebook.PageOne.tempmeasurements.GetCheckedObjects()

I've tried a workaround by using a forloop to see which object is checked and put them in another variable. But I don't see a thing in my second table.

Tx in advance

This is what I have:

def on_add_to_plotlist(self, event):

    GetobjectsAddPlotList = self.notebook.PageOne.tempmeasurements.GetObjects()
    pub.sendMessage(self.notify_channel,
                     Container(type="EVT_ADD_TO_PLOTLIST", origin=self.notebook.PageOne.tempmeasurements, data=GetobjectsAddPlotList))



def on_message(self, message):
    print message.data.type
    if message.data.type =="EVT_ADD_TO_PLOTLIST":
        #import pdb; pdb.set_trace()
        AddToPlotListData = message.data.data
        #print AddToPlotListData
        self.view.notebook.PageOne.plotmeasurements.SetObjects([AddToPlotListData])
1

There are 1 answers

0
VeVi On

I found a solution, I don't know if it is the best one:

def on_add_to_plotlist(self, event):

    objectsAddPlotList = self.notebook.PageOne.tempmeasurements.GetCheckedObjects()
    self.notebook.PageOne.plotmeasurements.AddObjects(objectsAddPlotList)