Handle to the line on custom list

I use the code in this page to display a custom list. The problem I have now is I want to handle each line onFocus event in the list to change its background color. No idea how to do?

Hello

You encounter method DrawListRow that you define the color as below

 public void drawListRow(ListField listField, Graphics g, int index, int y,
            int width)
    {
        if (g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS))
        {
            g.setColor(Color.RED);
        } else
        {
            g.setColor(Color.BLUE);
        }
// then draw rect

                g.drawRect(0, y, width, 80);
//draw text in list
                g.drawText("Blackberry", 90, y + 9);
         }

----------------------------------------------------------
feel free to press the congratulations on the left side to thank the user who has helped you.
Please mark as resolved messages if you found a solution.

Tags: BlackBerry Developers

Similar Questions

  • Possible to get the handle to the line added with::AddRow()

    I need set default values for newly added lines in tabular form, based on some other page elements, hidden. Unfortunately, like many other elements APEX incredibly useful, addRows seems to be completely undocumented. So, I hope someone here can tell me how to get a reference to each newly added line.

    I am able to replace the functionality of 'javascript:addRow()' by default with my own dynamic Action triggered by clicking on the button Add a line.
    alert('Chicken or Egg?');
    var newRow = addRow();
    newRow doesn't seem to provide a reference to a valid object. I say this because "alert (typeof newRow)' returns"undefined ".

    How can I get a reference to each newly added line? Yes, I know that I can walk the apex_application.g_f0* collections, but it just seems like this could be done directly in the same javascript block where the line has been added.

    Someone has ideas how I could expand the foregoing to define two columns to default values?

    Thank you

    -Joe

    Published by: Joe Upshaw on March 15, 2012 15:19

    Hello

    name = "f03" assumes that the column is the same as that which is located in apex_application.g_f03, correct?

    It's true.

    Fact the ': last "automatically find the last row.

    It's true. The last input field with the same name.

    The default value that I need to get is a hidden page element.

    If the default value is the session to the State of an item, you can use the attributes in a table, by default type (name of the application or page element) element to set the default value for the form. Then you don't need dynamic action. To get the value of the element the page use $v ('PAGE_ITEM_NAME').

    Rod West

  • How to customize the status of the selection of the converter of custom list item?

    I have a list item that uses a custom converter, implemented as a MXML component. When a list item is selected, I want to change the appearance of the text of the item, police characters and color and ideally located in the background of list item to a gradient rather than a solid color.

    How would I go to do this?

    See you soon
    Adam

    I think that should help:

    summer http://butterfliesandbugs.wordpress.com/2007/06/25/How-to-Know-when-my-itemRenderer-is-sel.

  • How to let the user to change the order of the lines inside a list box

    Hi all

    I need to display some values in a sort of list box and leave the user set their order by moving each row upward or downwards as he wishes.

    What is the best way to do it?

    Is there some sort of property node?

    Thanks in advance,

    Mentos.

    Use the list box.  In the Menu right click Watch "Drag And Drop".  I do remember not all settings on the top of my head, but you can allow dragging, dropping, disable the drag and drop out of control and make copy only.

    This should do what you want fewer knots of property.

  • Count the lines in a list component

    Hello

    How can I count the rows with a value in a list item?

    I thought it would be RowCount but as I understood that shows the number of specified rows, not the number of rows with a value.

    Hello

    Try list.dataProvider.length

  • Add the line of text in the list box

    Hi all

    I am trying to add lines of text programmatically,

    I am tiring to implement is a simple terminal for my software of text in order to display text messages.

    My problem is that I need to add lines of text of different vi.

    Can one recommend a good approach?

    Kobi Kalif wrote:

    1. with the reference: how to change a value from array in the Subvi

    2. with the process: if I update a value in the table, then the entire table inserts into the property in my list, so basically he rewrite the entire table to the list of all changes, is it not a bit wasteful?

    1.

    2. that's what you do for normal matrices as well.

  • 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.

  • Accessing the context property of main.qml to a custom list in a file item separate qml

    Hi all

    Sorry if this is already covered somewhere.

    I currently have an application with a list view in my main.qml.  I put a context property for my class app c ++ to be "app" in my main.qml.  My list uses a custom list item that is defined in a file separate qml.  The custom list item has a popup menu.  In this context menu, I want to call Q_INVOKABLE functions that are part of my class from the main application in C++.  What is the best way to be able to do?  Should I just set the context property on my file qml of list item custom like I do with my main.qml or is there a better way?

    Thank you

    I think that this has been repeated several times, but as it is not really intuitive:
    a listitemcomponent lies in a different context, it cannot access the context property of the qml file.
    You can use the reference to the listview to reach outside, see https://developer.blackberry.com/cascades/reference/bb__cascades__listview.html ListItem.view

  • How to make the lines selectable listfield, when the list has been added to a dialog box

    Hello

    I added a listfield to a dialog box. Now I want that when I click on a line any of this list field, I should get a menu (i.e. something should be available for me so that I can perform an action on the selected line). But when I click on the line, nothing happens.

    Help, please

    Create your own screen, its less than the actual display dimensions to make it look like a pop-up screen. When a line is selected/clicked, call makeMenu.

  • Add custom in the analytical center of the lines of obiee11g lines

    Hello

    I want to add custom table lines. Only lines custom placed after the specified lines, based on requirements.

    In the screenshot, lines custom here is sum (1 + 2 + 3), sum(4+5), sum (6 + 7 + 8)

    ERR4.jpg

    To do this, I created RPD and exported in Ms.

    I have the analytic choice to create the report.

    To add lines custom, I choose Add custom calculated item.

    I tried. But I have no way out.

    Please see the screenshots

    err1.jpg

    err2.jpg

    err3.jpg

    See the output

    err5.jpg

    Please help me. I couldn't place the lines custom after the specified lines.

    Thnaks in advance,

    Bruno has.

    Make 1 more column for Prod_ID and then use fx of expression to sort values Prod_ID using the Case statement.

    using PivotTable the aggregate value or icon of sigma to sum up the values.

  • Are the new handles on the part forms live line tool? Can I turn off?

    I been wireframing in Illustrator for many years and part of my approach widely used the line Segment tool. I've just updated Illustrator for the first time in a while.

    My workflow is: select the line tool and then drag, click and drag the end point of the segment just drew and drag the end point of the last segment drawn, perhaps add and pointing arrow or some other setting appropriate at the end of the line.

    From today I can no longer do that because the segment of the line "just comic" has what I believe are handfuls of live form on which makes it impossible to start a new segment of line directly on top of the end of the line "just" segment

    I now have the tools, clear line, switch back to the line Segment tool and continue.

    I spent the afternoon frustrated and try to find a work around. Unfortunately, after so 12 plus years in Illustrator, I feel I might have to find another solution to work in...

    Is there a way to disable these new handles?

    Thank you

    I configured in F1.

  • The custom shape tool - can I make the line thicker?

    I use PSE 10 and trying to insert a circular form, I can add an image in various locations. The custom shape tool includes a circle that would be ideal for this purpose, except that I can't find a way to make the line thicker.

    Is it possible to do this please?

    Thanks for your help, John

    You can use a contour layer Style to go around 'thick '.

    Go in layer > layer Style > Style settings and check the stroke

    You can adjust the size at any time by double-clicking the fx on the thumbnail of the layer to bring up the Style settings.

  • How do I get the handle to the newly created line

    Hello
    I have a classic table with button to add a line, property of AutoText on the bean table is true.
    I need to get a handle to the newly inserted row, once I click on Add button line.
    I tried getCurrentRow and also vo.last (), but it does not work for me.
    The new line is always added last (which is normal) but the cursor always go to the first row of the table that of why I guess currentRow don't get me the newly inserted row.

    How can I put the cursor on the new line or get the current line add after click on the button in the row.
    The workaround I use so far is defined the AutoText to false and then manage the button Add a new rank by rank to create on the VO but I want to assure you that the reverse also works.

    Thank you
    Anatoliy

    Hello

    We can create a line in 2 ways:

    (1) setting the Autoinsertion property to true.
    (2) dynamically by code

    -wht im saying is that you can set the value of the attribute using the nd method 2 only. (Autoinsertion to false)

    Concerning
    Meher Irk

  • Button in the list of actions for the lines

    Hello

    My data object repeatedly for different processes with status as Started, completed, has not
    I want to show a button in the list of actions for instances failed. Once you click on this button I want to trigger an alert

    Is it possible

    Actions are there now they give button at the view level, I am unable to get a button or set up an action at the level of line

    11G version of BAM


    Any suggestions

    Alert will be triggered separately for each row that is changed, so if your goal is to trigger the action of webservice as many times as the number of lines you have chosen in the action list, it serves very well your purpose. And you want to pass values from lines to alert, I suggest that make you all fields editable in list of actions (view open in edit mode and go to properties-> editable fields) and choose "Insert" action button action and put the lines in an another dataobject temp (and not your real dataobject that gets corrupted) set the alert on this temp dataobject and finally in your list of actions during execution, if you want to pass values from the list to the alert or change these values to pass new values, everything is possible and clicking "submit" should give you the expected results.

  • Error handling: to display the line number tht erored out with error message

    Hello

    I'm trying to update several lines at once and for some lines are error-ed out due to the failure of the validation. It's giving the correct error message does not display do not line number what error-ed out.
    I tried with OARowValException, such as specified in the guide of the OA-developer to add the line number in the error message:

    After using this it is show the number of line 1, which either the line it wrong:

    Error in line 1 - the Start Date cannot be later than the Ending Date.
    Error in line 1 - the Start Date cannot be later than the Ending Date.

    In fact I've updated the line-2, 3 but it gives as 1st row.

    Here's the code to add the line numbers for the error message, I added.
    ========================
    try {}
    throw new OARowValException (viewObject.getName)
    voRowObject.getKey ().
    "PA".
    Error_Message);
    }
    catch (System.Exception e)
    {
    exList.add (e);
    }

    If (exList.size () > 0) {}
    OARowValException.raiseBundledOAException (exList);
    }
    ==========================

    Code the developer guide OA that I follow:

    throw (OARowValException) new
    getViewObject () .getFullName (), / / View full name use object
    getKey(), / / primary key line
    "DAMIEN", / / message name abbreviated enforcement
    "ATTR_EXCEPTION"); name of the message
    end


    Any suggestion/solution will be a great help.

    -Shasha.

    Edited by: 826073 January 6, 2011 06:58

    Thanks a ton of out. Your update has helped me solve the problem. The original Version I was using had no attributes defined as "Key attribute". Once I put one of the key attribute primary as "attribute Key' on my VO Editor, all worked great :). Thanks again.

Maybe you are looking for