-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Deleting just a single child
PostPosted: Tue Jun 08, 2004 4:15 pm 
Regular
Regular

Joined: Sat May 29, 2004 2:16 pm
Posts: 81
My goal: to delete a child.
so i came up with this code:
Code:
    //...
       for (int i = 0; i < lista.size(); i++) {
            Detalhe detalhe = (Detalhe) lista.get(i);
            rel.getTurma().removerDetalhe(detalhe);
            visual.info2.removeElement(detalhe);//descomentei agora           
            System.out.println("o detalhe a eliminar: " +
                               visual.lstDetalhe.getSelectedValue());
        }
//...

but it deletes ... ALL children from my JList, and what i want is just to delete a selecteditem in the JList
info2 is my JList's listModel
My problem, i supose, lies in the fact that i'm totally unable to isolate a single child from the JList, declare it as a Detalhe (my children's name) and then delete it.[/code]
How can i grab a certain item from my JList and then tell hibernate/java that its a child(Detalhe) so that i can then delete it?
Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 08, 2004 4:38 pm 
Regular
Regular

Joined: Sat May 29, 2004 2:16 pm
Posts: 81
case solved!
i did this instead:
Code:
Detalhe detalhe1 = (Detalhe) visual.lstDetalhe.getSelectedValue();
        rel.getTurma().removerDetalhe(detalhe1);
            visual.info2.removeElement(detalhe1);

and works fine


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.