Images in the field of the list does not

Hello

I create a list field that contains 10 lines and four fields in each line. The first field is the field of the image. But the image does not come. Other three fields (label field) do very well. I use the simulator of 4.7 and 9530.

I give my code here also. Please help me.

class TaskListField extends ListField implements ListFieldCallback {
     private Vector rows;
     private Bitmap _mReceiveAmount;
     private Bitmap _mSentAmount;
    private boolean hasfocus=false;

     public TaskListField() {
      super(0, ListField.MULTI_SELECT);
      setRowHeight(60);
      setEmptyString("It is Empty!", DrawStyle.HCENTER);
      setCallback(this);

      String images[]={"amount_received.png","amount_sent.png"};

      _mReceiveAmount = Bitmap.getBitmapResource("amount_received.png");
      _mSentAmount = Bitmap.getBitmapResource("amount_sent.png");
      BitmapField bitmap;

      rows = new Vector();

      for (int x = 0; x < 10; x++) {
       TableRowManager row = new TableRowManager();

       // SET THE  BITMAP FIELD
       // if amount received, display bitmap
     //  if (x % 2 == 0) {
        //bitmap=new BitmapField(_mReceiveAmount);
        row.add(new BitmapField(Bitmap.getBitmapResource(images[0])));
      //}
       // if amount is sent, set bitmap
       //else {
       // bitmap=new BitmapField(_mSentAmount);
          // row.add(new BitmapField(Bitmap.getBitmapResource(images[1])));
      // }

       // SET THE DATE LABELFIELD
//
       LabelField _mDateField = new LabelField("OCT 10,2010", DrawStyle.ELLIPSIS);
       row.add(_mDateField);

       // SET THE LIST NAME
       row.add(new LabelField("Details" ,DrawStyle.ELLIPSIS) {
        protected void paint(Graphics graphics) {
         graphics.setColor(0x00878787);
         super.paint(graphics);
        }
       });

       // SET THE DUE DATE/TIME
       row.add(new LabelField("$220",DrawStyle.ELLIPSIS | LabelField.USE_ALL_WIDTH | DrawStyle.RIGHT) {
        protected void paint(Graphics graphics) {
         graphics.setColor(0x00878787);
         super.paint(graphics);
        }
       });
       rows.addElement(row);
      }
      setSize(rows.size());

     }

     // ListFieldCallback Implementation
     public void drawListRow(ListField listField, Graphics g, int index, int y,int width) {

        // g.drawBitmap(0, 0, _mReceiveAmount.getWidth(), _mReceiveAmount.getHeight(), _mReceiveAmount, 0, 0);
         TaskListField list = (TaskListField) listField;

         TableRowManager rowManager = (TableRowManager) list.rows.elementAt(index);
         rowManager.drawRow(g, 0, y, width, list.getRowHeight());
     // g.drawBitmap(0, 0, _mReceiveAmount.getWidth(), _mReceiveAmount.getHeight(), _mReceiveAmount, 0, 0);
     }

     public class TableRowManager extends Manager {
      public TableRowManager() {
       super(0);
      }

      // Causes the fields within this row manager to be layed out then
      // painted.
      public void drawRow(Graphics g, int x, int y, int width, int height) {
       // Arrange the cell fields within this row manager.
       layout(width, height);

       // Place this row manager within its enclosing list.
       setPosition(x, y);

       // Apply a translating/clipping transformation to the graphics
       // context so that this row paints in the right area.
       g.pushRegion(getExtent());

       // Paint this manager's controlled fields.
       subpaint(g);

       g.setColor(0x00CACACA);
       g.drawLine(10, 0, getPreferredWidth()-10, 0);

       // Restore the graphics context.
       g.popContext();
      }

      // Arranges this manager's controlled fields from left to right within
      // the enclosing table's columns.
      protected void sublayout(int width, int height) {
       // set the size and position of each field.
       int fontHeight = Font.getDefault().getHeight();
       int preferredWidth = getPreferredWidth();

       // start with the Bitmap Field of the priority icon
       Field field = getField(0);
       layoutChild(field, 32, 32);
       setPositionChild(field, 10, 20);

       // set the task name label field
       field = getField(1);
       layoutChild(field, 120, fontHeight + 1);
       setPositionChild(field, 70, 3);

       // set the list name label field
       field = getField(2);
       layoutChild(field, 150, fontHeight + 1);
       setPositionChild(field, 190, 3);

       // set the due time name label field
       field = getField(3);
       layoutChild(field, 150, fontHeight + 1);
       setPositionChild(field, preferredWidth - 172, 3);

       setExtent(preferredWidth, getPreferredHeight());
      }

      // The preferred width of a row is defined by the list renderer.
      public int getPreferredWidth() {
       return Graphics.getScreenWidth();
      }

      // The preferred height of a row is the "row height" as defined in the
      // enclosing list.
      public int getPreferredHeight() {
       return getRowHeight();
      }
     }

     public Object get(ListField listField, int index) {
      // TODO Auto-generated method stub
      return null;
     }

     public int getPreferredWidth(ListField listField) {
      // TODO Auto-generated method stub
      return 0;
     }

     public int indexOfList(ListField listField, String prefix, int start) {
      // TODO Auto-generated method stub
      return 0;
     }

     public void onUnFocus(){
         hasfocus=false;
         invalidate();

     }

}

your code is quite a mess, and you probably have a misconception on the listfield.

in drawListRow you paint directly the object to the line. no need to use fields or similar, graphics methods.

If you have different objects in your listfield you need to branch in your drawListRow method (if bitmap instanceof object etc.).

your brief description, it appears you want to have the bitmap in the same line as your other information.

create a bean with the attributes class, that you need, including the bitmap.

put objects of beans in your listfield and the data structure (vector).

drawListRow check that it is a bean and draw it.

for example (rough code, no control null etc.):

drawBitmap (0, bean.getBitmap ());

drawText (bean.getBitmap (.getWidth () + 5,) bean.getText ());

Tags: BlackBerry Developers

Similar Questions

  • Images of the icons does not?

    Hi, some of my shortcuts, icons or items in the taskbar do not work, they show just a picture of the adobe Logo. Can someone help as I would really appreciate it

    

    Thank you.

    Hello JoshWS, sorry to hear you have a problem with your icons to the taskbar.

    On many systems, there are two sets of icons in the taskbar. Some are on the left side, while others are on the right side of the taskbar.

    The icons on the left usually start a request, while the good show generally what applications are loaded.

    If your Adobe icon on the left does not open the application, it may have the path to the executable Adobe classified program, or the application of Adobe cannot able to open for some reason any. You could try to reinstall the application.

    Usually, the right Adobe icon indicates that an update of the program is available to be installed. You should be able to click on it and the installation process should begin with some user input.

    Please let us know if this is your problem, or you have another question regarding the icons.

    I hope this helps.

  • Member of the list does not sort all members sharing

    Hello
    We are waging a campaign of webinar and have set up a member of the shared list decision intervenes campaign canvas to filter people who registered for the webinar. List shared after removing duplicates and cancels the subscription is of 162 people, but after we activated the campaign results in the waiting canvas campaign watch 113 step. This means that 49 people who have registered for the webinar received a new invitation asking them to register for the webinar even. Does anyone know why the filter was not able to separate the 30% of the list provided. The list has been verified in the library shared after the initial download and I created a segment of test to see if the system would win 49 people but could not recreate the scenario. Any suggestions as to why this is happening? I have attached my Web of campaign for reference.

    According to Eloqua, if your credentials are configured for NA then only you will be able to run any file outside this region.

    Either you have to update your credentials configuration or need to update the records area.

  • Question Type "Item in the list" does not work

    I tried to give the type of an element to the list item
    After compiling, I run the form and I get this:

    NoClassDefFoundError
    Java 10.7.2.11 plugin
    Version JRE 1.6.0_31 - b05 Java hotspot Client VM

    Would it be because of something inconsistent in my versions? But this is the first time it happens (only with the elements of the list)

    Database: Oracle 10gXE
    Event: 10.1.2.0.2
    JRE: 1.6.0_31
    JInitiator: 1.3.1.22

    Thanks in advance!

    This error should only appear when you use a list item with the type list of the combobox value. A combobox in forms is a listitem where you can also enter your own text. If you have need a drop-down list, on property liststyle poplist. It also works without patch. If you really need the combobox, patch.

  • Size of the list does not resize when itemRenderer resizes

    I have a list with a custom itemRenderer which is just a rectangle of a specific size.

    The list

    < s:List id = 'question' width = '100% '.
    dataProvider = "{thelistdata}".
    itemRenderer = "ListItem".
    borderVisible = "true" / >

    Note the border that the list is visible to help with debugging

    The itemRenderer

    < s:Rect id = "box" width = "50" height = "50" >
    < s:fill >
    < s:SolidColor color = "blue" / >
    < / s:fill >
    < / s:Rect >

    When the itemRenderer receives an event, it changes its size at half

    Box.Width = 25;
    Box.Height = 25;

    I see the itemRenderers resize themselves correctly, but the list itself remains the same size and the rest of the border where it is.

    Someone knows how to fix this bug. Basically, the list must update its size based on the smaller boxes too.

    It works if you set useVirtualLayout = "false" on the list?

  • Items in the list does not appear under the current name?

    Hello

    I use the model 12 and by using the vertical sidebar list. When I click on an item in the list that I want to make current and the rest non-current, but when I discovered the source of each of them is still displayed with a class of "t12noncurrent".

    That's what my model looks like under the definition of the model:

    For "current model list.
    <tr style="padding-bottom: 5px;"><td><a class="t12current" href="#LINK#">#TEXT#</a></td></tr>
    and for "related model list.
    <tr style="padding-bottom: 5px;"><td><a class="t12noncurrent" href="#LINK#">#TEXT#</a></td></tr>
    No idea why its not current selection?

    Hello

    It is not part of the model but the definition of the list itself. Go to select the shared components, lists, your list, and then select a list entry. Here, you should have an input section of the current list with two parameters:

    Current entry list for Pages Type: value "Colon delimited list Page.
    The current list entry for Condition: enter the page number (which should be identical to the Page parameter in the target section)

    Andy

  • Data from the field drop-down list does not clear when the reset button is activated

    Acrobat Pro XI

    All field boxes are checked in the tab properties of the button actions... but when I click on the reset button of the form I created only the data in clear text fields, not any of the data that has been selected in a drop-down list.  What I am doing wrong?

    The 'rest shape' command returns the fields to their default values. If this

    value is not empty, that's what he'll be back.

  • .nomedia album with each image in the system does not

    There are issues like this in this forum, I did my research, but none of them has a solution.

    And this problem is annoying me. I see each image present on my cell phone in the application of the album.

    executives and stickers of a photo editor at the art of the music files and profile pictures album and what not.

    I was using another application to view the images, but I must admit that the default album app is better, but why is she not

    recognize .nomedia files and go on to show each picture.

    is there a solution to this. hope that they fix this in the next update. sony are listening.

    I now use "quickpic. came across the name in this forum itself for the same problem. Thanks to this guy.

    QuickPic done my job. It is less than 1 MB and works better the sony album App it's organized, fast and elegant even plays videos what else can I ask.

  • Images of the site does not

    I recently downloaded our www.acaciarecording.com Web site. I ran into the problem that the only page that loads correctly in Netscape or IE is the homepage, all subsequent pages, the only thing that will load the html text and alt tags, no image won't load. I compared the code on the homepage vs. others and see no visible difference - although I am not educated in writing code. Safari operates the site beautifully. Any ideas?

    > Photoshop will convert CNYK RGB in an output of save it for the Web and it
    will remove the guides.

    Lumpy fingers: CMYK to RGB, of course.

  • image of the contact does not appear next to contacts in messages

    contact has A PICTURE, OTHER CONTACTS HAVE PHOTO MONTRANT

    Hi chetfromnull,

    The resources below will provide some steps of troubleshooting for Contacts on your iPad.  If only one person in your address book is missing a picture, try to delete the contact, and then add back with a different picture than the one you originally used.

    Get help using iCloud Contacts
    https://support.Apple.com/en-us/HT204150

    Take care

  • Error: The system does not license for the OS image. The system cannot find the path specified

    Hello

    I copied the image of Windows Embedded 7 T510 using HP thin client capture on a USB port. Now, I'm trying to load this image in an another thin client Embedded Win 7 T510 via a USB port.

    However, when the customer starts using this image of the USB, I get error below.

    "Error: the system does not license for the OS image! The system does not have the specified path.

    What solutions do you recommend.

    Thanks in advance

    Solution:

    I tried to install it on a Linux Thin client... Is there had this error.

  • inside the host does not ping external host in transparent mode

    Hi all I need urgent help on this pls I have host on ip add 1.1.1.2/24 connected inside interface of the pix with ios 7.0 in transparent mode. and the external interface of the pix connected to a router IP 1.1.1.1/24.i enabled icmp inspection.i can see the router arp entry into the host and the host arp entry in the mac address router.both are well learned by the pix. no traffic flow form the host to the router. There is no access on the pix of pix.the list does not create an arp entry in the stange very pix. I tried to manuaaly add the entry:

    ARP in 1.1.1.2 0011.d80d.f6ac it gives an error <1.1.1.2>not allowed. network address I do not get it .my question is why the pix don't is not create entry arp. what could be the problem. could someone pls help me with this thanks pls.

    Assane

    Lol this is not as you mentioned. I'll explain the communication all in detail. I hope this helps.

    Assumptions:

    PIX configured to L2, with outside as 0 and inside as 100. insidehost on inside the network and external network configured outsidehost.

    scenario 1

    ==========

    If pix is not configured with the IP address, all IP packets are dropped and syslog Id 322004: no management IP address configured for transparent

    Firewall is saved. So lets see how communication works on L2

    outsidehost tries to communicate with insidehost. ARP request is from outsidehost and is sent through dissemination and it is received by PIX and sent to the inside network, without change.

    Return of InsideHost and the response is sent through to the outsidehost. When you see the arp on the outsidehost and the insidehost entries you will find the corresponding arp entries.

    PIX will forward arp request/reply.

    You can give the command "local host" and you won't see any entries created on the box.

    2nd scenario

    ==========

    An ip address is configured on pix and insidehost starts communication with the outsidehost. Communication is from top to bottom and will allow pix.

    No change in the behavior of the ARP. Exactly as mentioned in scenario 1.

    Given that the IP address is provided to the box, entered the local host is created and formed connection for traffic from insidehost to outsidehost.

    Connection between outsidehost and insidehost is denied because there is no access list to allow traffic from low to high.

    You can give the command "local host" and you will see the entrance to insidehost, outsidehost.

    3rd scenario

    =============

    An ip address is configured, created in order to allow the circulation of outsidehost insidehost and applied to the external interface of access list access list.

    No change in the behavior of the ARP. Exactly as mentioned in scenario 1.

    Given that the IP address is provided to the box, entered the local host is created and formed connection for traffic from outsidehost to insidehost.

    Access list being present to allow the traffic, the connection is allowed and entry is created in the box.

    Hope that the foregoing erases the entire communication L2 and the communication of different security levels.

    I hope this helps.

  • If the image of the product is not found, display default image

    I wish I had a picture of 'Waiting for the Image of the product' by default to display if the image of the product does not exist.

    Does anyone know if this is possible?

    Do not use liquid for this but a simple solution with JS is possible using the onerror event

    onError="this.onerror=null;this.src='/img/awaiting-prod-image.jpg'; » />

    Give it a try,

    Stoiky

  • arrow of the selection list does not work

    Run version 4.2 against database 11g.

    On one of my pages none of my page selection point lists are working properly.  When clicking on the arrow at the end of the selection in the list list does not open, but if you click within the field where the text is displayed, it will open.  I tried IE and Firefox and the result is the same on both browsers.  If anyone has seen this behavior before?

    After putting a few more space between list boxes, the problem solved.  I guess even if visually there is space between them, it was somehow a kind of overlap.

  • Some records are not in my list of bookmarks; the individual bookmarks can be found in the search, but the record does not show.

    Some records are not in my list of bookmarks; individual bookmarks can be found in the search, but the folder does not appear in the list of bookmarks, and results do not indicate where the individual bookmarks.

    You can use an add-on to display add a column to the Library dialog box for the folder of the bookmark.

    https://addons.Mozilla.org/firefox/addon/show-parent-folder/

    The extension can indicate only the name of the folder or you can view the full path via the menu in the folder. This full path option is useful if a file accidentally gets you drag somewhere in order to explore the it and find it.

    To access the settings of the extension, you can use the page modules. Either:

    • CTRL + SHIFT + a
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click Extensions. Then, find the Options button under the specific extension.

    A little luck?

Maybe you are looking for