aspose file tools*
The moose likes JSF and the fly likes NodeSelectedEvent and instanceof operator help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "NodeSelectedEvent and instanceof operator help " Watch "NodeSelectedEvent and instanceof operator help " New topic
Author

NodeSelectedEvent and instanceof operator help

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I have a tree where the top nodes are of the type TreeHolder Object and the nodes below it are of type DeviceChannels Object. I have my method that is bound to nodeSelectListener, and I need it to differentiate between calling the first nodes of TreeHolder Object and the second nodes of DeviceChannels Object.

I was told I could do something like this:


But Im having trouble working this into what I have.

I have been trying variations on this advice, but havent seemed to get it right yet. I have till the end of the day to get this working so Im a little worried.

Should I leave the method as it is, accepting NodeSelectedEvent event as the parameters, or should that be changed to something more general?

public void projectSelection(NodeSelectedEvent event) {
}


it seems to me he is saying I only need the one nodeSelectListener attribute on my tree right? And it is going to call this method.

I just need if statements covering whether the node selected is a TreeHolder Object or a DeviceChannels Object.

So it seems like he's saying I should do something like:



where projectNode is a TreeHolder Object instance and deviceNode is of DeviceChannels Object

the above gives me errors though (Incompatible conditional operand types MeasurementProject and NodeSelectedEvent)

and the other variations I have tried havent quite worked yet either.

I would keep trying until I get it, but like I said I have till tonight to get this working correctly.


True wisdom is in knowing you know nothing - Socrates
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Here is the thread where I had this discussion if it helps to see everything:

http://www.jboss.org/index.html?module=bb&op=viewtopic&t=159016&start=0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NodeSelectedEvent and instanceof operator help