3.2; Access ComboBox elements?

Hi,
i need to go through comboBox elements and search for a specific item.
probebly i should get comboBoxModel as following: comboBoxControl1.getModel();
if yes, what's the next step.
if no, what's the right way.
please advice.
null

You can find an element at a combobox, and select that element with this method:
public static void establecerSeleccion(String descripcion, ComboBoxControl combo){
try{
javax.swing.ComboBoxModel modelo = _combo.getModel();
boolean encontrado = false;
int i = 0;
ImmediateAccess valor;
while ((i<modelo.getSize())&&!encontrado){
valor = (ImmediateAccess)modelo.getElementAt(i);
i++;
if (valor.getValueAsString().equals(_descripcion))
encontrado = true;
_combo.setSelectedIndex(i-1);
if (!encontrado)
_combo.setSelectedIndex(0);
}catch(Exception e){
if (Debug.DEBUG)
System.out.println("establecerSeleccion"+_descripcion+" error"+e.toString());
If you have a comboBoxCONTROL yo can find the element navigating throw its rowsetInfo this way:
//_codigo is the element you are looking
for.
//_nombreClave is the name of the column
public void establecerSeleccion(String codigo, RowSetInfo rowset,String nombreClave){
I hope this to be usefull for you
boolean salir = false;
boolean penultima = false;
boolean encontrado = false;
String indice;
ImmediateAccess ia;
ScrollableRowsetAccess scrollrowset = rowset.getRowsetAccess();
if(!(scrollrowset.getRowCount()==0)){
try{
scrollrowset.first();
while(! salir){
salir = encontrado &#0124; &#0124; penultima;
ia = (ImmediateAccess) scrollrowset.getColumnItem(_nombreClave);
indice = ia.getValueAsString();
if(indice.equals(_codigo)){
encontrado = true;
salir = true;
if (! encontrado)
scrollrowset.next();
if (!scrollrowset.hasMoreRows())
penultima = true;
// scrollrowset.flush();
catch (java.sql.SQLException excepcion){
if (Debug.DEBUG)
System.out.println("error obteniendo datos");
catch (javax.infobus.RowsetValidationException rvexcepcion){
if (Debug.DEBUG)
System.out.println("error obteniendo datos");
catch (javax.infobus.DuplicateColumnException rvexcepcion){
if (Debug.DEBUG)
System.out.println("error obteniendo datos");
catch (javax.infobus.ColumnNotFoundException rvexcepcion){
if (Debug.DEBUG)
System.out.println("error obteniendo datos");
}//end if
//System.out.println("?encontrado?");
null

Similar Messages

  • How access an element using getElementById() without absolute path?

    hello,
    Currently I'm working on a JSF woodstock project.
    I'm trying to acceess the different components used the JSF page inside a javascript by using document.getElementById()
    this is a part of code in my JSF file. please have a look on it.
    <webuijsf:form id="form1">
                            <webuijsf:panelGroup id="pnlGrpBankListMainContainer" style="left:2px; top:89px; margin-left:1.5%; margin-top:1%; width:50%; position:absolute;">
                                <webuijsf:table augmentTitle="true" title="#{BankList.screenName}" id="table1" paginateButton="true"
                                    paginationControls="true" clearSortButton="true" extraActionTopHtml="style='height:35px'">
                                    <f:facet name="actionsTop" >
                                        <webuijsf:panelGroup id="grpPnlButtons">
                                            <webuijsf:checkbox binding="#{BankList.chkBoxSelectAllItems}" id="chkBoxSelectAllItems" name="chkBoxSelectAllItems" rendered="#{BankList.renderChkBoxAndImgSeparator}"
                                                selectedValue="selectAllItems" onClick="selectAllTableRows(this,'chkBoxBankListSelectedRowId',5);"/>
                                            <webuijsf:image id="imgSeparator" url="/resources/images/select_image_separator.gif" rendered="#{BankList.renderChkBoxAndImgSeparator}" />
                                            <webuijsf:button id="btnAdd" rendered="#{BankList.renderAddButton}"  text="Add" styleClass="btnStyle" immediate="true"
                                                onClick="return openAdd('#{BankList.requestContextPath}/faces/BankEntry.jsp', 500, 755,'Add  #{BankList.screenIdentifier}', '&action=ADD');"/>
                                            <webuijsf:button id="btnEdit"  rendered="#{BankList.renderEditButton}"  text="Edit" styleClass="btnStyle" disabled="#{BankList.disableEditButton}"
                                                onClick = "return openEdit('#{BankList.requestContextPath}/faces/BankEntry.jsp', 'chkBoxBankListSelectedRowId', 500, 755,'Edit  #{BankList.screenIdentifier}', '&action=EDIT');"/>
                                            <webuijsf:button id="btnDelete"  text="Delete" onClick="return confirmRecordsDelete();"  rendered="#{BankList.renderDeleteButton}"  styleClass="btnStyle" disabled="#{BankList.disableDeleteButton}"/>
                                            <webuijsf:button id="btnExportXls" disabled="#{BankList.disableExcelButton}" rendered="#{BankList.renderXlsButton}"
                                                styleClass="btnStyle #{BankList.excelButtonStyleClass}" style="position:relative; margin-left: 10px"
                                                text="x" onMouseOver="setMouseOverStyle(this);" onMouseOut="setMouseOutStyle(this);"
                                                onClick="return openXlsExport('#{BankList.requestContextPath}/faces/Export.jsp', 'chkBoxBankListSelectedRowId', 'Export  #{BankList.screenName}', '&screenIdentifier=#{BankList.screenIdentifier}');">
                                            </webuijsf:button>
                                        </webuijsf:panelGroup>
                                    </f:facet>when i access button element using absolute path like
    document.getElementById("form1:pnlGrpBankListMainContainer:table1:grpPnlButtons:btnEdit") it works fine.
    But when i try to access it using
    document.getElementById("form1:table1:btnEdit") it returns null.
    I've common javascrpt functions for all the screens.
    so i do not want to change the current javascript functionality nor do i want want to specify complete path for an element.
    So is there any way so that i can access the elements without absolute path or any othet solution?
    Edited by: sonali_amonkar on Apr 1, 2008 11:17 PM

    thanks for your reply mjswallow.
    Do you mean that I'll write a new javascript which will accept all the parent elements and inside this method I'lll call the common javascript methods that are present in our project?
    but this solution would result in changing the already existing javascript methods that i coded for all screens. right?
    that is i do not want to change.
    any other solutions you can think of?

  • What does error code 150:30 mean and why can i not access my elements site

    what does error code 150:30 mean I cannot access my element equipment

    ok then so what is the problem I have with this error code

  • Error while accessing container element _ALERT_LOGICAL_SYSTEM

    Hi,
    Getting below error in SLG1 T.Code, I, am getting E-Mail but without any ALERT ID, MESSAGE ID and Interface name pls suggest for the same to solve.
    "Error while accessing container element ALERTLOGICAL_SYSTEM" ERROR IN SLG1
    Rgds,
    MFH

    Did you checked this thread: Alerts problem and log
    Regards,
    Abhishek.

  • How to access the element s in a hashMap with order

    Does anybody know how to access the elements in a hashMap with order.
    I know set is a collection that doesn't gaurantee the order so the iterator of keySet will not gaurantee the order.
    Is there any way to solve this?
    Thanks

    If you mean the order in which the key/value pairs where added to the
    map, have a look at the LinkedHashMap class. If you mean 'natural'
    order, you shouldn't be using a HashMap at all then; have a look at the
    TreeMap class instead.
    kind regards,
    Jos

  • Access Array Elements by Arrays Reference

    Hi there,
    I'm currently working on a vi that writes clusters as recordsets into
    specific tables in a database.
    Due to this I have a problem filling an array of clusters equal to the
    recordset structure of
    a table. I wonder if it might be possible to access each element of an
    array by using the arrays
    reference instead of a local variable. At the moment I couldn't find any
    properly working method for
    that. Is anybody able to giv me some advice or hint?
    Thanks a lot!
    Sebastian Dau

    Sebastian; Be careful about thinking that you have solved your problem because a technique works--or appears to work. The method you are talking about uses excessive resources, is slow and inefficient and is an open source for race conditions. Right now the thing seems to work, what happens when you have other code executing at the same time, accessing the same data? Or say you install the code on a computer that's faster--or slower--than the one you're using now. Will it still work? If not will you be able to figure out why it suddenly stops working? Or why it only seems to work on certain computers? In terms of performance, you always have to go for the best performance you can because you never know how you will want to use the code in
    the future. In other words, you use this VI in one place and you can't notice the performance difference. But what happens when you use this VI in a 100 places in your code? Will the performance loss still be unnoticeable? Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • HTMLDocument - How Can I access an element ?

    Hello,
    I want to try and access the element in an HTMLDocument with a position received from a viewToModel() call (of a JEditorPane).
    I'm not sure what method I use, I think it's the getCharacterElement() of the HTMLDocument root class, but I'm not too sure.
    Could someone give me some advice ?
    thanks
    Kerry

    Hi camickr,
    Well this post is related to my other one you kindly answered earlier ( here )
    Just to recap :
    I'm using a JEditorPane to display HTML and when the user clicks on a part of the web page, for example an image. In response to this mouse event, I want to locate where in the HTML tree the particular item is and (eventually hightlight the corresponding HTML element in a JTree of the entire HTML page). So far this is my code that responds to Mouse events :
    private void jEditorPane1MouseClicked(java.awt.event.MouseEvent evt) {                                          <br />
            // TODO add your handling code here:<br />
            Object o = evt.getSource();<br />
    <br />
            if (o instanceof javax.swing.JEditorPane){<br />
                javax.swing.JEditorPane t = (javax.swing.JEditorPane)o;<br />
                javax.swing.text.Document d = t.getDocument();<br />
    <br />
                java.awt.Point p = evt.getPoint();<br />
                int k = t.viewToModel(p);<br />
                javax.swing.text.Element e = ((javax.swing.text.DefaultStyledDocument)d).getCharacterElement(k);<br />
                javax.swing.JOptionPane.showMessageDialog(null,Integer.toString(k));<br />
                //int comp = o.viewToModel(evt.getPoint());<br />
            }<br />
        }So as you see, I set the value of 'k' to 'nearest representative location in the model.' but then I'm not sure how I use this number to get to the HTML element, which accounts for the last few lines of the code.
    So my problem is I'm not sure what to do with the integer returned from viewToModel().

  • JDOM - Accessing XML Elements

    I have an XML file which have multiple element with same tag but different attribute. If I want to access a specific element with the require attribute, at the moment, I access every element and check it's attribute. Is there a way/method to get an element with the required attribute directly using JDOM

    ehm..
    Can you show how I have to do to get an element from a Xml file using Jdom and Xpath?
    my xml file is like this:
    <catalog>
        <param1>
              <name> XXX </name>
              <price> YYY </price>
        </param1>
        <param2>
              <name> EEE </name>
              <price> RRR </price>
        </param2>
        <param3>
              <name> TTT </name>
              <price> GGG </price>
        </param3>
    </catalog> tnx & bye

  • How to access XML elements by name in Extendscript??

    I'm almost done the script that I've been working on, but something has been nagging me since I started. When I did start, I looked at the JS Tools Guide CS5 that comes with the extendscript ide to check how to access XML elements, children, attributes etc. It says this:
    The XML object represents an XML element node in an XML tree. The topmost XML object for an XML file
    represents the root node. It acts as a list, which contains additional XML objects for each element. These in
    turn contain XML objects for their own member elements, and so on.
    The child elements of an element tree are available as properties of the XML object for the parent. The
    name of the property corresponds to the name of the element. Each property contains an array of XML
    objects, each of which represents one element of the named type.
    So basically it converts the XML into JSON. And you can access the properties like so:
    <book category="COOKING">
         <title lang="en">The Boston Cooking-School Cookbook</title>
         <author>Fannie Merrit Farmer</author>
         <year>1896</year>
         <price>49.99</price>
    </book>
    The Javascript statement bookstoreXML.book; returns the entire list of books.
    The statement bookstoreXML.book[0]; returns the XML object for the first book.
    The statement bookstoreXML.book[0].author; returns all authors of the first book.
    A couple pages down it talks about Retrieving contained elements using children(), elements(), descendants().
    So now I look through the XML Object properties and I see that I can use:
    xmlObj.child (which) which A String, the element name, or a Number, a 0-based index into this node’s child array.
    or
    xmlObj.descendants ([name])
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    or
    xmlObj.elements (name);
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    This is an excerpt of an XML I was working with:
    <ROW xmlns="http://www.filemaker.com/fmpdsoresult"
         MODID="16"
         RECORDID="11128">
       <Sign_Type>251.dr</Sign_Type>
       <fm:Location xmlns:fm="http://www.filemaker.com/fmpdsoresult" xmlns="">5-5024</fm:Location>
       <Line1>Zone
    Floor
    3
    Patient Rooms
    R532 - R436 even
    Patient Rooms
    R522 - R446 even
    Xavier Elevators
    Zone
    Patient Rooms
    R537 - 5757 odd
    Main Elevators
    Zone</Line1>
    </ROW>
    Extendscript will not give me an anything when I try to access elements by name. Instead I have to access by index, which works, but I'd rather search for names!
    Actually the console log returns: <![CDATA[]]>
    What am I doing wrong!?

    First, those E4X XML objects are definitely no JSON (plain data) - they have a multitude of methods, even for tasks that would easily be implemented as property (e.g. the length() function), and they also bind xml element and attribute names onto the objects, allowing to target a multitude of XML nodes with a single statement. Or did you mean your script with that "it"?
    Anyway, as you found out the ExtendScript XML object handles namespaces mostly by hiding them from you.
    You could play around with global namespace settings, see the JavaScript tools guide.
    You could also explicitly specify a namespace. This works for me:
    $.writeln(myXML["fm:Location"]);
    For simple use I had most success with a brute force approach that just strips the namespaces.
    function removeAllNamespace(xml)
              var ns =new Namespace();
              var d=xml.descendants();
              for (var i=0;i<d.length();i++)
        d[i].setNamespace(ns);

  • Can multiple users on one mac access Photoshop Elements?

    Hi all,
    I am considering purchasing Photoshop Elements on our family Mac, there are four user accounts, when Elements is installed is it possible for all users to access it?
    I appreciate that I will probably have to amend the users access rights through the system preferences however I wanted to make sure that there isn't any restrictions from Elements point of view.
    Thanks for anyone's help in advance.
    Chris

    Read the Adobe licence agreement. I don't understand it. Its written for lawyers, judges and jury IMO.

  • Accessing container element in the User Defined Function

    Hi All,
    I am accessing a container element in the user defined function.
    But it is not working. Actually i want to split a message(1800 records) into a batch of 200.
    But it goes in a infinite loop.
    Please can you tell me where i am wrong.
    Smita
    The code is :
    public void SplitMsg(String[] a,ResultList result,Container container){
    Object container1;
    String counter;
    int i,j=0;
    container1 = container.getParameter("value");
    if( container1 == null){
    counter  =  "0";
    else {     
         counter = container.toString();
         j = Integer.valueOf(counter).intValue();
    for ( i = j ; i <= j + 199 ; i++){
         if ( i  >= a.length){
              container.setParameter("value","9999999");
              break;
         result.addValue(a<i>);
         j += 200;
         counter = Integer.toString(j);
         container.setParameter("value", counter);

    Here is another way to accomplish what you wanted.
    For the target mapping, use this sequence for mapping
    Source element -> removeContext -> Your User-defined Function -> Target Element
    When defining User-Defined Function, select "Cache Queue" option.
    Since you are using removeContext before calling the UserDefined function, your input to the user defined function will be a String array without ResultList.CC.
    Now manipulate the array the way you want it, and build the ResultList result.
    After every 200 records, use method
    void addContextChange().
    This will insert the ResultList.CC at the appropriate places.
    Use Display Queue in the Mapping Editor to see the debug values.

  • Need to access parent elements in nested for-each loop

    Hi All,
    I have a xslt mapping requirement in which I am completely stuck. The details are as listed below. Please help!
    Schema structure is as follows:
    Root
    Payload
    Transaction-123
    Loop-LINE
    Loop-SDPP
    Segment-FSTT
    Element-111
    Required xslt file structure is:
    <xsl:for-each Loop-LINE>
    <tns:Item>
    <Line-1000>
    <Line-2000>
    <Line-3000>
    <Line-8000>
    <xsl:for-each Loop-SDPP>
    <xsl:for-each Segment-FSTT[ns0:Element-111 != "A"]>
    <SDetails>
    </SDetails>
    <xsl:for-each Loop-LINE> --------- How to access Loop-LINE element from this for loop????
    <tns:Item>
    <2000>
    <2020>
    <2070>
    <2150>
    </tns:Item>
    </xsl:for-each>
    </for-each>
    </for-each>
    </tns:item>
    </for-each>
    Need help in understanding how can I run a for-each loop for Loop-LINE which is two levels up in the schema tree structure.
    Thanks..

    Thanks for this answer but I can't obtain the right output with my test case; the multi column must be in the loop as that :
    ALPHABETICAL INDEX C1
    Alternator .......................................... Feed Pump
    Belt Details / Engine Gaskets Sets ..... Flywheel Housing
    < NEW PAGE>
    INDEX ALPHABETIQUE C2
    Alternateur......................................... Culbuteurs
    Bloc-Cylindres.................................... Demarreur
    Denis

  • Accessing form elements within a Spry region.

    Since nested Spry regions isn't yet support, can someone tell
    me how to access and modify form elements within a existing region?
    For example, I have a region that displays a form based on
    data I defined in a javascript array. On of the form elements is a
    select with some options. I want to added and remove options to
    this select depending on the number of objects in the data array.
    The select is not defined when I try to access it after spry
    has finished rendering the form, eg
    document.forms[0].selOrder1.options.length = 0;
    How are Spry regions attached to the browser's DOM? Does Spry
    create it's own DOM subordinate to the main DOM?
    Is it possible to make changes to a Spry region without using
    Spry?
    thx
    pwp

    Actually, there are a couple of ways to get access to the DOM
    underneath a region container. If you have a region, you can put an
    ID attribute on the region container node, or if you are using a
    region observer, the data passed into the observer has a regionNode
    property. So if you want access to the region DOM anytime the
    region is re-generated, do something like this:
    function myRegionObserver(notificationType, notifier, data)
    // We only want to do something after the region is
    re-generated,
    // for all other notifications, do nothing.
    if (notificationType != "onPostUpdate")
    return;
    // If your region container element has an ID on it, just
    use
    // getElementByID. This is useful in the case where your
    observer
    // is only ever registered with one region.
    var rgnElement1 = document.getElementById("headerRegion");
    alert(rgnElement1.innerHTML);
    // Or you can simply use the regionNode property of the data
    // that is passed in. This is useful if you've registered
    the same
    // observer on multiple regions. The regionNode property
    will
    // contain the region container node for the region that is
    currently
    // being updated.
    var rgnElement2 = data.regionNode;
    alert(rgnElement2.innerHTML);
    Spry.Data.Region.addObserver("headerRegion",
    myRegionObserver);
    <div id="headerRegion" spry:region="ds1">
    </div>
    --== Kin ==--

  • XML element name contains (.) periods, how to access each element value?

    Hi All,
    This is the xml that needs to be processed.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <com.companyx>
    <person>
    <employee.data>
    <employee.name>mrx</employee.name>
    <employee.number>1001</employee.number>
    </employee.data>
    <employee.data>
    <employee.name>mry</employee.name>
    <employee.number>1002</employee.number>
    </employee.data>
    <employee.data>
    <employee.name>mrz</employee.name>
    <employee.number>1003</employee.number>
    </employee.data>
    <page>0</page>
    </person>
    </com.companyx>
    Please tell me how to access the <employee.name> value of
    the first <employee.data> element.
    An early help is much appreciated.......
    Thanks in Advance,
    Vijay Karthik

    Give this a try... should do the trick
    trace(myXML.person["employee.data"][0]["employee.name"])

  • How to access Flash elements panel in DW SC3?

    when I insert Image Viewer and every time I click on it the
    Flash elements panel shows up automatically.
    However if I close the panel group, I can no longer get the
    Flash elements panels when I click on the Viewer and I can't find
    any access or menu that opens this panel. The only way I found is
    to create a new viewer and undo. Does anyone know how is one
    suppose to access this panel after being closed?

    1.  First, minimize the file panel by clicking in the dark bar at the very top of the file panel (the one that has a little arrow on the right side), which will make the file panel tiny (no file names will be shown).  Unless you have previously removed assets and snippets by dragging their tabs out and closing them, the tiny file panel will be attached to the asset panel and snippets panel, so you will be minimizing all of these at once.
    2.  Next, drag the file panel to the level that has tabs saying, Code, Split, Design. 
    3.  Then drag the file panel to either the far left of the screen or far right of the screen, which will cause it to dock. 
    4.  Finally, click the tiny arrow on the top right of the dark bar of the file panel; this will expand the file panel again so that you can see your file names. It will also expand the assets panel and the snippets panel if they are attached.

Maybe you are looking for

  • Not able to use sky drive pro for sharepoint 2013

    Hi Friends, recently i have updated my sharepoint farm to sharepoint 2013 from sharepoint 2010.. due to some reasons I have not visually upgraded a site to sp2013 visual effects but all other sites have been visually upgraded. now, when I try to sync

  • Print button in Flash

    Hi all, new to this forum.... and flash. I am creating an Indesign file which will be sent to clients as a pdf. It has buttons to go navigate through the pages and to register which is fine. I have created those  in Flash but I also need to create a

  • HT1212 How to transfer movie from iTune to my iPhone 5?

    Hi Community, I would like to know how to transfer movie from iTune to iPhone. A step-by-step procedure will be appreciated. Thanks and regards, Jidanne

  • Error MEPO000

    Hi friends , When i am saving the PO , the system showing error message " Purchase order still contains faulty items Message no. MEPO000" , so what should be the problem . When give tax code in invoice tab then only it appear . Please reply , Raghu

  • Best Practice for converting Temps to Permanent Employees

    I'm interested in how other companies handle the conversion of Temporaory Employees to Regular Full-Time Employees. Currently, my company has a entirely separate "Temp Hire", which we use to get them in the system.  When they convert we perform a Ter