Help list field

[Hello everyone please I need help on the field of list]

Here is my case:

I want to show 10 records in a list and pressing other next 10 remaining records, I've created an example of code that shows me the first 5 records, but the next button I don't know what logic I have to apply it please help me

package lists;

import java.util.Vector;

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.ListField;
import net.rim.device.api.ui.component.ListFieldCallback;
import net.rim.device.api.ui.container.MainScreen;

public class MyLists extends MainScreen implements ListFieldCallback,FieldChangeListener{
    private ListField listField = null;
    private ButtonField btn=null;
    private Vector vData = null;
    public MyLists()
    {

        vData = new Vector();
        vData.addElement("A1");
        vData.addElement("A2");
        vData.addElement("A3");
        vData.addElement("A4");
        vData.addElement("A5");
        listField = new ListField(vData.size(),ListField.FIELD_HCENTER);
        listField.setCallback(this);
        listField.setChangeListener(this);
        btn=new ButtonField("Next", ButtonField.CONSUME_CLICK);
        btn.setChangeListener(this);
        //add(editField);
        add(listField);
        add(btn);

}
public Object get(ListField listField, int index){
            return vData.elementAt(index);
         }
public int getPreferredWidth(ListField listField){
                return Display.getWidth();
            }

public int indexOfList(ListField listField, String prefix, int start){
                return vData.indexOf(prefix, start);
            }

public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width){
    String theString = (String)get(listField, index);
    graphics.drawText(theString, 0, y, 0, width);
            }

public void fieldChanged(Field field, int context) {
                if(field==btn)
                {
                What to do HERE PLEASE HELP ME
                }
            }
}

remove items from the vector, add new items, invalidate

Tags: BlackBerry Developers

Similar Questions

  • Problem with custom VerticalFieldManager, custom list field Call Back

    I created a custom vertical field Manager and a custom list field. It works very well in JDE 6.0.But when I build the same code in JDE 4.5 it throws the error because the setExtent Sub protected method (int width, int jeight) that I used in my code is final in JDE 4.5.

    so I changed my sublayout custom implemented code in vertical field Manager method. Again, this works very well in JDE 6.0.When I have to generate in JDE 4.5 is not to throw any errors.but when I run my code

    the list field does not have focus.

    I added a text field and a list custom field to the Vertical Field Manager text field focus but custom list field does not receive the focus. And the confusing part is when I click on the arrow to the getSelectedIndex from the scope of the list is changing and when I print listfield is active or not is the wrong impression.

    What is bad code works fine in jde 6.0 but not in jde 4.5, please let me know what I need to do something.

    Me as the ListField focus, but is not in fact poster it seems.  Have you made a

    . getLeafFieldWithFocus()

    to see if indeed he has the focus?

    I think we will have to see the ListField code for help.

  • view the json data in the custom list field

    Hi, I did analysis json and I created the custom list field. Now, I want to display only the data analyzed in my custom list field. I'll post my analyzed data from json and here is the code for my custom list field
    data analyzed.
    I have THREE channels of json and I want to show content tittle and date in the list filed. I'll post the screenshot of my list.

    JSONArray jsnarry = new JSONArray(responce);
                System.out.println("\n--length----- "+jsnarry.length());
                //System.out.println("....................................................=");
                for (int i = 0; i < jsnarry.length(); i++){
    
                    JSONArray inerarray = jsnarry.getJSONArray(i);
                        //System.out.println("\n-inerarray-values----- "+inerarray.getString(i1));
                        String TITTLE = inerarray.getString(1);
                        String CONTENT = inerarray.getString(2);
                        String DATE = inerarray.getString(3);
                                                           System.out.println("TITTLE= "+TITTLE);
                        System.out.println("CONTENT= "+CONTENT);
                        System.out.println("DATE= "+DATE);
    
    }
    

    output

    [0.0] --length----- 2
    [0.0]
    [0.0] -innerarray-length----- 6
    
    [0.0] TITTLE= BJP State President Sanjay Tandon's visit to Amita Shukla's Home
    [0.0] CONTENT=  BJP President Chandigarh Sanjay Tandon at Amita Shukla's Home
    [0.0] DATE= 2013-01-04
    [0.0] ................................................
    [0.0] TITTLE= Sanjay Tandon at mahasamadhi of Satya Shri Sai baba.
    [0.0] CONTENT= BJP Chandigarh President, Sanjay Tandon mahasmadhi of Sri Satya Sai Baba.(Andhra Pradesh)
    [0.0] DATE= 2013-01-13
    

    and my custom list field

           super(NO_VERTICAL_SCROLL);
    
             String TITTLE="TITTLE";
             String CONTENT = "CONTENT";
             String DATE = "DATE";
    
             v.addElement(new ListRander(listThumb, TITTLE, CONTENT,DATE, navBar));
    
             myListView = new CustomListField(v){
    
                 protected boolean navigationClick(int status, int time) {
                     //Dialog.alert(" time in milisec :" + time);
                     return true;
                 }
             };
    

    CustomListField.java

    public class CustomListField extends ListField implements ListFieldCallback {
    
        private Vector _listData;
        private int _MAX_ROW_HEIGHT = 100;
    
        public CustomListField (Vector data) {
    
            _listData = data;
            setSize(_listData.size());
            setSearchable(true);
            setCallback(this);
            setRowHeight(_MAX_ROW_HEIGHT);
    
        }
    
        public int moveFocus (int amount, int status, int time) {
    
            this.invalidate(this.getSelectedIndex());
            return super.moveFocus(amount, status, time);
    
        }
    
        public void onFocus (int direction) {
    
            super.onFocus(direction);
    
        }
    
        protected void onUnFocus () {
    
            this.invalidate(this.getSelectedIndex());
    
        }
    
        public void refresh () {
    
            this.getManager().invalidate();
    
        }
    
        public void drawListRow (ListField listField, Graphics graphics, int index, int y, int w) {
    
            ListRander listRander = (ListRander)_listData.elementAt(index);
            graphics.setGlobalAlpha(255);
            graphics.setFont(Font.getDefault().getFontFamily().getFont(Font.PLAIN, 24));
            final int margin =5;
    
            final Bitmap thumb= listRander.getListThumb();
            final String listHeading = listRander.getListTitle();
            final String listDesc= listRander.getListDesc();
            final String listDesc2= listRander.getListDesc2();
            final Bitmap nevBar = listRander.getNavBar();
    
            //list border
            graphics.setColor(Color.BLACK);
            graphics.drawRect(0, y, w, _MAX_ROW_HEIGHT);
    
            graphics.drawBitmap(margin, y+margin+10, thumb.getWidth(), thumb.getHeight(), thumb, 0, 0);
    
            graphics.drawText(listHeading, 3*margin+thumb.getWidth(), y+margin);
            graphics.setColor(Color.BLACK);
    
            graphics.drawText(listDesc, 3*margin+thumb.getWidth(), y+ margin+30);
            graphics.drawText(listDesc2, 3*margin+thumb.getWidth(), y+ margin+60);
    
        }
    
        public Object get(ListField listField, int index) {
    
            String rowString = (String) _listData.elementAt(index);
            return rowString;
    
        }
    
        public int indexOfList (ListField listField, String prefix, int start) {
    
            for (Enumeration e = _listData.elements(); e.hasMoreElements(); ) {
    
                String rowString = (String) e.nextElement();
                if (rowString.startsWith(prefix)) {
    
                    return _listData.indexOf(rowString);
    
                }
    
            }
    
            return 0;
    
        }
    
        public int getPreferredWidth(ListField listField) {
    
            return 3 * listField.getRowHeight();
    
        }
    
    }
    

    Listrander.Java

    public class ListRander {}

    private bitmap listThumb = null;
    incognito bar Bitmap = null;
    private String listTitle = null;
    private String listDesc = null;
    private String listDesc2 = null;

    public ListRander (Bitmap listThumb, String listTitle, String listDesc, String listDesc2, Bitmap navBar) {}
    this.listDesc = listDesc;
    this.listDesc2 = listDesc2;
    this.listThumb = listThumb;
    this.listTitle = listTitle;
    this.navBar = bar navigation;
    }
    public getListThumb() {Bitmap image
    Return listThumb;
    }
    {} public void setListThumb (listThumb Bitmap)
    this.listThumb = listThumb;
    }
    public getNavBar() {Bitmap image
    return the navigation bar;
    }
    {} public void setNavBar (navigation bar of the Bitmap)
    this.navBar = bar navigation;
    }
    public String getListTitle() {}
    Return listTitle;
    }
    {} public void setListTitle (String listTitle)
    this.listTitle = listTitle;
    }
    public String getListDesc() {}
    Return listDesc;
    }
    {} public void setListDesc (String listDesc)
    this.listDesc = listDesc;
    }
    public String getListDesc2() {}
    Return listDesc2;
    }
    public void setListDesc2 (String listDesc2) {}
    this.listDesc2 = listDesc2;
    }
    }

    You seem to have two problems here and are confusing them.  You must break the problem into two parts

    (1) extract the data from the entry and create the objects you want to display

    2) display in a list, a set of objects.

    Let's get the sorted first premiera.

    I will suggest what to do here, but in practice, you might actually think about this yourself as part of the design phase of your application.  You should do this, not me, because then you will have all the information available.  At the present time, I have just what you said, which is not much.  So maybe what I'm telling you is not correct for your application.  Only you can decide that.  And be blunt here, you should have decided this before you start coding.  Do you want you could lead down the wrong path.  You must think of your application as a home - as the architect must design all the rooms, and how they will be built, before you start building the House.  You do not, then we are building the rooms on the fly.  Who knows if they will be fit at home?

    In this case, I think you need to create an object that represents each of the elements in the internal array of new data.  call this object

    NewsItem

    This object will have attributes, such as its title, content, date, the linked image and so on, each of whom have will get and set methods.  While you treat each inner element fetch you the associated entry and update the object.

    When you have finished the inner loop of processing, you now have a complete

    NewsItem

    Object, so you will add it to a collection, an array of NewsItem objects, call this _newsItems.  You will create it at the beginning - you know how many entries it takes because it is the number of entries in your outdoor table.

    So before you start to deal with JSON, create your table and the 'index' value of 0.

    Once you have created your Newsitem, add this in the table to the position 'index' and increment "index".

    And once you have analyzed all the JSON, you will have a complete picture.  This is part 1 finished!

    And note in your drawListRow, you are given a clue - that is the index in your tables in _newsItems.  So you can easily find which entry to view and display it correctly.  But it is part 2 and is a separate issue.

  • animation in the list field

    actually my question is related to my previous thread .i have created a field of list with custom images.
    My question http://supportforums.blackberry.com/t5/Java-Development/custom-list-field/m-p/2623111#M223562

    animation in a listfield wouldn't be something I think.
    If you want to do in any case you will need to adjust your drawListRow and call invalidate (rowindex) for each image.
    As you redraw the complete list instead of only the bitmap line, it is much more expensive, you will need to test if it works well enough.

  • Custom with LostFocus list field problems

    Hello experts!

    I made a custom, list field when I draw the lines, I made a solution using a personalized reminder, well... I have a problem when the list field lost focus, because when I have a focus to the button my list have a last item carried.

    I want to erase,

    Any suggestions?

    Best regards, Rampelotti

    in the drawListRow() method adds the underside before the draw.

    if(graphics.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS))
    
  • Drop-down list field

    Hi friends,

    In my application from the drop-down list field that I used "ObjectChoiceField" it works but it does not feel like a drop-down list field

    How can I do?

    by the look, he must feel like a drop-down list field?

    Thanks in advance

    I've seen this done before overriding the method object of the ObjectChoiceField to use drawBitmap. In this way paint you a picture on the right of the field (such as the traditional arrow pointing down). You can also use drawRect to draw a rectangle around the whole thing make it look like more traditional.

  • Using a choice of multiple words in a drop-down list field to launch a java script

    I'm a complete newbie to manuscript of java and relatively new to your building in Acrobat.

    I use a drop-down list field to fill in automatically other fields based on my 1st drop-down list selection.

    The 1st field drop-down allows me to select a variety of suppliers.  Once I have selected the vendor, he auto-remplit the coordinates for this provider.

    I've plagiarized the writing of scripts from this link: https://acrobatusers.com/tutorials/change_another_field.  I even changed my domain names for the moment.  I'll change my return form field names and the script to match once I got it working like I want.

    If I use only one name in my drop down list provider (1 field), the script works perfectly and auto-remplit contact as expected information.  However, many of my suppliers are two words or more... and I need those names in print, so I can't do just a contraction of a Word.  Here is the script I use:

    Here is an example of a supplier of single word name that works as expected:
    Put all vorkriegsbevölkerung data in a single data structure
    var DeptData = {ADLEMI: {contact: "P.O. BOX 2371",}}
    E-mail: "DOWNEY, CA 90242."
    {{deptnum: "PHONE: (562) 923-0333 FAX: (562) 923-8111 '}};
    function SetFieldValues (cDeptName)
    {
    this.getField("DeptContact").value = DeptData [cDeptName] .contact.
    this.getField("DeptEmail").value = DeptData [cDeptName] .email;
    this.getField("DeptNumber").value = DeptData [cDeptName] .deptnum;
    }

    Unique provider name, I used in the example above is "ADLEMI."  If I add 'BEST' to ADLEMI (see below), I get a syntax error.  I really need to be able to use several words in my list drop-down provider to trigger auto-fill.

    Put all vorkriegsbevölkerung data in a single data structure

    var DeptData = {ADLEMI BEST: {contact: "P.O. BOX 2371",}}

    E-mail: "DOWNEY, CA 90242."

    {{deptnum: "PHONE: (562) 923-0333 FAX: (562) 923-8111 '}};

    function SetFieldValues (cDeptName)

    {

    this.getField("DeptContact").value = DeptData [cDeptName] .contact.

    this.getField("DeptEmail").value = DeptData [cDeptName] .email;

    this.getField("DeptNumber").value = DeptData [cDeptName] .deptnum;

    }

    The only difference is that I added a space and the word 'BEST' after ADLEMI.  Is there a way to get around this.  I need to have several words in my drop-down list, or at least the full name of the vendor indicating in the field when I print it.

    Thank you

    Place quotation marks around the name of the element.

    Monday, April 13, 2015, at 17:29, bpwhistler, [email protected]>

  • I created a PDF form with several drop downs, all with the same drop-down values. When I select a value of 1 in the drop-down list fields, it breeds in all others - which I don't want. How can I fix?

    I created a PDF form with several drop downs, all with the same drop-down values. When I select a value of 1 in the drop-down list fields, it breeds in all others - which I don't want. Can I fix?

    I am fairly new to this, but I think it has to do with the way you have drop them downs named. Copy you a then keep stick in each area? If so, that's the problem. You must rename each with a different number: Dropdown1, Dropdown2, etc. I think this might solve the problem.

  • problem with the movement of the navigation in the list field

    I have four tab in which first and second tabAreais containing the field list and third tabArea contains a vetical set field Manager and Manager of horizontal field and the fourth browser tabArea field...

    I faced problem when I try to scroll horizontally to the left... in the field of list or checkboxes in third brief tabArea always try to move to the fourth tab... which is weird...

    so is it possible to block the movement of the left navigation.

    So please help me thank you for any suggestions

    Hello

    If you want to block navigation to anywhere just return true.

    Thank you.

  • How can I right - justify text in a drop-down list field in Acrobat 11?

    I have a literal that we want to include as a prefix in front of a field of account number.  Users wanted an option to use a No.:o account r
    Account number:, so I was going to justify the choices in the right drop-down selections but I do not see where to change the alignment propterty.  I used spaces before the non-literal account, but it would be better if I could right - justify the selections in the drop-down list box.

    Please let me know if there is a way to do it.

    Thank you!!!

    What exact version number? Look under help - about Adobe Acrobat.

    I also use Pro XI and that's what I see:

    I just thought of something, you should try... Look under Edit - Preferences - language and make sure that "Enable right-to-left language options" is checked. Maybe cause this option to appear.

  • Create a dynamic drop-down list field in Adobe Acrobat Pro XI

    Hi all. I am creating a field in one of my forms using Adobe Acrobat Pro XI. I have a drop down list of 'core' items, and according to what is selected in the list, I want a second drop-down list to give different choices. I've searched and searched and have javascript that I thought might work, but maybe I'm have a mistake or I'm place javascript code in the wrong place, because it does not work. I know very, very little about javascript, any help would be so appreciated.

    I use Adobe Acrobat Pro XI. I added a "new field" and selected "drop-down list. The domain name is ProvType. The options of the menu drop-down are:

    Hospitalized patients

    External consultations

    Doctor

    I have "Commit selected value immediately" selected. The field is not validated. The format is 'none '. There is no measures or calculations associated with it.

    I then created another dropbox and named SubProvType. Under Actions, I selected the trigger as the mouse upwards and then selected the Action "executes a JavaScript script. I selected the Add button and he hit in the JavaScript editor:

    Switch (ProvType.rawValue)

    {

    case "Hospitalisation":

    this.setItems ("Hospice, hospital, Nursing Facility");

    break;

    "outpatient": case

    this.setItems ("adult day Center, Home, others");

    break;

    case 'doctor ':

    this.setItems ("surgeon, general practitioner, neurologist");

    break;

    }

    What I want to do is:

    If "Hospitalization" is selected, I want only the following options to be available in the second drop-down list box "SubProvType":

    Palliative care

    Hospital

    Nursing facility

    If "outpatient" is selected, I want only the following options to be available in the second drop-down list box "SubProvType":

    Adult day Center

    Home

    Other

    If the 'doctor' is selected, I want these options to be available in the second drop-down list box "SubProvType":

    Surgeon

    Family practice

    Neurologist

    However... when I close form editing and try to select a different option in the ProvType field, SubProvType field is left blank and there is no options available. Also, there are no errors.

    I must be missing something, but I have no idea where to start. Thank you in advance for any help anyone can provide.

    Use this code as the ProvType custom validation script (and remove any code that you have associated with SubProvType):

    switch (event.value) {
        case "Inpatient":
            this.getField("SubProvType").setItems(["Hospice,Hospital,Nursing Facility"]);
            break;
        case "Outpatient":
            this.getField("SubProvType").setItems(["Adult Day Center,Home,Other"]);
            break;
        case "Physician":
            this.getField("SubProvType").setItems(["Surgeon,Family Practice,Neurologist"]);
            break;
    }
    
  • Change the caption of a drop-down list field

    Hi all

    I'm changing the legend of some field drop-down under certain conditions. The following is written on some other field drop-down list:

    If (this.rawValue == 'Ad Hoc payments')

    {    

    xfa.resolveNode ("form. PaymentDetails.ddlInvoiceFrequency.caption #text ") .rawValue group"TEST CAPTION";

    }

    But it seems to not work.

    Any help would be much appreciated.

    Thank you

    Vijay.

    Try with this:

    delete the caption in the palette of the subject field and type this in the case of change:

    If (xfa.event.newText is "Ad Hoc payments") this.caption.value.text.value = "TEST CAPTION";

  • Not available for the warnings page or list field

    Our implementation to the request has been completed by a third party, so I apologize if I don't have at the start of all the necessary details.

    The problem is that we have a description on our custom object (Custom object 1) Notes field has what appears to be a custom field type (Note CRMOD). This custom object is used as a related item on our disposal case however, description, given its length, is not. When a user clicks on "List full", they appear four fields. I want to add a Description to this view of the data. When I tried to add it to the related page layout, the field was not available. I also noticed that the field was not available when I tried to make a list of note.

    Is anyone aware of any reason that a field would be unavailable for the layout or the list? Is this because of the type of custom field?

    Thanks in advance for your help.

    Xavier

    The Description field can contain a large number of characters (16K) and is not available in the related fields section. You must go to the detailed view to display the information in the Description field. Another option is to create a web applet report that includes this field.

  • Context menu in the list field

    Hi, I want to make the context menu, which will apper when the user clicks on an item in the list filed. It will be displayed right on the field.

    I don't see my context menu when the user clicks the button menu blackberry.

    Thank you.

    Finally that I do.

    I take a look at the example of ContactListDemo. Now it's working.

    I put this code in my screen main clas.

       protected void makeMenu(Menu menu, int instance)
            {
    
              menu.add(_viewEmailMenuItem);
              super.makeMenu(menu, instance);
            }
    
          private class ViewEmailMenuItem extends MenuItem
            {
                public ViewEmailMenuItem()
                {
                    super("View Email", 0x00000000, 0);
                }
    
                public void run()
                {
                    Dialog.inform("You clicked.");
                }
            }
    

    I'll open another thread about removing default menu items. See all keyboard, switching Applications and full menu.

  • custom list field

    Hi, I work with list filed, I need to customize the field List, I'll explain a little more. I have this picture.

    I get the list of applications installed with codemodule feeder and now I want to show that, in the list, as you can see in the picture.you above can see the lock in the dark peak, I need to customize this pic with onclick.
    I mean when I click on any line I want to delete this pic of lock in the dark of that line clicked in the list filed
    and when I click again on the same line I want to insert this pic of lock in the same row.
    I think I need to call the drawListRow method in the onclick or sonething else? Please guide me
    Here's the code I used

    public final class MyScreen extends MainScreen {
    
        CustomListField myListView;
    
        public MyScreen() {
    
            Bitmap listThumb = Bitmap.getBitmapResource("icon.png");
            String listTitle="Headline";
            String listDesc = "Mobile news feeds";
            String listDesc2 = " ";
            final Bitmap navBar = Bitmap.getBitmapResource("lock.png");
            Vector v = new Vector();
            for(int i=0; i<30; i++){
                v.addElement(new ListRander(listThumb, listTitle, listDesc,listDesc2, navBar));
            }
            //v.addElement(new ListRander(listThumb, listTitle, listDesc,listDesc2, navBar));
    
            myListView = new CustomListField(v){
    
                protected boolean trackwheelClick (int status, int time) {
    
                    Dialog.alert(" You have selected :" + getSelectedIndex());
    
                    return super.trackwheelClick(status, time);
                }
            }
            ;
            add(myListView);   
    
        }
    }
    
    package mypackage;
    
    import net.rim.device.api.system.Bitmap;
    
    public class ListRander {
    
        private Bitmap listThumb= null;
        private Bitmap navBar = null;
        private String listTitle=null;
        private String listDesc= null;
        private String listDesc2= null;
    
        public ListRander(Bitmap listThumb,String listTitle, String listDesc, String listDesc2, Bitmap navBar) {
            this.listDesc = listDesc;
            this.listDesc2 = listDesc2;
            this.listThumb = listThumb;
            this.listTitle = listTitle;
            this.navBar = navBar;
        }
        public Bitmap getListThumb() {
            return listThumb;
        }
        public void setListThumb(Bitmap listThumb) {
            this.listThumb = listThumb;
        }
        public Bitmap getNavBar() {
            return navBar;
        }
        public void setNavBar(Bitmap navBar) {
            this.navBar = navBar;
        }
        public String getListTitle() {
            return listTitle;
        }
        public void setListTitle(String listTitle) {
            this.listTitle = listTitle;
        }
        public String getListDesc() {
            return listDesc;
        }
        public void setListDesc(String listDesc) {
            this.listDesc = listDesc;
        }
        public String getListDesc2() {
            return listDesc2;
        }
        public void setListDesc2(String listDesc2) {
            this.listDesc2 = listDesc2;
        }
    }
    
    package mypackage;
    
    import java.util.Enumeration;
    import java.util.Vector;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.XYRect;
    import net.rim.device.api.ui.component.ListField;
    import net.rim.device.api.ui.component.ListFieldCallback;
    
    public class CustomListField extends ListField implements ListFieldCallback {
    
        private Vector _listData;
        private int _MAX_ROW_HEIGHT = 60;
        public CustomListField (Vector data) {
    
            _listData = data;
            setSize(_listData.size());
            setSearchable(true);
            setCallback(this);
            setRowHeight(_MAX_ROW_HEIGHT);
    
        }
    
        protected void drawFocus (Graphics graphics, boolean on) {
    
            XYRect rect = new XYRect();
            graphics.setGlobalAlpha(150);
            graphics.setColor(Color.BLUE);
            getFocusRect(rect);
            drawHighlightRegion(graphics,HIGHLIGHT_FOCUS,true,rect.x,rect.y,rect.width,rect.height);
    
        }
    
        public int moveFocus (int amount, int status, int time) {
    
            this.invalidate(this.getSelectedIndex());
            return super.moveFocus(amount, status, time);
    
        }
    
        public void onFocus (int direction) {
    
            super.onFocus(direction);
    
        }
    
        protected void onUnFocus () {
    
            this.invalidate(this.getSelectedIndex());
    
        }
    
        public void refresh () {
    
            this.getManager().invalidate();
    
        }
    
        public void drawListRow (ListField listField, Graphics graphics, int index, int y, int w) {
    
            ListRander listRander = (ListRander)_listData.elementAt(index);
            graphics.setGlobalAlpha(255);
            graphics.setFont(Font.getDefault().getFontFamily().getFont(Font.PLAIN, 24));
            final int margin =5;
            final Bitmap thumb= listRander.getListThumb();
            final String listHeading = listRander.getListTitle();
            final String listDesc= listRander.getListDesc();
            final String listDesc2= listRander.getListDesc2();
            final Bitmap nevBar = listRander.getNavBar();
            //list border
            graphics.setColor(Color.BLACK);
            graphics.drawRect(0, y, w, _MAX_ROW_HEIGHT);
    
            //thumbnail border & thumbnail image
            graphics.setColor(Color.BLACK);
            graphics.drawRoundRect(margin-2, y+margin-2,thumb.getWidth()+2, thumb.getHeight()+2, 5, 5);
            graphics.drawBitmap(margin, y+margin, thumb.getWidth(), thumb.getHeight(), thumb, 0, 0);
    
            //drawing texts
           // graphics.setFont(FontGroup.fontBold);
            graphics.drawText(listHeading, 2*margin+thumb.getWidth(), y+margin);
            graphics.setColor(Color.BLACK);
    
            // graphics.setFont(FontGroup.smallFont);
            graphics.drawText(listDesc, 2*margin+thumb.getWidth(), y+ margin+20);
            graphics.drawText(listDesc2, 2*margin+thumb.getWidth(), y+ margin+32);
    
            //draw navigation button
            final int navBarPosY = y+(_MAX_ROW_HEIGHT/2 - nevBar.getHeight()/2);
            final int navBarPosX = Graphics.getScreenWidth()- nevBar.getWidth()+ margin;
            graphics.drawBitmap(navBarPosX-10, navBarPosY, nevBar.getWidth(), nevBar.getHeight(), nevBar, 0 , 0);
    
        }
    
        public Object get(ListField listField, int index) {
    
            String rowString = (String) _listData.elementAt(index);
            return rowString;
    
        }
    
        public int indexOfList (ListField listField, String prefix, int start) {
    
            for (Enumeration e = _listData.elements(); e.hasMoreElements(); ) {
    
                String rowString = (String) e.nextElement();
                if (rowString.startsWith(prefix)) {
    
                    return _listData.indexOf(rowString);
    
                }
    
            }
    
            return 0;
    
        }
    
        public int getPreferredWidth(ListField listField) {
    
            return 3 * listField.getRowHeight();
    
        }
    
    }
    

    When I click on the particular line of the list, lock on the right side image should disappear. When I click again on the same line in the list, it should appear again.
    something as in this link
    http://StackOverflow.com/questions/8222635/how-to-display-and-hide-an-image-in-list-on-clicking-on-i...

Maybe you are looking for