Just comparing one string how to get the node?

hi group,
I get the string value like this:
String listselvalue = getJList1().getSelectedValue().toString();
Just i am comparing this with particular node.(which is in tree) like this:
TreePath path = getmy_tree().getPathForRow(1);
DefaultMutableTreeNode selnode = (DefaultMutableTreeNode)path.getLastPathComponent();
Enumeration enum = selnode.children();
while(enum.hasMoreElements())
     if(enum.nextElement().toString().equalsIgnoreCase(listselvalue))
          //here what trick I have to use to get that node.(if it matches)
thank u...
Shalinipriya.

You need your node for both your test and your manipulation if the test is succesfull, so just keep a ref to your node before the test, and use that ref for both test and manipulation. Within your code, it should look like this:
Enumeration elts = selnode.children();
while ( elts.hasMoreElements() ) {
     // keep a ref to the current node,
     // so you can bith test its name
     // and manipulate it if it match you critiria
     Object currentNode = elts.nextElement();
     if ( currentNode.toString().equalsIgnoreCase( listValue ) ) {
          // here you have your currentNode object
          // that is a DefaultMutableTreeNode
          doNodeJob( currentNode );
}

Similar Messages

  • How to get the Node Value from XmlValue result?

    Hi ,
    I am not able to get the Node Value from the result. In my XQuery im selecting till a Node, if i change my query as
    collection('PhoneBook')/phone_book/contact_person/address/string()", qc);
    im getting the node value, but here the problem is its not a Node so i cannot get the Node name.
    So how can i get the Node Name and Node value together?
    any help please ????
    XML :
    <?xml version="1.0" encoding="UTF-8"?>
    <phone_book>
    <contact_person>
    <name>
    <first_name>Michael</first_name>
    <second_name>Harrison</second_name>
    </name>
    <address city="yyyyy" pincode="600017" state="xxxxx">
    176 Ganesan street, Janakinagar, alwarthirunagar
    </address>
    </contact_person>
    <phone_number type="mobile">9881952233</phone_number>
    <phone_number type="home">044-24861311</phone_number>
    <phone_number type="office">080-12651174</phone_number>
    </phone_book>
    Code:
    XmlQueryContext qc = manager.createQueryContext();
    XmlResults rs = manager.query
    ("collection('PhoneBook')/phone_book/contact_person/address", qc);
    while(rs.hasNext()){
    XmlValue val = rs.next();
    System.out.println(val.getNodeName() + " = [ " + val.getNodeValue() + " ] ");
    Output
    address = [  ]

    You are right, this seemed un-intuitive to me too, but I finally understood how it's done.
    The "value" of a node is actually the total amount of text that is not contained in any of the node's child nodes (if any). So a node with child nodes can still have text value.
    To get the 'value' of an element node, you must therefore concatenate the values of all children of type "XmlValue::TEXT_NODE", of that node. Try it.
    In your example, the <address> node has no child elements, my guess is that BDB XML stores the address string "176 Ganesan street, Janakinagar, alwarthirunagar" inside a child node of <address> node (of type XmlValue::TEXT_NODE) because you wrote the string on a separate line.

  • How to get the node id of the content shown from campaign

    Hi
    Can any one please tell how to get the node id of the content shown by the campaign
    in jsp
    Thanks

    One option is to define a custom ad renderer, which is registered with the proper mime-type.
    The campaign would run your renderer if the campaign retrieved a node with a binary of the proper registered mime-type.
    This allows you to insert yourself into the call chain for the node rendering. You can access the nodeID at that point (and do the typical rendering-- providing a URL for the ShowPropertyServlet)
    -Steve

  • How to get the node value of payload

    Hi
    The null is returned when I use the following code to get the User_ID element in the payload, but there are values in the User_ID element of the payload
    Task task_test = wfSvcClient.getTaskQueryService().getTaskDetailsById(wfCtx, taskId);
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getNodeValue());
    How to get the node value of payload ? any suggestion?
    Thanks
    Jayson

    Hi Jayson,
    Try:
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getFirstChild().getNodeValue());
    So add the getFirstChild() call in between.
    If this works, maybe consider using JAXB to marshall the payload details to POJO's. This will make reading the payload details much easier.
    Regards, Ronald

  • How to get the node name?

    Hi Guys,
    I have a path that look like this root/1stLevel/dynamicLevel
    how can i get the dynamic level node name when it come with different node name so that i can catch it into one of the variable?
    it may change according to the requester
    root/1stLevel/dynamicLevel1
    root/1stLevel/dynamicLevel2
    root/1stLevel/dynamicLevel3
    root/1stLevel/dynamicLevel4

    What software? In OSB try Assign with this expression:
    fn:name($body/root/firstLevel/*[1])By the way, you can't use element named "1stLevel" because it starts with number.

  • How to get the node's coordinates when Node is in a managed container

    I worked thru the documentation of "BoundsInParent and BoundsInLocal" but these values do not seem to be resonable when the Node is within a managed container
    e.g. when the node is placed in a HBox or BorderPane.
    How can I estimate the y-coordinate of this node (relative to the scene) ?

    Have you tried Node's "localToScene" method?

  • Any one know how to get the audiobook on my ipod onto my computer?

    I recently purchased and downloaded an audiobook to my ipod. I would like to get it on to my computer but its not in my library!!! Can it not be uploaded to my mac? i plugged in my ipod to my computer and it transfered my purchaces over except my audio book... help!!!!!!

    Was this audiobook downloaded from the iTunes Store? If so, try redownloading it via iCloud in iTunes on your PC.  See here for more information.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    B-rock

  • How to get the data in servlet if the request encryption type is multipart/

    I am uploading files to the server.
    at that time,before upload ,I need to validate the upload file names.
    so,i am trying to get the value of those files names using
    request.getParameter("jobsheet"); in servlet.
    its giving null insted of file path.
    how to retrieve the the values of parameters if the request is multipart/form-data.
    any help please...

    I think that package works in struts framework right?
    If wrong ,correct me.
    actually I am following MVC pattern.not using struts.
    If this works even in normal web application also.then ok.
    But,Just I am looking how to get the values of jsp parameters
    I have 5 elements in jsp .
    below code:
    <form name="FileUpload" action="./UploadServlet" method="post" enctype="multipart/form-data">
    country <input type="text" name="country" value="">
    year <input type="text" name="year" value="">
    month <input type="text" name="month" value="">
    File<input type="file" name="file1" value="">
    <input type="submit">
    </form>
    I am trying to get the data in servlet like
    String country=req.getParameter("country");
    its getting null.
    I don't know how to get the values if the enctype is "enctype="multipart/form-data"
    If any one knows ,Please suggest me.

  • How to get the selected cell in a Matrix.

    Hi all,
    Does any one know how to get the selected cell in a Matrix. Please help to answer. Thanks in advance.
    Regards,
    Thanh Tran

    Hi,
    You can get the value of every cell  using UI API but using datasources is a better aproach.
    Using UI API you need to know the event you want to catch. Example: Catching click event in itemcode column and getting the value (C#):Ki
          if ((pVal.EventType == BoEventTypes.et_CLICK) &&  //CLICK EVENT
              (pVal.ItemUID == "38")  &&                                       //MATRIX-> ITEM 38
              (pVal.ColUID == "1") &&                                           //ITEMCODE COLUMN
              (!pVal.InnerEvent) &&                                
              (!pVal.BeforeAction))
                    Form form = null;
                    try
                        form = kernel.Application.Forms.Item(pVal.FormUID);
                        form.Freeze(true);
                        Matrix mtx = (form.Items.Item(pVal.ItemUID).Specific as Matrix);  //MATRIX OBJECT
                        string itemCode = (mtx.Columns.Item("1").Cells.Item(pVal.Row).Specific as EditText).Value.Trim();  //itemcode = VALUE OF CELL. COLUMN "1": ITEMCODE COLUMN. CURRENT ROW: pVal.Row
                    catch (Exception ex)
                        kernel.Application.MessageBox("Error " + ex.Message, 0, "", "", "");
                    finally
                         if (form != null)
                            form.Freeze(false);
    Kind regards,
    Nauzet Díaz

  • How to get the page request parameters in Command Button code

    Hi everyone,
    I am new to JSF and working on some Command Buttons. I put my java code via Edit Event, it works fine. But I don't know how to get some parameters from HttpServletRequest.
    Can anyone give some guidance? It would be much appreciated.
    Mike

    Thanks a lot for your tip. Unfortunately I could not open the link you provided due to some network issue.
    Yes, I intend to get some parameters from URL. I did try to put your code and get the parameters predefined in the URL, however I got the null returned. By the way, I put the following code in the page source part and it works. Just don't know how to get the value being passed to the command button event code.
    <%
    String userID = request.getParameter("u");
    System.out.println("this is from head - the userID is :: " + userID);
    %>
    Thanks again and hope you could give me further advice.

  • How to get the number of files currently open?

    hi,
    does any one know how to get the number of files currently open in windows OS?
    e.g. lets say .txt files...
    any comment will be really appreciated.
    thanks

    Assuming that you don't want to actually do this from within Java code (which would obviously require native code), here's a utility that will give you a list of which file handles are opened by which processes (on Windows):
    http://www.sysinternals.com/ntw2k/freeware/handle.shtml
    - K

  • How to get the Path of the WebDynpro page

    Hi All,
    Can any one say how to get the path of the JSPDynPage ina Portlet in Portal Application.
    Becoz i have to display that Page in another JSPDynPagee
    Thanks in Advance....

    Hi,
    You can call your JSPDynPage component by calling the URL as:
    http://localhost:50000/irj/servlet/prt/portal/prtroot/YourApplicationName.YourComponentName
    Check this:
    Calling portal component
    Greetings,
    Praveen Gudapati
    [Points are welcome for helpful answers]

  • How to get the backup of photos from  i cloud id ?

    plz provide me the answers as soon as possible.

    BALAJI_PRASANNA wrote:
    Hello,
    I am very new to Labview. Í have an image of an LED and wanted to find the luminance value. I got the luminance image from the IMAQ ExtractSingleColorPlane but the value is not displaying. I just wanted to know how to get the value of luminance from the IMAQ ExtractSingleColorPlane. I have attached what i have done below.
    Thanks in advance.
    Before learning about LabVIEW, learn about images.  An Image (in LabVIEW) is a "representation of an image", that is, the wire itself doesn't really have a "value", but "points to" a collection of data that can be "imaged" (i.e. looked at as through it were a picture), "manipulated" (for example, extracting a color plane, basically getting the "red channel", an image looking as through it were viewed through a red filter), and possibly returning arrays of numbers representing the intensity of the light at a certain position in the picture.  
    BS

  • [Win VC++ 6.0 ]How to get the number of files count in a folder using VC++ 6.0?

    Hi all,
    Can any one tell how to get the number of files(.EPS) count inside a folder when the folder path is specified in VC++ 6.0?
    Thanks in Advance.
    Regards
    myriaz

    I'm a little confused by the question, but it sounds like you're asking how to count the number of files with a particular extension in a given directory? That's not really an AI SDK question, but it's a fairly easy one to find if you google it. If you're trying to use Illustrator to do it, AI doesn't have a general purpose file API. It has a few functions to do some things that Illustrator needs, but I don't think enumerating directories is one of them.

  • How to get the value of payload?

    Hi
    The null is returned when I use the following code to get the User_ID element in the payload, but there are values in the User_ID element of the payload
    Task task_test = wfSvcClient.getTaskQueryService().getTaskDetailsById(wfCtx, taskId);
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getNodeValue());
    How to get the node value of payload ? any suggestion?
    Thanks
    Jayson

    Hi Jayson,
    Try:
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getFirstChild().getNodeValue());
    So add the getFirstChild() call in between.
    If this works, maybe consider using JAXB to marshall the payload details to POJO's. This will make reading the payload details much easier.
    Regards, Ronald

Maybe you are looking for

  • How can we debug a procedure?

    we need to debug a procedure but we lost the way after oracle moved the procedure builder to enterprise manager. we can execute it via em but we need a tool for writing,debugging and executing new ones.

  • The keys of my macbook are changed

    the keys of my macbook air are changed

  • Basic webpage link checker

    Hello all, I am attempting to write a basic link checker to parse an html page and determine if any links are dead. I found a couple tutorials online, and am using one of them to test a webpage. However, i am running into multiple problems. The basic

  • BoxLayout allignment

    I would like the JLabel "addedSectionLabel" to be left aligned however it is always center alligned, any ideas on how to achive this? JPanel topLeftPanel = new JPanel(); topLeftPanel.setLayout(new BoxLayout(topLeftPanel, BoxLayout.PAGE_AXIS)); JLabel

  • JavaServer Faces Support

    Are there plans/timeline to support JavaServer Faces in Workshop?