ArrayList

Hello

In .net, we the ArrayList class, which can be used for creating table, erases the content, adds items.

Don't we have some think like this in blackberry jaa?

I tried to use a series of tables, but its me gives error

 public static Arrays aInfoserverlist = new Arrays();

It gives me error as

"Arrays() has access private net.rim.device.api.util.Arrays.

I need to create the table, who accept strings, erase it, add new one, copy in another table

any solution?

Thanks in advance!

Try to use vectors instead of arrays.

Sample code will give an idea similar to the feature table:

import java.util.Vector;

Vector SSV1 = new Vector();

To add items

SSV1. AddElement ("channel name");

To set / change items at the specified index

SSV1.setElementAt (Temp1, IndexID);

To remove specific elements

SSV1. Remove (index)

Tags: BlackBerry Developers

Similar Questions

  • Does anyone know of any method of replacement for ArrayList

    Purpose:

    Using a method to add the element Byte.

    Problem:

    Tyr to use Vector or ByteVector, but stop to a Byte [].

    origianl code

    public ArrayList = new ArrayList () cpu_config;

    {} public void setConfigInt (char key, int value)
    To add items
    cpu_config. Add (new Byte ((byte) key));
    Byte [] arr is Util.itob (value);.
    cpu_config. Add (new Byte(arr[0]));
    cpu_config. Add (new Byte(arr[1]));
    cpu_config. Add (new Byte(arr[2]));
    cpu_config. Add (new Byte(arr[3]));
    }

    Does anyone know any alternative method?

    Thank you for your attention.

    public ByteVector cpu_config = new ByteVector();

    {} public void setConfigInt (char key, int value)

    ByteVector method
    key to cpu_config. AddElement ((Byte));
    Byte [] arr is Util.itob (value);.
    cpu_config. AddElement ((arr[0]));
    cpu_config. AddElement ((arr[1]));
    cpu_config. AddElement ((arr[2]));
    cpu_config. AddElement ((arr[3]));

    }

    Solved.

    See you soon,.

  • Java.util.Arraylist

    Hi all

    I use my own enterprise Java API (they make to apache savings) in my blackberry project. but when I use these classes in my project, his error giving because they use arraylist map etc but here in my project its error, ID do not coz you know there is no card ArrayList etc classes in BB.

    How I can use them, or to do a different API for specified BB?

    or how to add these classes in my project. coz they use many classes that does not exist in BB.

    Thank you

    Zahid

    There is no way you can use except re-implement all of your API, because Blackberry using JavaME and not JavaEE/SE. But the work will be too big to do.

    So you should forget your auto-generated files and develop everything yourself: s

  • No java.util.ArrayList?

    I need a sorted table, but I didn't notice any ArrayList in the API documentation.  Is it because it is not supported on the device?  If so, I've just got to roll my own, perhaps by setting up a list of the interfaces?

    Patrick

    Try SimpleSortingVector - should work as a replacement.

  • How to refresh the arraylist on MAF UI

    Hello

    I'm developing an application of MAF with Jdev 12.1.3.0.0.

    I have a listView on my page of amx. This is value bound to an arraylist (ArrayList < String >) in the bean support. There is an event of action on the page, which adds items to the ArrayList instance.

    My problem is, I'm not able to update the display of the list on my user interface.

    Newspapers, I am able to see the event method called as well as a list of Board action is changed.

    But that updated the arraylist reflects not on my user interface.

    Here is my code snippets:

    ---------------------------

    the amx page:

    < amx:listView var = value ' row' = "#{TripsBacking.refreshtimelist}" showMoreStrategy = 'autoScroll' bufferStrategy "viewport" id = "listView1" = > "

    < amx:listItem id = "SDp" showLinkIcon = "false" >

    < amx:outputText value = "#{line}" id = "ot1" / >

    < amx:actionListener id = binding = "#{TripsBacking.pullToRefresh"al1"}" type = "swipeDown" / > "

    < / amx:listItem >

    < / amx:listView >

    ---------------------------

    Backing bean:

    public class TripsBacking {}

    ArrayList < String > refreshtimelist;

    Transitional public PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport (this);

    Transitional public ProviderChangeSupport providerChangeSupport = new ProviderChangeSupport (this);

    {} public void setRefreshtimelist (ArrayList < String > refreshtimelist)

    ArrayList < String > old_value = this.refreshtimelist;

    This.refreshtimelist = refreshtimelist;

    propertyChangeSupport.firePropertyChange (old_value, "refreshtimelist", refreshtimelist);

    providerChangeSupport.fireProviderRefresh ("refreshtimelist");

    }

    public ArrayList < String > getRefreshtimelist() {}

    Return refreshtimelist;

    }

    public TripsBacking() {}

    refreshtimelist = new ArrayList < String > ();

    refreshtimelist. Add (Calendar.GetInstance () .getTime (). ToString());

    }

    {} public void pullToRefresh (ActionEvent actionEvent)

    Calendar c = Calendar.GetInstance ();

    Date d = c.getTime ();

    ArrayList < String > templist = getRefreshtimelist ();

    System.out.println ("date:" + d);

    templist. Add (d.ToString ());

    setRefreshtimelist (templist);

    }

    {} public void addPropertyChangeListener (PropertyChangeListener l)

    propertyChangeSupport.addPropertyChangeListener (l);

    }

    {} public void removePropertyChangeListener (PropertyChangeListener l)

    propertyChangeSupport.removePropertyChangeListener (l);

    }

    }

    ------------------------------

    I will surely provide more information if necessary.

    Ask for your help to solve this problem. Thank you.

    Thank you

    Tejas desrousseaux

    Hi Tejas,

    you declare a variable of providerChangeSupport, but you need to add public methods to support:

        public void addProviderChangeListener(ProviderChangeListener l) {
            providerChangeSupport.addProviderChangeListener(l);
        }
    
        public void removeProviderChangeListener(ProviderChangeListener l) {
            providerChangeSupport.removeProviderChangeListener(l);
        }
    

    You must move the providerChangeSupport.fireProviderRefresh ("refreshtimelist"); calling the method "pullToRefresh" (after the call to the set method).

    If you trigger the refresh, the entire list is reloaded. If you want to refresh only new posts, you must use the method providerChangeSupport.fireProviderCreate (Oracle Fusion Middleware Java QAnywhere for Oracle Mobile Application Framework).

  • the resolution may not be cast in java.util.ArrayList

    I hava an accordion panel with this function in disclosureListener:

    {} public void terrababdelhak (DisclosureEvent disclosureEvent)

    System.out.println ("SHOW all THE NEWSPAPERS");

    int stateIndex [---]

    DCIteratorBinding dcLogs = (DCIteratorBinding) getBindings () .get ("LogTypesVO1Iterator");

    ViewObject voLogs = dcLogs.getViewObject ();

    List of JUCtrlListBinding = (JUCtrlListBinding) getBindings () .get ("LogTypesVO1");

    System.out.println ("LIST LOGS" + list);

    DCIteratorBinding iter = list.getDCIteratorBinding ();

    System.out.println ("ITER LOGS" + iter);

    RowSetIterator rsi = voLogs.createRowSetIterator (null);

    System.out.println ("RSI" + rsi);

    int i = 0;

    rowCount int = (int) voLogs.getEstimatedRowCount ();

    stateIndex = new int [rowCount];

    While (rsi.hasNext ()) {}

    System.out.println ("SEGUINTE!");

    Line nextRow = rsi.next ();

    iter.setCurrentRowWithKey (nextRow.getKey () .toStringFormat (true));

    INDX int = iter.getCurrentRowIndexInRange ();

    stateIndex [i] = indx;

    System.out.println ("Index loop-" + indx);

    i ++ ;

    }

    rsi.closeRowSetIterator ();

    System.out.println ("INDEX" + stateIndex);

    list.setSelectedIndices (stateIndex);

    System.out.println ("LISTA" + list);

    }

    Then I valuechangelister to selectmanycheckbox this function:

    {} public void filterLogs (ValueChangeEvent valueChangeEvent)

    Dc2 DCIteratorBinding = (DCIteratorBinding) evaluteEL ("#{bindings.") EntityLogsVO1Iterator}");

    ViewObject vo2 = dc2.getViewObject ();

    String WhereClause = "LOG_TYPE in (";"."

    System.out.println ("VALUE" + valueChangeEvent.getNewValue ());

    If (valueChangeEvent.getNewValue ()! = null) {}

    java.util.ArrayList selectedValues = (java.util.ArrayList) valueChangeEvent.getNewValue ();

    for (int i = 0; i < selectedValues.size (); i ++) {}

    If (!.) WhereClause.equals ("LOG_TYPE in (""))

    WhereClause += ', ';

    WhereClause += "'" + selectedValues.get (i) + "'";

    }

    WhereClause += ') ";

    VO2.setWhereClause (WhereClause);

    VO2. ExecuteQuery();

    } else {}

    WhereClause = "1 = 2";

    VO2.setWhereClause (WhereClause);

    VO2. ExecuteQuery();

    }

    }

    But when I uncheck a selectmanychoice point, cause this error:

    valueChangeListener = "#{backingBeanScope.backing_OrderDetail.filterLogs}": java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast in java.util.ArrayList.] "

    My selectmanycheckbox have this property:

    < af:selectManyCheckbox value = "#{bindings." LogTypesVO1.inputValue}.

    label = "#{bindings." LogTypesVO1.label}"id ="smc1.

    Simple Binding = "#{backingBeanScope.backing_OrderDetail.SMC1}" = 'true' "

    layout = "horizontal" autoSubmit = 'true '.

    valueChangeListener = "#{backingBeanScope.backing_OrderDetail.filterLogs}" >

    < f: selectItems value = "#{bindings." LogTypesVO1.items}"id ="si2 ".

    Binding="#{backingBeanScope.backing_OrderDetail.si2}"/ >

    < / af:selectManyCheckbox >

    my version of jdev is 11.2.4.0

    User

    You can not convert the ArrayList to direct object value

    java.util.ArrayList selectedValues = (java.util.ArrayList) valueChangeEvent.getNewValue ();

    write like this-

    ArrayList selectedValues = new ArrayList();

            Object [] str = (Object []) valueChangeEvent.getNewValue ();
            for (int i = 0; i)< str.length;="" i++)="" {="">
               

    System.out.println (STR [i]);

    selectedValues.add (str [i]); Add the values from an ArrayList

            }

    Ashish

  • java.lang.ClassCastException: java.util.ArrayList cannot be cast to oracle.adf.view.faces.bi.model.GeoMapDataModel

    Hello world

    LM l and map creation using table list as the data collection for the leaf theme of points to specify a given location. The problem l get here is that, after setting up the collection of data on the theme tab, the choice address and longtude & latitudes remain disabled. LM using JDeveloper 12 c last version & weblogic 12 c. When l run my lm project this error: java.lang.ClassCastException: java.util.ArrayList cannot be cast to oracle.adf.view.faces.bi.model.GeoMapDataModel. Here is the source code of my page and the Bean managed that define the ArrayList

    MapBean.pngPageSourceCode.png

    kdario Thanks for your comment, no. l didn't download the demo of component, but l did it right now. l use developer J 12 c to see how GeoMapDataModel is created .it will come back to you if any problem arises.

  • ArrayList of table

    Community salvation of oracle

    I have a problem to view the information of an arraylist on a table, I did some sort and create an arraylist (action with a button) then I call a popup which have the table according to the information of arraylist, but nothing does not appear anyone can helpme please?

    It is a part of my code:

    < af:panelCollection id = "pc1" >

    < f: facet = 'menus' name / >

    < f: facet name = "toolbar" >

    < af:toolbar id = "t2" >

    < af:commandButton text = "call" id = "cb4" >

    < af:showPopupBehavior popupId = "p1" triggerType = 'action' / >

    < / af:commandButton >

    < text af:commandButton = action = "#{medicos.mostrar_sesiones"show"}" id = "cb1" / > "

    < af:commandButton text = "sort" action = "#{medicos.» Programa2}"id ="cb6"/ >

    < / af:toolbar >

    < / f: facet >

    < name f: facet = 'bar of Θtat' / >

    < af:popup id = "p1" >

    < af:panelCollection id = "pc2" >

    < f: facet = 'menus' name / >

    < f: facet name = "toolbar" >

    < af:toolbar id = "t4" >

    < af:commandButton text = "Insertar" id = "cb5".

    action = "#{Medicos.mostrar_sesiones}" / >

    < / af:toolbar >

    < / f: facet >

    < name f: facet = 'bar of Θtat' / >

    < af:table value = "#{medicos.lista_medicos}" var = "row" rowBandingInterval = "0" id = "t3" > "

    < af:column sortable = "false" headerText = "Latitud" align = 'end' id = 'c9' >

    < af:outputText value = "#{row.latitud}" id = "ot1" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Length" align = 'end' id 'c10' = >

    < af:outputText value = "#{row.longitud}" id = "ot2" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Number" align = "DΘmarrer" id = "c11" >

    < af:outputText value = "#{row.nombre}" id = "ot3" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Esp" align = "DΘmarrer" id = 'c12' >

    < af:outputText value = "#{row.esp}" id = "ot4" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Centro_salud" align = "DΘmarrer" id = "c13" >

    < af:outputText value = "#{row.centro_salud}" id = "ot5" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Address" align = "DΘmarrer" id = "c14" >

    < af:outputText value = "#{row.direccion}" id = "ot6" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Cod_cmp" align = "end" id = "c15" >

    < af:outputText value = "#{row.cod_cmp}" id = "ot7" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Cod_zona" align = "end" id = "17" >

    < af:outputText value = "#{row.cod_zona}" id = "ot8" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Des_tipo_centro" align = 'end' id = 'c18' >

    < af:outputText value = "#{row.des_tipo_centro}" id = "ot9" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Des_sec_tipo_centro" align = 'end' id = 'c19' >

    < af:outputText value = "#{row.des_sec_tipo_centro}" id = "ot10" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Dia" align = "DΘmarrer" id = "c20" >

    < af:outputText value = "#{row.dia}" id = "ot11" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Hora_inicio" align = "DΘmarrer" id = "c21" >

    < af:outputText value = "#{row.hora_inicio}" id = "ot12" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Hora_fin" align = "DΘmarrer" id = "c22" >

    < af:outputText value = "#{row.hora_fin}" id = "ot13" / > "

    < / af:column >

    < af:column sortable = "false" headerText = "Option" align = "DΘmarrer" id = "c23" >

    < af:outputText value = "#{row.opcion}" id = "ot14" / > "

    < / af:column >

    < / af:table >

    < / af:panelCollection >

    < / af:popup >

    < af:table value = "#{bindings.lista_medicos1.collectionModel}" var = 'row' "

    Rows = "#{Bindings.lista_medicos1.rangeSize} '"

    emptyText = "#{bindings.lista_medicos1.viewable?" "{'No data to display.': 'Access Denied.'}".

    fetchSize = "#{bindings.lista_medicos1.rangeSize} '"

    rowBandingInterval = '0 '.

    selectedRowKeys = "#{bindings.lista_medicos1.collectionModel.selectedRow} '"

    selectionListener = "#{bindings.lista_medicos1.collectionModel.makeCurrent} '"

    rowSelection = "single" id = "t1" >

    < af:column sortProperty = "prog" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.prog.label} '"

    ID = "c8" >

    < af:inputText value = "#{row.bindings.prog.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.Prog.label} '"

    required = "#{Bindings.lista_medicos1.hints.Prog.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.Prog.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.prog.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.prog.tooltip} '"

    ID = 'it8' >

    < f: validator binding="#{row.bindings.prog.validator}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = 'dry' sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.sec.label} '"

    ID = "c5" >

    < af:inputText value = "#{row.bindings.sec.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.sec.label} '"

    required = "#{Bindings.lista_medicos1.hints.sec.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.sec.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.sec.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.sec.tooltip} '"

    ID = "9" >

    < f: validator binding="#{row.bindings.sec.validator}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = "DesNomCompleto" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.DesNomCompleto.label} '"

    ID = "c1" >

    < af:inputText value = "#{row.bindings.DesNomCompleto.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.DesNomCompleto.label} '"

    required = "#{Bindings.lista_medicos1.hints.DesNomCompleto.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.DesNomCompleto.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.DesNomCompleto.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.DesNomCompleto.tooltip} '"

    ID = "it5" >

    < f: validator binding="#{row.bindings.DesNomCompleto.validator}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = "Esp" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.Esp.label} '"

    ID = "c7" >

    < af:inputText value = "#{row.bindings.Esp.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.esp.label} '"

    required = "#{Bindings.lista_medicos1.hints.esp.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.esp.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.Esp.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.Esp.tooltip} '"

    ID = "it4" >

    < f: validator binding="#{row.bindings.Esp.validator}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = "Monday" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.Horario.label} '"

    ID = "c16" >

    < af:inputText value = "#{row.bindings.Horario.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.Horario.label} '"

    required = "#{Bindings.lista_medicos1.hints.Horario.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.Horario.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.Horario.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.Horario.tooltip} '"

    ID = "it6" >

    < f: validator binding="#{row.bindings.Horario.validator}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = "CentroSalud" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.CentroSalud.label} '"

    ID = "c6" >

    < af:inputText value = "#{row.bindings.CentroSalud.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.CentroSalud.label} '"

    required = "#{Bindings.lista_medicos1.hints.CentroSalud.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.CentroSalud.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.CentroSalud.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.CentroSalud.tooltip} '"

    ID = "it7" >

    < f: validator binding="#{row.bindings.CentroSalud.validator}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = "Address" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.Direccion.label} '"

    ID = 'c3' >

    < af:inputText value = "#{row.bindings.Direccion.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.direccion.label} '"

    required = "#{Bindings.lista_medicos1.hints.direccion.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.direccion.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.Direccion.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.Direccion.tooltip} '"

    ID = "it3" >

    < f: validator binding="#{row.bindings.Direccion.validator}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = "cant" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.cant.label} '"

    ID = "c2" >

    < af:inputText value = "#{row.bindings.cant.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.cant.label} '"

    required = "#{Bindings.lista_medicos1.hints.cant.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.cant.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.cant.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.cant.tooltip} '"

    ID = "it2" >

    < f: validator binding="#{row.bindings.cant.validator}"/ >

    < af:convertNumber groupingUsed = "false".

    pattern="#{bindings.lista_medicos1.hints.Cant.format}"/ >

    < / af:inputText >

    < / af:column >

    < af:column sortProperty = "IndMedicoTop" sortable = "false".

    headerText = "#{bindings.lista_medicos1.hints.IndMedicoTop.label} '"

    ID = 'c4' >

    < af:inputText value = "#{row.bindings.IndMedicoTop.inputValue} '"

    label = "#{Bindings.lista_medicos1.hints.IndMedicoTop.label} '"

    required = "#{Bindings.lista_medicos1.hints.IndMedicoTop.Mandatory} '"

    Columns = "#{Bindings.lista_medicos1.hints.IndMedicoTop.DisplayWidth} '"

    maximumLength = "#{bindings.lista_medicos1.hints.IndMedicoTop.precision} '"

    shortDesc = "#{bindings.lista_medicos1.hints.IndMedicoTop.tooltip} '"

    ID = "it1" >

    < f: validator binding="#{row.bindings.IndMedicoTop.validator}"/ >

    < / af:inputText >

    < / af:column >

    < / af:table >

    < / af:panelCollection >

    Yes. You can get the lines by using the following:

    DCIteratorBinding gridBinding = ADFUtils.findIterator ("setToTable");

    RowSetIterator rowIter = gridBinding.getRowSetIterator ();

    Row [] allRowsInRange = gridBinding.getAllRowsInRange ();

    for (line r1: allRowsInRange) {}

    R1. GetAttribute ("col1");

    R1. GetAttribute ("col2");

    }

    Now, use the values for other operations.

  • DCBindingContainer for ArrayList

    Hello

    Links DCBindingContainer = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();
    DCIteratorBinding dcItteratorBindings = bindings.findIteratorBinding("EmployeeVOIterator");

    ViewObject employeeTableData = dcItteratorBindings.getViewObject ();

    Line employeeRow = employeeTableData.getCurrentRow ();


    I don't have to VO or ViewObject...


    I have just an ArrayList which I display using af: table


    How can I change to get the data and the content of a line in the case of ArrayList

    Hello

    If you do use ADF binding at all then the binding code (DCBindingContanier etc is out of reach for you). Instead, you work directly at the table instance (richeTableau). Create a component mandatory table reference (bindings property) to a bean managed within the application or endossage scope of bean. This allows you to access the instance of richeTableau. From here you can iterate by index on the rows of the table and update your ArrayList with changed data.

    Alternatively, you create a data control the bean that exposes the ArrayList and CHOSE to use POJO

    Frank

  • Table linked to an ArrayList, get data repeatedly

    11.1.2.2 JDev

    I have a page with three showDetailHeaders.

    The first showDetailHeader, that is disclosed during of the loading of the page, has a pie chart that is linked to a ViewObject.  It makes it very well.

    The second showDetailHeader, which is not disclosed during the loading of the page, has a richeTableau that is bound to an ArrayList < CustomEO > that is generated in a managed Bean.  When I divulge the second showDetailHeader, the bean method that generates the data in the table is called several times (15 times).  Once the table load, when I scroll beyond the "rangeSize", it hits again repeatedly bean method to get the next batch in the range.

    Any ideas what might be causing the loop?

    Here is the code for the table and surrounding showDetailHeader:

    <af:showDetailHeader text="Out Of Compliance Training Items" disclosed="false" id="sdh1"
                                     type="default">
                      <f:facet name="context"/>
                      <f:facet name="menuBar"/>
                      <f:facet name="toolbar"/>
                      <f:facet name="legend"/>
                      <f:facet name="info"/>
                      <af:table value="#{MytrainingStatusSummaryBean.outOfComplianceItemsData}" var="row"
                                rowBandingInterval="0" id="t1" styleClass="AFStretchWidth" fetchSize="25">
                            <af:column sortable="false" headerText="Username" align="start" id="c1" width="125">
                                  <af:outputText value="#{row.username}" id="ot1"/>
                            </af:column>
                            <af:column sortable="false" headerText="First Name" align="start" id="c2" width="150">
                                  <af:outputText value="#{row.firstName}" id="ot2"/>
                            </af:column>
                            <af:column sortable="false" headerText="Last Name" align="start" id="c3" width="150">
                                  <af:outputText value="#{row.lastName}" id="ot3"/>
                            </af:column>
                            <af:column sortable="false" headerText="Item Title" align="start" id="c4" width="250">
                                  <af:outputText value="#{row.itemTitle}" id="ot4"/>
                            </af:column>
                            <af:column sortable="false" headerText="Due Dt" align="start" id="c5" width="150">
                                  <af:outputText value="#{row.dueDt}" id="ot5"/>
                            </af:column>
                      </af:table>
                </af:showDetailHeader>
    

    Here is the code for the method that generates the ArrayList < CustomEO > that the table is related to:

    public List getOutOfComplianceItemsData() {
            logger.info("Getting OutOfComplianceItemsData");
            List<CustomEO> outOfComplianceItemsData = new ArrayList<CustomEO>();
            BindingContainer bindings = ADFUtils.getBindingContainer();
            DCIteratorBinding iter = (DCIteratorBinding) bindings.get(ITERATOR_NAME);
            MytrainMatrixVOImpl vo = (MytrainMatrixVOImpl) iter.getViewObject();
            vo.setbind_SiteId(SessionUtils.getSelectedSiteId());
            vo.executeQuery();
           
            RowSet rs = vo.getRowSet();
            while(rs.hasNext()){
                logger.finer("Checking Row.");           
                MytrainMatrixVORowImpl row = (MytrainMatrixVORowImpl) rs.next();
                Long daysUntilExpiration = row.getDaysUntilExpiration();
               
                if(daysUntilExpiration < 0L && daysUntilExpiration != -9999999L){
                    logger.finer("Adding MytrainOutOfComplianceItemsCustomEO to list || ITEM_ID: " + row.getItemId() + " || USER_ID: " + row.getUserId());
                    MytrainOutOfComplianceItemsCustomEO newEo = new MytrainOutOfComplianceItemsCustomEO();
                    newEo.setUsername(row.getUsername());
                    newEo.setFirstName(row.getFname());
                    newEo.setLastName(row.getLname());
                    newEo.setItemTitle(row.getTitle());
                    newEo.setDueDt(row.getDueDt());
                    outOfComplianceItemsData.add(newEo);
                }
            }
            logger.info("Returning OutOfComplianceItemsData");
            return outOfComplianceItemsData;
        }
    

    Getters in JSF/ADF are called several times during the life cycle request, is not a good idea to have operations 'expensive' in them.

    Try to fill the list in another place and getter keep only:

    public list getOutOfComplianceItemsData() {}

    Return outOfComplianceItemsData;

    }

    Dario

  • ArrayList to EL - jdev 11.1.2.3

    Hello:

    I have an ArrayList defined in a Bean managed with getters and setters:

    private ArrayList < String > al = new ArrayList < String > ();

    CLL Add ("Red");
    CLL Add ("Green");
    CLL Add ("Blue");

    In the EL, to refer to the second chain of value, I use:
    [#{BeanName.al [1}] which returns Green

    This works well.

    I'm trying to use this structure EL to pass the value of 1 to a method that takes an int parameter.

    How can I get the index value of 1 in the bean? in java I need the index position [1] in this example to call my method before EL returns. The accessor Get of ArrayList is not any reference to the index position. If I can get the index position, I think that I can use for my calculations, update ArrayList with the appropriate color for this post and then return the color.

    Is there a way to do this?

    Thanks for the help.

    You can use the card trick to invoke a method with a parameter in an EL expression. You must implement a custom class that implements the map interface and use it instead of ArrayList in your managed bean. As far as the property returned by the bean Get accessor method is an object of the card, the EL expression can specify a parameter in square brackets after the name of the bean property. The parameter is passed as a value for the key to the map get() method:

    An example of an EL expression:

    #{BeanName.myMap[2]}
    

    The bean class:

    ...
    // This property is declared as static here because the underlying class in this example below contains pure logic only but no member variables.
    // If your Map class contains some member variables at object instance level, then it should not be declared as static.
    private static MyCustomMap myMap = new MyCustomMap();
    
    public MyCustomMap getMyMap() {
      return myMap;
    }
    ...
    

    An example of a custom class that implements the map interface:

    import java.util.HashMap;
    public class MyCustomMap extends HashMap
    {
      public MyCustomMap()
      {
      }
    
      @Override
      public Object get(Object key)
      {
        // The "key" parameter contains the value specified within the square brackets in the EL expression.
    
        // Here you can implement whatever logic you need,
        // for example you can calculate the color dynamically depending on the value of the "key" parameter.
        // Note, that it is not mandatory for the the "key" parameter to be of Integer type.
        // It may be of any type that you can specify in the EL expression.
        // It is up to you to decide what parameter type you need.
    
        // A sample logic, expecting an integer value in the "key" parameter:
        if (Integer.valueOf(1).equals(key)) {
            return "red";
        } else if (Integer.valueOf(2).equals(key)) {
            return "green";
        } else if (Integer.valueOf(3).equals(key)) {
            return "blue";
        }
        return null;
      }
    }
    

    Dimitar

  • Try to extend ArrayList

    I would like to create a class, NewArrayList, which is identical to the ArrayList. When I try to extend ArrayList, I can't specify the object type that my NewArrayList will hold. I want to be able to specify that, just like I would with ArrayList.

    I don't know that it's nothing more than a syntax problem. Maybe someone can help me here.

    Do you mean that you want to use generic drugs with her?

    public class YourArrayList extends ArrayList
    
  • ClassCastException: java.util.ArrayList cannot be cast to oracle.adf.view.f

    Hello

    I am currently check why I encounter this error in a line graph?

    Basically I have the managed bean
    public class TestMB
    {
      private List<Object[]> tabularData = new ArrayList<Object[]>();
    
      public void setTabularData(List<Object[]> tabularData)
      {
        this.tabularData = tabularData;
      }
    
      public List<Object[]> getTabularData()
      {
        
        return tabularData;
      }
    }
    In the code, I have this defined graphic line.
    <dvt:lineGraph id="lineGraph1" subType="LINE_VERT_ABS"
       emptyText="No Data To Display"
       value="#{backingBeanScope.TestMB.tabularData}"
       contentDelivery="immediate">
           <dvt:background>
              <dvt:specialEffects/>
           </dvt:background>
           <dvt:graphPlotArea/>
           <dvt:seriesSet>
              <dvt:series/>
           </dvt:seriesSet>
           <dvt:o1Axis/>
           <dvt:y1Axis/>
           <dvt:legendArea automaticPlacement="AP_NEVER"/>
    </dvt:lineGraph>
    But I continued to encounter this error.
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to oracle.adf.view.faces.bi.model.DataModel
    My thought is that I would be able to display the emptytext attribute.

    JDeveloper 11.1.1.6

    Published by: Neliel Sep 9, 2012 23:51

    Neliel,

    You must link to the tabularData property and not to the value property.

    
           
              
           
           
           
              
           
           
           
           
    
    

    Arun-

  • How to display the arraylist &lt; list &gt; jsf page

    HII all,.

    I'm having a jspx page where I want to display the value from a bean class Get accessor...

    the Get accessor returns a list Arrarylist

    and I want to display the list of table in its entirety on the jspx page when it is loaded.

    The method is: -.

    public ArrayList < list > getMyList() {}
    myList = getDocumentProperties ();
    return myList;
    }

    How to navigate the entire list on jsf... ??

    any idea... !!

    Thank you

    You can use or in an ADF Faces page to iterate over the items returned by the method getMyList() of the bean:

    
      
    
    

    If you want to browse the internal lists, then use a nested iterator:

    
      
        
      
    
    

    Dimitar

  • LiveCycle remote functions parameter ArrayList (correspondence management))

    Hi guys,.

    I'm working on a function of personalized distance used by the management of correspondence. The interface/implementation class looks like the following:

    import com.adobe.exm.expeval.ServiceMethod;

    import java.util.ArrayList;

    interface EXMService {}

    @ServiceMethod

    Abstract String testString (String content);

    @ServiceMethod

    Abstract String testList (ArrayList list);

    }

    import com.adobe.exm.expeval.ServiceMethod;

    import java.util.ArrayList;

    / public class EXMServiceImpl implements EXMService {}

    @ServiceMethod (enabled = true, displayName = "testFunc1", description = "works fine")

    public String testString (string content) {}

    return 'works ';

    }

    @ServiceMethod (enabled = true, displayName = "testFunc2", description = "does not work")

    public String testList (ArrayList list) {}

    return 'works ';

    }

    }

    As soon as I install the bundle and try to get a list of all remote custom installed/available services (correspondence interface), I get an empty list and the following exception:

    13.12.2013 12:22:44.998 * INFORMATION * DS. Message.Remoting.Sling Service started for remote invocation: ServiceInfoImpl {reference = [com.adobe.livecycle.content.test.EXMService], destinationId = 'test', started = true}

    13.12.2013 12:23:00.957 * ERROR * DS. Error Message.Remoting invocation to treatment distance: java.lang.IllegalArgumentException: java.util.ArrayList type is not supported

    incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)

    operation = listServices

    clientId = 6FEEEB2B-EED0-4CBE-992A-01FC6425A3A1

    destination = lc.exm.functionService

    messageId = ED6A005A-1542-8A30-E923-EBB201BCEEE7

    timestamp = 1386933780957

    timeToLive = 0

    body =

    [

    null

    ]

    HDR (Iddm) = D5AE6DA2-2225-4358-A7A7-B189E6A3DEF5

    HDR (DSEndpoint) = my-amf

    java.lang.IllegalArgumentException: java.util.ArrayList type is not supported

    at com.adobe.exm.expeval.fn.MethodUtils.getType(MethodUtils.java:40)

    at com.adobe.exm.expeval.fn.FunctionServiceImpl.toFunctionParameterVO (FunctionServiceImpl.ja goes: 105)

    at com.adobe.exm.expeval.fn.FunctionServiceImpl.toFunctionVO(FunctionServiceImpl.java:150)

    at com.adobe.exm.expeval.fn.FunctionServiceImpl.listServices(FunctionServiceImpl.java:164)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:606)

    at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:404)

    at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)

    at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1465)

    at flex.messaging.AsyncMessageBroker.filteredRouteMessageToService (AsyncMessageBroker.java:5, 64)

    to flex.messaging.filters.SyncMessageFilterChain$ MessageFilterContext.filterRequest (SyncMess ageFilterChain.java:219)

    to com.adobe.dataservices.impl.DelegatingSyncFilter$ DelegatingMessageFilterContext.filterReq uest(DelegatingSyncFilter.java:95)

    to com.adobe.dataservices.impl.DelegatingSyncFilter$ DelegatingMessageFilterContext.processRe quest(DelegatingSyncFilter.java:83)

    at com.adobe.dataservices.impl.DelegatingSyncFilter.filterRequest (DelegatingSyncFilter.java: 62)

    to flex.messaging.filters.SyncMessageFilterChain$ MessageFilterContext.filterRequest (SyncMess ageFilterChain.java:215)

    to flex.messaging.filters.SyncMessageFilterChain$ MessageFilterContext.processRequest (SyncMes sageFilterChain.java:201)

    to flex.messaging.filters.SyncMessageFilterChain.filterRequest (39 SyncMessageFilterChain.java:1)

    at flex.messaging.AsyncMessageBroker.routeMessageToService(AsyncMessageBroker.java:554)

    at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1041)

    at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)

    at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)

    at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)

    at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)

    at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:192)

    at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:330)

    at com.adobe.dataservices.impl.ApplicationManagerImpl.service (ApplicationManagerImpl.java:67 3)

    at org.apache.jsp.libs.dataservices.components.messagebroker.POST_jsp._jspService (POST_jsp.j ava: 98)

    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service (JspServletWrapper .java:502)

    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service (JspServletWrapper .java:449)

    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp (JspScriptEngineFactory.java:241)

    in org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$ 100 (ava JspScriptEngineFactory.j: 86)

    to org.apache.sling.scripting.jsp.JspScriptEngineFactory$ JspScriptEngine.eval (JspScriptEngin eFactory.java:441)

    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)

    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)

    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service (DefaultSlingScript.java:4 63)

    at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)

    at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render (SlingComponentFilter Chain.java:45)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:64)

    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:148)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude (WCMComponentFilter.java:333)

    at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:160)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent (SlingRequestProce ssorImpl.java:254)

    at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render (RequestSlingFilterChai n.java:49)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:64)

    at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:106)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:290)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.adobe.livecycle.content.appcontext.impl.AppContextFilter.doFilter (AppContextFilter.ja goes: 58)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.adobe.livecycle.content.sling.impl.ResourceResolverFilter.doFilter (ResourceResolverFi lter.java:34)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.adobe.livecycle.crx.security.SpringSecurityBridgeFilter.doFilter (SpringSecurityBridge Filter.java:65)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.adobe.livecycle.process.reporting.servlet.filter.ProcessReportingResourceResolverFilt er.doFilter(ProcessReportingResourceResolverFilter.java:70)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.adobe.livecycle.lccomponent.util.LcComponentResourceResolverFilter.doFilter (LcCompone ntResourceResolverFilter.java:54)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    to com.adobe.livecycle.dsc.clientsdk.internal.ResourceResolverHolderFilter.doFilter (Resource ResolverHolderFilter.java:37)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter (RequestProgre ssTrackerLogFilter.java:59)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter (FormsHandlingServlet.j ava: 220)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter (AbstractSlingFilter Chain.java:60)

    to com.day.cq.theme.impl.ThemeRe...

    Without the testList method, everything works fine.

    Any clue?

    THX in advance

    Jwe

    Hello

    Only primitive types are supported as arguments in functions remotely.

    There is no scenario where one needs for collection at a distance of functions. Using the list as arguments was manully blocked in CM.

    Can you explain your case to use here, as in why you wish a list of tables to a distance function?

    Please see the link below on how the collection elements are used in an expression.

    http://help.Adobe.com/en_US/LiveCycle/11.0/ExpressionManagerTechGuide/WSc070aef4a1ec54562a e81de91312ac1e1be - 8000.2.html

    Kind regards

    Javed

Maybe you are looking for