BlackBerryContact.getAttributes return IllegalArgumentException

I need to retrieve the labels of each number in the contact card:

BlackBerryContact objBBContact = (BlackBerryContact) context;

PIMList objPIMList = objBBContact.getPIMList ();

int intCounter = objBBContact.countValues (BlackBerryContact.TEL);

for (int i = 0; i)< intcounter;="">
{

...

strLabel = objPIMList.getAttributeLabel (objBBContact.getAttributes (BlackBerryContact.TEL, i));

...

}

The getAttributes throw IllegalArgumentException on the 'Mobile 2' field

Thanks in advance

It works on the last Simulator 4.7.1 BB 9630, maybe it's a bug in the BB 9000 Simulator.

Tags: BlackBerry Developers

Similar Questions

  • ViewObject line getAttribute returns null when I know that the data is there.

    Hi all

    I have a simple piece of code in my implementation of the Application Module class to define a binding on a view variable and return the results to my REST Web Service project.

        public ListItem[] returnListForCategory(String category) {
            ListItem[] result =  null;
            Row row = null;
                    
            ViewObjectImpl voi = getListForCategoryVO1();
            voi.setNamedWhereClauseParam("Category", category);
            int rows = (int) voi.getEstimatedRowCount();
            int idx = 0;
            result = new ListItem[rows];
    
            while (voi.hasNext()) {
                row = voi.next();
                ListItem item = new ListItem();
                
                System.out.println("returnListForCategory: code: " + (String)row.getAttribute("Code"));
                System.out.println("returnListForCategory: codeDescription: " + (String)row.getAttribute(1));
                item.setCode((String)row.getAttribute("Code"));
                item.setCodeDescription((String)row.getAttribute("CodeDescription"));
                
                result[idx] = item;
                idx++;
            }        
            
            return result;
        }

    When I run the debugger Houston (right click on the Module of the Application and select Debugging), the point of view getListForCategoryVO works as expected: three lines, with data in the fields.

    When I deploy this on WLS, and run via the WS REST I get three rows, but all the attributes ('Code' and 'Code') have the value null.

    Here's the REST WS code that calls it (in case it is relevant).

        private static final String amDef = "model.am.LookupListsAM";
        private static final String config = "LookupListsAMLocal";
    
        @GET
        @Path("/{category}")
        public ListItems getList(@PathParam("category") String category) {
            ListItems result = new ListItems();
            ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
    
            LookupListsAMImpl llami = (LookupListsAMImpl)am;
            model.dto.ListItem[] items = llami.returnListForCategory(category);
            
            for (model.dto.ListItem item : items) {
                ListItem newItem = new ListItem();
                newItem.setCode(item.getCode());
                newItem.setCodeDescription(item.getCodeDescription());
                result.addListItem(newItem);
            }
            Configuration.releaseRootApplicationModule(am, true);
            return result;
        }
    

    Do you have any idea what I am doing wrong, or it could be the cause?

    TIA

    You use libraries remains part or a third party provider of jax - rs? (this may be a problem with the classpath)

    Dario

  • ADF: vo.first () .getAttribute returns null... How to handle this?

    Hello

    IM using Jdev 11 G.
    im getting a column of VO value:
    Address of string = v.first ().getAttribute("EmpAddress").toString ();

    Here EmpAddress is null for rare recordings and have values for some records.
    when im trying to access the value null, it records throws me Null Pointer Exception.
    How can I solve this problem.
    kindly let me know any suggestions.

    Thank you.

    Here EmpAddress is null for rare recordings and have values for some records.

    Which means that they are null in the DB... If you do a null control!

    if(v.first().getAttribute("EmpAddress")!=null)
       String address= v.first().getAttribute("EmpAddress").toString(); 
    
  • getAttribute: Incorrect return Type

    I use JDeveloper 10.1.3.3 with ADF/BC.

    I get a strange error, because getAttribute returns a number, not an object. Is this a known bug? Or what I am doing wrong?


    In my Module of Application I am retrieving the value of an attribute of a display object:

    Number of numWeight = null;
    String strWeight = "";
    Double retrievedWeight = 0.00;

    ViewObject reportVo = getMyReportView();
    Line currRow = reportVo.next ();

    This gives a runtime error. When debugging, I find that getAttribute returns a number, which is the data type of this attribute.
    Hiowever, the documentation of the api says it must return an object.
    retrievedWeight currRow.getAttrbite("Weight") = (Double);

    So I try this and it give a compilation error:
    numWeight = currRow.getAttribute ("Weight");

    I need to do it for the
    strWeight = currRow.getAttribute("Weight").toString ();
    retrievedWeight = Double.parseDouble (strWeight);



    private ViewObject getOnlineReportView (String which) {}
    If (which.equalsIgnoreCase ("ABC")) {}
    Return getOnlineReport_ABC();
    } else {}
    Return getOnlineReport_XYZ();
    }
    }

    public OnlineReport_ABCImpl getOnlineReport_ABC() {}
    return (OnlineReport_ABCImpl) findViewObject ("OnlineReport_ABC");
    }

    public OnlineReport_ABCImpl getOnlineReport_XYZ() {}
    return (OnlineReport_XYZImpl) findViewObject ("OnlineReport_XYZ");
    }


    Thank you

    John

    Hello

    oracle.jbo.domain.Number is an object as anything in Java which is not a literal is an object. It returns an object, which means it doesn't have a typed value of return, telling you that you must first convert it to oracle.jbo.domain.Number.

    Frank

  • Eception java.lang.error trying to create format XML string

    I am trying to create XML documents without having to build everything manually whenever I want to do this.  I created a XMLFile class to create the document.  When I try to launch my app TestFoo, I get untrapped Exception java.lang.error.  I tried kxml2, using org.w3c.dom, java XML, banging my head against the wall as to why it will not work until I finally just rolled my own simple implementation.  I always get the error!  No details are provided.  There is no stack trace.  I use the emulator 9000 "BOLD" crossing os 4.6.0 eclipse 3.4.1

    Console:

    Starting TestFooStarted TestFoo(154)Exit TestFoo(154)ErrorNo detail messageTestFoo Document  0x171TestFoo XMLFile  0x381TestFoo TestFoo  0x297TestFoo TestFoo main 0x276
    

    TestFoo.java

    import net.rim.device.api.system.Application;
    
    public class TestFoo extends Application {
    
      public static void main(String[] args) {      TestFoo foo = new TestFoo();      foo.enterEventDispatcher();   }
    
      public TestFoo() {        XMLFile xml = new XMLFile("rootNode");        xml.addProperty("myprop", "some value");      System.out.println(xml.toFormattedXMLString());       System.exit(0);   }}
    

    XMLFile.java

    public class XMLFile {   Document document;    public XMLFile(String rootElement) {      document = new Document(rootElement); }
    
      public void addProperty(String pName, String pText) {     Element elm = new Element("property");        elm.addAttribute("name", pName);      elm.setTextContent(pText);        document.appendChild(elm);    }    public String toFormattedXMLString() {     return document.toFormattedXML();    }}
    

    Element.Java

    import java.util.Enumeration;import java.util.Hashtable;import java.util.Vector;
    
    public class Element {   private Vector children;  private String name;  private String textContent;   private Hashtable attributes;
    
      public Element(String name) {     this.children = new Vector();     this.attributes = new Hashtable();        this.name = name; } public void appendChild(Element child) {      this.children.addElement(child);  } public Vector getChildren() {     return children;  } public String getName() {     return name;  } public void setName(String name) {        this.name = name; } public String getTextContent() {      return textContent;   } public void setTextContent(String textContent) {      this.textContent = textContent;   } public Hashtable getAttributes() {        return attributes;    } public boolean hasChildren() {        return (this.children.size() > 0); } public int childrenCount() {      return this.children.size();  } public String getAttributeValue(String name) {        return this.attributes.get(name).toString();  } public void addAttribute(String key, String value) {      this.attributes.put(key, value);  } public void addAttribute(String key, int value) {     addAttribute(key,Integer.toString(value));    } public void addAttribute(String key, long value) {        addAttribute(key,Long.toString(value));   } public void addAttribute(String key, boolean value) {     addAttribute(key, String.valueOf(value)); } public boolean hasAttribute(String name) {        return this.attributes.containsKey(name); } public Element getChild(int position) {       return (Element) this.children.elementAt(position);   } public Enumeration getAttributeKeys() {       return this.attributes.keys();    }}
    

    Document.Java

    import java.util.Enumeration;
    
    public class Document { private static final char _gt = '>';   private static final char _lt = '<';   private static final char _eq = '=';  private static final char _dqt = '"'; private static final char _cl = '/';  private static final char _sp = ' ';  private static final char _tab = '\t';    private static final byte[] _nl = System.getProperty("line.separator").getBytes();
    
      private Element rootNode; private StringBuffer sb;
    
      public Document(String rootName) {        this.rootNode = new Element(rootName);    } public void appendChild(Element child) {      this.rootNode.appendChild(child); } public String toFormattedXML() {      sb = new StringBuffer();      format(this.rootNode,0);      return sb.toString(); }
    
      private void format(Element node, int depth) {        writeOpenTag(node, depth);        for (int i=0;i0;i--) {            sb.append(_tab);      } }    private void writeOpenTag(Element node, int depth) {       indent(depth);        sb.append(_lt);       sb.append(node.getName());        for (Enumeration keys = node.getAttributeKeys();keys.hasMoreElements();) {            String key = keys.nextElement().toString();           sb.append(_sp).append(key);           sb.append(_eq).append(_dqt);          sb.append(node.getAttributeValue(key).toString());            sb.append(_dqt);      }    }    private void writeCloseTag(Element node, int depth) {       if (node.hasChildren()) {         sb.append(_lt).append(node.getName());        } else {          sb.append(_cl);       }     sb.append(_gt).append(_nl);    }}
    

    This line:

    private static final byte[] _nl = System.getProperty("line.separator").getBytes();
    

    is originally a NullPointerException because line.separator is not well supported. The line terminator standard for XML is CR/LF, so you can use:

    private static final byte[] _nl = { '\r', '\n' };
    
  • parameter number in the task of planning custom in R2

    Gurus,

    I developed a custom 11 GR 2 IOM planning task that has a parameter of number as one of the entry. I have defined this parm as below in my eventhandler.xml

    < number-required param = 'true' helpText 'Number of records to retrieve' = > number of files < / param-number >

    By reading this value in the schedule task code, I use this.

    Try
    {
    Records string = String.valueOf (attributes.get ("number of Records"));
    System.out.println ("Records" + Records);
    }
    catch (Exception e) {}
    e.printStackTrace ();
    }

    I even tried the question below, but even.

    Try
    {
    reviews int = Integer.parseInt ((String) attributes.get ("number of Records"));
    System.out.println ("Records" + Records);
    }
    catch (Exception e) {}
    e.printStackTrace ();
    }


    But my work fails said number format exception.

    Can you please let me know some code snippet to read a number parameter in a scheduled task.

    Here's a code tested for you.

    import java.util.HashMap;
    Import oracle.iam.scheduler.vo.TaskSupport;

    SerializableAttribute public class Test extends TaskSupport {}

    public void execute (attributes, HashMap) {}

    try {}
    Long REC = ((Long) attributes.get ("number of Records")) .longValue ();
    Print ((int) REB);
    }
    catch (Exception e) {}
    System.out.println ("Exception 1:"+e.getMessage());
    }
    }

    private void print(int a) {}
    System.out.println ("a =" + a);
    }

    public HashMap getAttributes() {}
    Returns a null value.
    }

    {} public void setAttributes()
    }
    }

  • BlackBerryContact returned from remote sensing

    Hello

    I hope someone can help me; is there a way to determine from the BlackBerryContact returned from remote research that the BlackBerryContact came from a distance search rather than a local search? A field in the contact?

    Thank you

    David

    No, there is no field that indicates if the contact came from a remote research or is stored locally on the BlackBerry smartphone.

  • Return of the bound data control method causes IllegalArgumentException

    JDeveloper Version: _12.1.2.0.0_GENERIC_130608.2330.6668

    Problem:

    I have a Service method on a data control which takes the parameters. I'm able to drag the Service method on a JSF/ADF page and it creates an ActionBinding and all links in the input parameter as well. No problem. I can run the page and enter values in the display, press the binding Action and the method on the façade of the Session is called perfectly. So far so good. Now, I want to display the results of the (returned as a collection of POJO) Service method in the method declaration.

    If I drag the method declaration of data control on the same page and request that the results will be displayed in a table (or any control that will display a collection, in this example, this is a graph) control is created and all links with her. Once again, so far, so good.

    Now I start the page. This time, I IllegalArgumentExceptions (two of them) returned as messages when loading the page. Stack trace looks like this (my apologies, I hate when people put a huge stack traces in positions):

    [code]

    java.lang.RuntimeException: java.lang.IllegalArgumentException

    at oracle.adf.model.adapter.bean.UpdatableBeanDataControl.invokeOperation(UpdatableBeanDataControl.java:606)

    at oracle.adf.model.adapter.bean.BeanFilterableDataControl.invokeOperation(BeanFilterableDataControl.java:80)

    at oracle.adf.model.bean.DCBeanDataControl.invokeMethod(DCBeanDataControl.java:472)

    at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1658)

    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2189)

    at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:560)

    at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:309)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:751)

    to oracle.jbo.uicli.binding.JUMethodIteratorDef$ JUMethodIteratorBinding.invokeMethodAction (JUMethodIteratorDef.java:170)

    to oracle.jbo.uicli.binding.JUMethodIteratorDef$ JUMethodIteratorBinding.initSourceRSI (JUMethodIteratorDef.java:659)

    at oracle.adf.model.binding.DCIteratorBinding.callInitSourceRSI(DCIteratorBinding.java:1741)

    at oracle.adf.model.binding.DCIteratorBinding.internalGetRowSetIterator(DCIteratorBinding.java:1715)

    at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4684)

    at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:341)

    at oracle.jbo.uicli.binding.JUCtrlHierBinding.getRootNodeBinding(JUCtrlHierBinding.java:108)

    at oracle.adfinternal.view.faces.dvt.model.binding.common.BindingKeyChangeHandler.setBinding(BindingKeyChangeHandler.java:52)

    at oracle.adfinternal.view.faces.dvt.model.binding.graph.ActiveGraphDataModel.setHierBinding(ActiveGraphDataModel.java:82)

    at oracle.adfinternal.view.faces.dvt.model.binding.common.FacesCubicBinding.getDataModel(FacesCubicBinding.java:194)

    at oracle.adfinternal.view.faces.dvt.model.binding.common.FacesCubicBinding.getDataModel(FacesCubicBinding.java:159)

    at oracle.adfinternal.view.faces.dvt.model.binding.common.FacesCubicBinding.getDataModel(FacesCubicBinding.java:111)

    at oracle.adf.model.dvt.binding.common.CommonBinding.internalGet(CommonBinding.java:149)

    at oracle.adf.model.dvt.binding.common.CubicBinding.internalGet(CubicBinding.java:580)

    at oracle.adfinternal.view.faces.dvt.model.binding.common.FacesCubicBinding.internalGet(FacesCubicBinding.java:234)

    at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:751)

    at javax.el.MapELResolver.getValue(MapELResolver.java:199)

    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)

    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)

    at com.sun.el.parser.AstValue.getValue(AstValue.java:138)

    at com.sun.el.parser.AstValue.getValue(AstValue.java:183)

    at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)

    [/ code]

    Now, if I fill in the parameters on the screen and call the ActionBinding by pressing the button created, the method calls the function on the façade and the data is returned in the control (chart or table). From that moment, I never have the illegalArgumentException and the page the way I want it.

    So, my question is, why the return of the method lie I invoke a method call on a page load until the ActionBinding is called and give me an illegalArgumentException. And - most importantly - how can I avoid this error?

    Any advice would be greatly appreciated.


    Thank you

    Nigel

    It is a normal behavior.  Check blog Shay https://blogs.oracle.com/shay/entry/delay_method_execution_when_us

    Timo

  • getAttribute() method of a view object returns NULL

    Hello
    I am currently implementing PPR in one of my OFA page and I took the following approach.

    I stated the Boolean attribute transitional follwing in the VO() outside of the existing attribute 'sense '.
    1 MfgEnttity
    2 MfgAcct
    3 MfgSubAcct
    4 MfgCc
    5 MfgProj

    In the page I used these attributes in the property made in the form "${oa." XXR2RMfgproSegVO.MfgSubAcct}' like that.

    Now, in the central, I wrote the following code.

    ' Public Sub processRequest (pageContext OAPageContext, OAWebBean webBean)
    {
    super.processRequest (pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    am.invokeMethod ("initializeXXR2RMfgproSegVO");
    }
    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)
    {
    super.processFormRequest (pageContext, webBean);

    Event string = pageContext.getParameter (EVENT_PARAM);
    Source of the string = pageContext.getParameter (SOURCE_PARAM);
    Am = (OAApplicationModule) pageContext.getApplicationModule (webBean) OAApplicationModule;
    am.invokeMethod ("handleSegmentChangeEvent");
    }
    }


    And the AM code is as follows:

    Public Sub initializeXXR2RMfgproSegVO()
    {
    OAViewObject vo = getXXR2RMfgproSegVO();
    If (!) VO.isPreparedForExecution ())
    vo.executeQuery ();
    Line = vo.createRow ();
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);
    }

    Public Sub handleSegmentChangeEvent()
    {
    PVO OAViewObject = (OAViewObject) findViewObject ("XXR2RMfgproSegVO");
    OARow hdrRow = (OARow) pVO.getCurrentRow ();
    String status = (String) hdrRow.getAttribute ("Meaning").
    System.out.println ("poRow" + hdrRow.toString ());
    System.out.println ("value of the State is" + status);
    If ("Entity". Equals (Status))
    {
    hdrRow.setAttribute ("MfgEnttity", Boolean.TRUE);
    hdrRow.setAttribute ("MfgAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgSubAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgCc", Boolean.FALSE);
    hdrRow.setAttribute ("MfgProj", Boolean.FALSE);
    } else
    If ("Account". Equals (Status))
    {
    hdrRow.setAttribute ("MfgEnttity", Boolean.FALSE);
    hdrRow.setAttribute ("MfgAcct", Boolean.TRUE);
    hdrRow.setAttribute ("MfgSubAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgCc", Boolean.FALSE);
    hdrRow.setAttribute ("MfgProj", Boolean.FALSE);
    } else
    If ("Subaccount". Equals (Status))
    {
    hdrRow.setAttribute ("MfgEnttity", Boolean.FALSE);
    hdrRow.setAttribute ("MfgAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgSubAcct", Boolean.TRUE);
    hdrRow.setAttribute ("MfgCc", Boolean.FALSE);
    hdrRow.setAttribute ("MfgProj", Boolean.FALSE);
    } else
    If ("cost Center".equals (status))
    {
    hdrRow.setAttribute ("MfgEnttity", Boolean.FALSE);
    hdrRow.setAttribute ("MfgAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgSubAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgCc", Boolean.TRUE);
    hdrRow.setAttribute ("MfgProj", Boolean.FALSE);
    } else
    If ('Project'. Equals (Status))
    {
    hdrRow.setAttribute ("MfgEnttity", Boolean.FALSE);
    hdrRow.setAttribute ("MfgAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgSubAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgCc", Boolean.FALSE);
    hdrRow.setAttribute ("MfgProj", Boolean.TRUE);
    }
    on the other
    {
    hdrRow.setAttribute ("MfgEnttity", Boolean.FALSE);
    hdrRow.setAttribute ("MfgAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgSubAcct", Boolean.FALSE);
    hdrRow.setAttribute ("MfgCc", Boolean.FALSE);
    hdrRow.setAttribute ("MfgProj", Boolean.FALSE);
    }
    }
    }

    Now when I change in the value of the attribute "Meaning" page that he can always get into the else part, which is where all the attributes are 'False'.

    The two System.out.Println statements return the following values.

    03/10/22 15:41:08 poRow xxr2r.oracle.apps.gl.coam.poplist.server.XXR2RMfgproSegVORowImpl@3
    03/10/22 15:41:08 state value is null

    Can you please why this 'status' returns NULL and how I can get the current selected line in the page?

    Thank you
    Lucile

    Hello

    you set the attributes of PVO, based on a condition, your old code is just the question is from where you can get the status, you may get this page, but you must pass this value to AM.

    thanx
    Pratap

  • IllegalArgumentException in VerticalFieldManager to add several ObjectChoiceFields

    Hi all

    I'm IllegalArgumentException in VerticalFieldmanager to add several ObjectChoiceFields.

    
    
    VerticalFieldManager row = new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLL |VerticalFieldManager.NO_VERTICAL_SCROLL);VerticalFieldManager row1 = new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLL |VerticalFieldManager.NO_VERTICAL_SCROLL); for(int i = 0; i < blackBerryContacts.size(); i++){BlackBerryContact item =(BlackBerryContact)blackBerryContacts.elementAt(i);             choiceP[i] = new ObjectChoiceField("", choiceFld,0, FIELD_RIGHT);
                    int index = choiceP[i].getSelectedIndex();
                    String selectedChoice = choiceFld [index];
                    chkBoxField[i] = new CheckboxField(sb.toString(), true,
                            Field.USE_ALL_WIDTH | CheckboxField.FIELD_LEFT)
                    {
                         //Invoked when this field receives the focus.
                        protected void drawFocus(Graphics g, boolean on)
                        {
                            if (g.getBackgroundColor() != 3098850)
                            {
                                XYRect xy = g.getClippingRect();
                                g.setBackgroundColor(0xf9f8f5);
                                //g.fillRect(xy.x,xy.y,xy.width,xy.height);
                                g.clear();
                            }
                            super.paint(g);
                        }
                        protected void paint(Graphics g)
                        {
                            int x = this.getIndex();
                            XYRect xy = g.getClippingRect();
    
                            if (g.getBackgroundColor() != 3098850)
                            {
                                g.setBackgroundColor(0xf9f8f5);
                                //g.fillRect(xy.x,xy.y,xy.width,xy.height);
                                g.clear();
                            }
                            super.paint(g);
                        }
                        protected boolean navigationClick(int status, int time) {
                            if (this.getChecked())
                                this.setChecked(false);
                            else
                                this.setChecked(true);
                            //fieldChangeNotify(1);
                            return true;
                        }
                    };//----------
                    row.add(chkBoxField[i]);
                    row1.add(choiceP[i]);
                }
    

    chkBoxField can be added in VerticalFieldManager but ObjectChoiceField is exception.

    Please help me.

    Thank you

    DK.

    Unfortunately, ObjectChoiceField does not allow to have another field in the same row. This area needs the line of the screen. When you try to add the field to the line where the ObjectChoiceField - you get an error.

    I recommend the following approach.

    Data model

    public class BlackberryContact {
    
        private String Fullname;
    
      ....
    
      private Vector contactInfo;
    
      public void addContactInfo(BlackberryContactInfo info) {      contactInfo.addElement(info);     ....  }}
    
    public class BlackberryContactInfo {
    
        public final int CONTACT_TYPE_HOME_PHONE = 1; public final int CONTACT_TYPE_WORK_PHONE = 2; public final int CONTACT_TYPE_EMAIL = 3;
    
        // type of contact: phone, email, etc private final int contactType; 
    
      // contact info: phoneNumber, emailAddress    private final String contactInfo;
    
      // constructor, use CONTACT_TYPE_.. constants as contactType      public BlackberryContactInfo(String contactInfo, int contactType) {       this.contactInfo = contactInfo;       this.contactType = contactType;   }   
    
      public int getType() {        return contactType;   }   
    
        public String getInfo() {     return contactInfo;   }   }
    

    VIEW

    Implement a screen to display BlackberryContact, say BlackberryContactView

    Add the text field to refer to and add ListField to view available contact information (emails, phones, etc.).

    Each person can have different qty of coordinates, ListField is the best choice.

    Will look like the screen layout is shown on the picture:

    http://picasaweb.Google.ru/tbilisoft/BlackberryForum#5285460326711217906

  • CWIMAQdx.GetAttribute failed to get attributes in the string or format U32.

    I'm reading all the attributes of a Gige camera. I can get the I64, F64 attributes and Boolean marker. But when the type is string or U32, the returned object "attribute" is "NULL". Can someone let me know what is wrong with my code?

    Thank you

    object attribute = new object();

    if(stype=="I64")

    {

    CWIMAQdx.GetAttribute (sid, attributeInformationArray [i]. Name, CWIMAQdx.ValueType.I64, out attribute);

    sValue = Convert.ToInt64 (attribute). ToString();

    }

    If (sType is "String")

    {

    CWIMAQdx.GetAttribute (sid, "attributeInformationArray [i]. Name', CWIMAQdx.ValueType.String, out attribute);

    sValue = Convert.ToString (attribute);

    }

    If (sType is "U32")

    {

    CWIMAQdx.GetAttribute (sid, "attributeInformationArray [i]. Name', CWIMAQdx.ValueType.U32, out attribute);

    sValue = Convert.ToUInt32 (attribute). ToString();

    }

    Is it just a coincidence that in your second two cases (you mentioned do not work) your code example seems to be passing the constant "attributeInformationArray [i]. Name"rather than the actual attribute name?

    Eric

  • viOpen suspended on Linux (returns close 0x3fff0082)

    Hello

    I run an application on Linux that uses NI Visa to talk to a device compatible 488.2 using a TCP/IP socket. Control and status of the unit is generally very good, but we met a strange behavior for 2 causes of error.

    Case 1: We unplug the Ethernet cable after have successfully opened a session of bus with the equipment. The sequence of events is usually as follows:

    1. next attempt the provisions of the code to write data on the bus returns an error code as it should.

    2. the appeal that followed to viClose() returns a 0x3fff0082 (VI_WARN_NULL_OBJECT).

    3. the call to viOpen() is suspended, regardless of the time elapsed between close and open.

    Case 2: With the cable still disconnected, restart us the equipment model process which tries to open a session of bus.

    1. the initial call to viOpen() returns 0xBFFF0011 (VI_ERROR_RSRC_NFOUND), as it should.

    2. even in the case of 1, viClose() returns 0x3fff0082 (VI_WARN_NULL_OBJECT)

    3. even in case 1, which followed calls to viOpen() hang.

    You would think that with the device disconnected from the network, the ResourceNotFound error would return to all calls to viOpen(). But the returning viClose() warning indicates that something strange happening. Someone saw something like that?

    Thank you

    -Dan

    OR Visa: 4.5.1

    Linux: Redhat, 2.6.18 - 92.el5

    After digging in our application code, I found the root of the problem. The code implements the timer to reconnect by subscribing to the operating system all the N seconds of SIGALRM (see C++ time.h and signal.h files). I'm not completely sure of the ins and outs, but somehow the SIGALRM treatment appear to interfere with the call to Visa and cause the deadlock. I'm sure that Visa creates his own son, but that does not help the coexistence.

    In short, the timer of the process should be unregistered before as I call the viOpen. After the call, you can re - save and continue as usual. Note: This applies not only to the viOpen, but also to all other Visa functions that perform i/o. (like getAttribute and setAttribute functions are simply properties of the session itself and are not tampered with).

    Thanks for the tips, hope that this is useful for people who see this phenomenon in the future.

  • Push registration: (Berr java.lang.IllegalArgumentException) network error

    Hello

    We try to get WebWorks push the work but are a problem with blackberry.push.openBISPushListener. The onRegister function returns a status of 1 (network error).

    The log file shows the following:

    11/9 10:00:54 W net.rim.blackberry.api.push - Berr java.lang.IllegalArgumentException
    11/9 10:00:21 a Contapp - PushDaemon is started.
    11/9 10:00:21 a Contapp - Register push application
    11/9 10:00:21 a Contapp - open BIS push listener
    

    This application is used to work so I wonder if something might have changed in the upgrade of the server push.

    The application code is the following:

    
    
    
        
    
    
        

    And the following push configuration in the config.xml file:

    
    
    
    
    
    
    
    
    
      BIS-B
      MDS
      TCP_WIFI
      TCP_CELLULAR
      WAP2
      WAP
    
    
    
      read_device_identifying_information
      access_shared
    
    

    It is all tested on a device 9300.

    Any ideas as to why we get this error?

    Thanks in advance for the help!

    Nick

    This issue should now be resolved, please let me know if you continue to have problems with the registration with the EVAL server.

  • ApplicationMessageFolderRegistry registerFolder IllegalArgumentException

    I have the same problem Visual as described in this post solved, however my way to get there is slightly different than in my opinion. To explain, I am trying to save a folder of messages for the purpose of issuing alerts and notifications on certain events. My app is, technically, neither demand nor a UIApplication - it is a top-level class who will then create one or the other according to the entry point. My background AEP monitor is an Application and my ASP UI is a UIApplication. In other words the main function is not in a class of each types.

    I need to create an application folder in which the background AEP monitor can send messages. The folder must be registered with the ASP of the UI so that it's what opens when the dossier is typed on the home screen. I get the IllegalArgumentException When calling ApplicationMessageFolderRegistry.registerFolder and I think it is because my main application is not strictly speaking a UIApplication.

    Can anyone confirm that it is the expected exception in this situation and what I might be able to do about this please? It will be difficult for the redesign of my application at this point... I'd like that there is another solution. Here is the code that generates the exception. What is strange, is that sometimes it seems to work ok, but sometimes it does not work and I then two icons of the application in the notification bar.

    ApplicationDescriptor uiAppDesc = null;
    
    int moduleHandle = CodeModuleManager.getModuleHandle("my_app_module_name");
    ApplicationDescriptor des[] = CodeModuleManager.getApplicationDescriptors(moduleHandle);
    for (int i = 0; i < des.length; i++)
    {
        String descName = des[i].getName();
        if (descName.equals("UI AEP Name"))
        {
            uiAppDesc = des[i];
        }
    }
    
    if (uiAppDesc == null)
    {
        Debug.Log("Could not find ApplicationDescriptor for UI App entry point", Debug.DBG_NOTIFICATIONS);
        return;
    }
    
    ApplicationFolderIntegrationConfig config = new   ApplicationFolderIntegrationConfig( false, true, uiAppDesc);
    
    //Register the ApplicationMessageFolder
    //ReadableListImpl source is available in the messagelistdemo.
    ApplicationMessageFolder folder = ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(AppMain.APPLICATION_ID_LONG);
    if (folder == null)
    {
        folder = ApplicationMessageFolderRegistry.getInstance().registerFolder(
            AppMain.APPLICATION_ID_LONG, APPLICATION_MESSAGE_FOLDER_NAME, new ReadableListImpl(), config);
    }
    

    It seems I have fixed this problem. The solution was to place the call to my code above inside a new workable with invokeLater. I was using an executable elsewhere in the code, that's why the problem seemed to be intermittent.

    By comparing the two code sections was the only way I stumbled upon this fix. The document does not indicate that this could cause an IllegalArgumentException thrown so I wonder now how would I know otherwise. I don't know * why * this fixes it for me... any other comments welcome!

  • [6.0.344] bug - BlackBerryContactList.choose does not return values

         BlackBerryContact bbContact = null;     BlackBerryContactList contacts = null;           try           {               contacts = (BlackBerryContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);           }           catch(PIMException e)           {               Dialog.alert("Couldn't open contacts list.  PIM.openPIMList() threw " + e.toString());                  return;                            }
    
               Object choice = contacts.choose();           if(choice instanceof BlackBerryContact)           {               bbContact = (BlackBerryContact)choice;           }
    

    Central trackpad key does not work on OS 6.0.344 (9700) with this code.

    Two questions:

    (1) the first is that it is a leaked OS (not supported by RIM) so this problem can be solved once an official OS came out for the device.

    (2) this problem is better suited for the developer Issue Tracker.

    http://supportforums.BlackBerry.com/T5/Java-development/developer-issue-tracker/TD-p/271768

Maybe you are looking for