Question of width custom list.

listItemComponents: [
                    ListItemComponent {
                        type: "item"
                        Container {
                            leftMargin: 5.0
                            topMargin: 5.0
                            layout: StackLayout {
                                orientation: LayoutOrientation.TopToBottom
                            }
                            horizontalAlignment: HorizontalAlignment.Fill
                            Container {
                                layout: StackLayout {
                                    orientation: LayoutOrientation.LeftToRight
                                }
                                horizontalAlignment: HorizontalAlignment.Fill
                                Label {
                                    text: ListItemData.agencyName

                                    // Apply a text style to create a title-sized font
                                    // with normal weight
                                    multiline: true
                                    horizontalAlignment: HorizontalAlignment.Fill
                                    textStyle {
                                        base: SystemDefaults.TextStyles.TitleText
                                        fontWeight: FontWeight.Normal
                                    }
                                }
                                ImageView {
                                    imageSource: ListItemData.statusIcon
                                    verticalAlignment: VerticalAlignment.Center
                                    horizontalAlignment: HorizontalAlignment.Right
                                    preferredWidth: 32.0
                                }
                            }
                            ProgressIndicator {
                                fromValue: 100
                                toValue: 0
                                value: 50
                                verticalAlignment: VerticalAlignment.Center
                                horizontalAlignment: HorizontalAlignment.Left
                            }
                        }
                    }
                ]

Here, I have a custom list box. With a label on the left, a picture/icon on the right and a progress bar as to each item in the list.

The problem is, I can't get the icon/image aligned right, it follows right after the text.

That is to say.

| This is a test X |

| ------------------------------- |

what I want

| This is a test X |

| ------------------------------- |

Maybe my layout, I tried to add the horizontal fill everywhere, no change.

You can fill a container with the background color to make sure that the external container takes the entire available width.

If it doesn't, try setting preferredWidth (Infinity)

HorizontalAlignment.Right won't work in LeftToRight in cause of a bug.

There are several workarounds:

-Use DockLayout. This is not very practical because can overlap, but for short strings (menus, etc), it can work. Here is an example in C++:

http://supportforums.BlackBerry.com/T5/Cascades-development/list-item-image-size/m-p/2064721#M9602

-Insert an empty container with .spaceQuota (1) between the left and right elements. Divide the right margin of the element left and the left margin of the right item in two (because the average container won't let not their margins overlap).

PS Fill does not seem to work for StackLayout. Use rather preferredWidth/Height (Infinity).

Tags: BlackBerry Developers

Similar Questions

  • Custom list item changes when you click

    I'm having a strange problem.

    When my list of messages is filled first, she checks a property in the json data to see if the message is 'read' or 'unread '. If it is "no read", it will be a different color than those who are already "read" to indicate to the user.

    It works very well, however I added an action context to the list, and when this action is triggered, I'm changing the message "unread". If the color of the list item to change. This works.

    However, after I changed the color of a single item in the listwhen I do scroll down and down, many elements change color. I think it has to do with the rendering of the list of recycling.

    This behavior does not occur after that list first initializes. Regardless of the colors have been queued to initialize their place. Only after that I have an amendment to one of the elements in the list, things go crazy when I scroll. I hope I'm being clear.

    How can I stop this from happening?  This is the code that changes the color of the label in my custom list item.

     listItemComponents: [
                                ListItemComponent {
                                    MessageListItem {
                                        id: messagesListItem
                                        contextActions: ActionSet {
                                            ActionItem {
                                                title: "Mark Unread"
                                                onTriggered: {
                                                    if (messagesListItem.isNew == false) {
                                                        var selectedItem = ListItemData;
                                                        messagesListItem.isNew = true; //property of list item is changed to unread
                                                    }
                                                }
                                            }
                                        }
    

    And inside the MessageListItem.qml

    property bool isNew: ListItemData.data.new
    
       onIsNewChanged: {
            if (isNew == true) {
                subjectLabel.textStyle.color = Color.create("#FF4500");
            } else {
                subjectLabel.textStyle.color = Color.create("#000000");
            }
        }
    

    Please let me know if you have any questions, any help or suggestion is appreciated. Thank you!

    Hello!

    I think that it doesn't because you are not changing 'new' dataModel element variable. In addition, assigning directly control isNew breaks property DataModel is bound to it.

    It should work if you change the dataModel instead.

    An important point to note, however, that it is not possible to change the individual variables of dataModel point. You need to replace the entire item. The code example for GroupDataModel: (not tested, so may require tweaks, tell me please if you need help in getting this work):

    onTriggered: {
      var selectedItem = ListItemData  // get a copy of dataModel's item
      selectedItem.new = !selectedItem.new  // modify it's property
      messagesListItem.ListItem.view.dataModel.updateItem(indexPath, selectedItem) // update the model
    }
    

    For ArrayDataModel, the function is named differently.

    In addition, this line seems suspicious:

    property bool isNew: ListItemData.data.new
    

    Probably, it should be replaced by this one:

    property bool isNew: ListItemData.new
    
  • 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.

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

  • 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

  • implementation of custom list

    Hi all

    I came across an exercise and I don't know how to do in this regard. It's the first part of the exercise:

    'Create a generic class to a list of oneway named SList, which (for the sake of simplicity) will NOT implement the interface from the list. Each item in the list in the form of a link object must contain a reference to the next element, but NOT hold a reference to the previous item. »

    So, as far as I understand, I'm supposed to set up a custom list in any other way as the use of Collections. I know I could use a table and build a list on it, but the exercise does not say a word on the tables, instead it tells an object to link to the next item. So I think I should put up a sort of chain-link-list. But still, I need to store these objects link somewhere somehow. In the case of a table not then where, how?

    Or: It is possible to create some sort of list of string, based on the link objects that just point to the next element, it does not back up what anyone, I mean otherwise it backs up by a table or any collection? How to make guys go about it?

    So far, I have this class of link, but I don't know how to create a custom on that list:
    class Link {
    
        private Link next;
        //here possibly: private Object contained; so that a Link can actually hold something    
    
        Link() {}
        
        Link(Link next) {
            this.next = next;
        }
        
        public void setNext(Link next) {
            this.next = next;
        }
        
        public Link getNext() {
            return next;
        }   
    }
    Thank you

    PR.

    'Create a generic class to a list of oneway named SList, which (for the sake of simplicity) will NOT implement the interface from the list. Each item in the list in the form of a link object must contain a reference to the next element, but NOT hold a reference to the previous item. »

    (...) Is it possible to create some sort of list of string, based on the link objects that just point to the next element, it does not back up what anyone, I mean otherwise it backs up by a table or any collection? How to make guys go about it?

    Yes, storage of the following link, if any, within each link object.

    So far, I have this class of link, but I don't know how to create a custom on that list:

    It seems that you are halfway already done: o)

    I guess that your class SList is supposed to provide methods ( insert(), getFirst() getlast(),... )?
    Then, simply define the SList class that contains one (and only one) link object. All other link objects are accessible from the first.

    Some design notes:
    -Your link class is package-private visibility (so is not not supposed to be used from outside the package, I guess the same package as SList is in). This sounds great, but then why are public methods? If the data in the list are accessible by the rest of the program, only through the SList class, you can do all the methods of the class link private or package-private (no keyword accessibility before the method's return type)

    -Although it is reasonable to have the SList class provide the 'logic' (course, insertion,...), who can also be implemented in the class Link itself, mainly through the recursive calls. Do not take this into account, I wouldn't confuse you - but I suspect that it's perhaps later in the year.

    Good luck with Java.

    J.

  • Windows 7 Internet Explorer 11 Tracking Protection; Custom list parameters

    Here's a question that the gurus of HP may be able to solve.

    In Windows 7, Internet Explorer 11, the custom under protection of follow-up list blocks the browser when the 'settings' link is selected.

    In searching the Internet, many people are affected by this problem, and from what I've read, Microsoft says that they cannot duplicate, but their forum is full of complaints.

    So, that being said, someone at - it an idea how to solve this problem?

    I tried:

    Restore the system to a way earlier

    Resetting the browser

    Reset the advanced settings under the Options menu

    In fact remove and reinstall IE program using the control panel after deleting the files I could access

    programs and users profiles. It's pretty tight locked.

    Don't know what else to do. Fortunately, I was able to track at least 3 tracks and block auto car before the thing went out, although he could have done no good! who knows?

    I know it's typical Microsoft, but lets see if someone knows how crack this one. Yes?

    Hello @Dawntreader ,

    I understand that you are experiencing the tracking protection with IE 11 crash. I don't know if you've tried this thread and yet there will deliver that to some people and I think you should look at and see if it can help you as well. The link is to a Microsoft Community thread: Tracking Your Personalized list of Protection blocks IE10. Although the solution is I believe IE 10 that the solution works as well for IE 11.

    Please give it a shot and re-post if you need extra support. Thanks for posting on the HP Forums. Have a great weekend!

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

  • Width of list of tabbed browsing

    Apex 3.2

    For our navigation in our application, we away tabs and started using a list of Navigation by tabs.
    This list is now starting to become a bit long and extends larger than the screen, so the user must scroll on.
    I've seen with tabs, if the tabs are too big for the screen, then they are displayed on a new line.
    Is this possible with a list of Navigation by tabs?

    We put the list on our page zero
    Model User Interface - no model
    View Point Page model Position 1 in the region

    I tried using the width = "700px" in the attributes of the region, but made no difference.

    See you soon

    Gus

    Gus C wrote:
    Sorry, I was a little confused.
    Theme 15 region without buttons and titles model has the #REGION_ATTRIBUTES tag #,.
    but as I said before you add the style in the attributes of the region made no difference.

    There is no #REGION_ATTRIBUTES # in the list of tabbed browsing.

    It would not be. It is not a model of the region.

    The problem is that despite its name (big hint here Oracle), 15 theme List of tabbed browsing model is based on a table of the single line of HTML, not a part of the actual list. All the containers in the list are also tables. HTML tables develop to fit their content, so that they will ignore all attempts to coerce their width using CSS (with the exception where doing so would also hide the content, that is not a viable solution in this case), or they will automatically go to a new line. (I also noticed that when I try to reproduce this on apex.oracle.com the following list looks nothing like "tabs": what you're seeing?)

    You have basically reached the limit of what it is possible to have visible on screen without scrolling using the APEX theme/version/model. You can copy a real model based on a list of another theme (or create one from scratch) so it would be for multiple lines automatically.

    However, it may indicate that it is time for a questioning of your navigation mechanisms. Consider using vertical rather than horizontal lists, or several levels of tabs/lists?

  • How long a displayed question appears on my list of questions?

    Is there a waiting period. Questions are moderated before posting?
    I can't find my question on my list of validated questions.

    MSwhip

    Contributions

    16 questions
    10 answers
    
  • How to interact the display within a custom list object?

    Hi all

    I implemented a custom using the cellrender class list

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

    Label1                                               = ======

    = Picture =

    Lable2                                               =======

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

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

    Label1                                               = ======

    = Picture =

    Lable2                                               =======

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

    Shown abouve is my list, I need to listen to clicking in this image. How to make...

    Help, please

    Thank you

    George dembele

    In your renderer, in the service of replacement data, set the listener here:

    deleteIcon.addEventListener ("click", value.callback);

    Not sure why in this function you set only the part of the data in your data object. I suppose that you are unwilling to extend the reminder.

  • Custom list

    How to design this screen for Tablet

    If you want the horizontal lines too, I would (Pseudo-code - has not been tested):

    class Rowfield extends UIComponent{
    
      private var _label : Label = new Label();
      private var _value : TextInput = new TextInput();
    
      ///////////////////////////////////////////////////
      public function RowField( label : String )
      {        this.addChild( this._label );    this.addChild( this._value );
    
        this._label.text = label + ':';
        this._label.width = this._label.textWidth + 5;
        this._label.height = this._label.textHeight + 5;
      }
    
      //////////////////////////////////////////////////
      override protected function draw() : void
      {
        this._label.x = 5;
        this._label.y = 2;
        this._value.x = 200;
        this._value.y = 2;
        this._value.width = this.width - 200 - 10;
    
        this.graphics.clear();
        this.graphics.lineStyle( 1, 0x666666 );
        this.moveTo( 0, this.height );
        this.lineTo( this.width, this.height );
        this.endFill();
      }
      /////////////////////////////////////////////////  public function set value( txt : String ) : void  {    this._value.text = txt;  }
    
      /////////////////////////////////////////////////////  public function get value() : String  {    return this._value.text;  }
    }
    

    In the control parent:

    private var _name : RowField = new RowField( 'Name' );
    private var _address : RowField = new RowField( 'Address' );
    ...
    
    // in constructor
    
    this.addChild( this._name );
    this.addChild( this._address );
    
    // in draw
    this._name.y = 0;
    this._name.width = this.width;
    
    this._address.y = this._name.y + this._name.height;
    this._address.width = this.width;
    // there are various ways to position the controls
    // would also look into container with vertical positioning of children
    

    Looks like your parent control has a rounded rectangle that can be done in its draw() method.

    Hope I understood your question.

    NO GUARANTEE THAT THE ABOVE CODE COMPILES WHEN HE WROTE ON THE FLY.  (Normally I would validate what I post).

  • Question of width for HorizontalFieldManager nin BB OS 6.0 and 7.0

    Hi all

    I developed a new application for BB OS 5.0, 6.0 and 7.0, which in its homepage has a bar containing different categories of navigation. The navigation bar is designed as:

    public HeaderMenu (String [] categories, HeaderMenuListener listCallback) {}
    Super(NO_HORIZONTAL_SCROLL |) NO_HORIZONTAL_SCROLLBAR | FOCUSABLE);
            
    mCategories = categories;
    mNewsListCallback = listCallback;
    mButtons = new CustomButton [mCategories.length];
    noOfCategories = mCategories.length;
    ND = this;
            
    mCategoryNavigator = new HorizontalFieldManager(FOCUSABLE |) HORIZONTAL_SCROLL |       HORIZONTAL_SCROLLBAR) {}

    public int getPreferredWidth() {}
    If (noOfCategories > 1) {}
    navigatorWidth = Display.getWidth () - mLeftNavigator.getWidth () - mRightNavigator.getWidth ();
    return Display.getWidth () - mLeftNavigator.getWidth () - mRightNavigator.getWidth ();
    }
    else {}
    Return Display.getWidth ();
    }
    };
                
    protected void sublayout (int maxWidth, maxHeight int) {}
    Super.sublayout (maxWidth, maxHeight);
    setExtent (getPreferredWidth (), getPreferredHeight());
    };
                
    };
    loadCategoryView();

    mLeftNavigator = new BitmapField (AppResolutionVariables.mLeftNavigationBtn, NON_FOCUSABLE);
    mRightNavigator = new BitmapField (AppResolutionVariables.mRightNavigationBtn, NON_FOCUSABLE);

    If (noOfCategories > 1)
    {
    Add (mLeftNavigator);
    }
    Add (mCategoryNavigator);
    If (noOfCategories > 1)
    {
    Add (mRightNavigator);
    }
    this.setBackground (BackgroundFactory.createSolidBackground (COLOR_MAROON));
    }
        
    /**
    The method of loading of new categories in a scroll handler.
    */
    private void loadCategoryView() {}
            
    int size = mCategories.length;
            
    Added table of buttons representative of the new categories to the Manager of scrolling.
    for (int i = 0; i)<>
    String categoryName = mCategories [i];
    mButtons [i] = new CustomButton (categoryName, DATA_FONT_BOLD, DATA_FONT_PLAIN,
    COLOR_MAROON, COLOR_WHITE) {}
                    
    public int getPreferredHeight() {}
    Return AppResolutionVariables.mLeftNavigationBtn.getHeight ();
    };
                    
    protected boolean navigationClick (int status, int time) {}
    int index = Arrays.getIndex (mButtons, this);
    If (index > = 0) {}
    mNewsListCallback.notifyHeaderButtonClick (index);
    }
    Returns true;
    }
    };
    mCategoryNavigator.add (mButtons [i]);
    }
    }

    Method takes care of asking left and right navigation buttons and scrollable Manager in the correct position.
    protected void sublayout (int maxWidth, maxHeight int) {}
            
    Super.sublayout (maxWidth, maxHeight);
    setExtent (getPreferredWidth (), getPreferredHeight());
            
    If (noOfCategories > 1) {}
    layoutChild (mLeftNavigator, maxWidth, maxHeight);
    setPositionChild (mLeftNavigator, 0, 0);
    }
            
    layoutChild (mCategoryNavigator, maxWidth, maxHeight);
    If (noOfCategories > 1) {}
    setPositionChild (mCategoryNavigator, mLeftNavigator.getWidth (), 0);
    } else {}
    setPositionChild (mCategoryNavigator, 15, 0);
    }
            
    If (noOfCategories > 1) {}
    layoutChild (mRightNavigator, maxWidth, maxHeight);
    setPositionChild (mRightNavigator, getPreferredWidth() - mRightNavigator.getWidth (), 0);
    }
    }

    The question do face is, when I scroll horizontally to the last button at the side bar, the last button is not visible completely, it becomes hidden by the right navigation button on the far right of HFM. This issue is in OS 6.0 and 7.0, but not in OS 5.0.

    Earlier, I had the problem in OS 5.0 so to fix it, I prevail on HFM getPreferredWidth() scrolling above, to return the width (width width HFM - width of navigation left button - not with the right navigation button scrolling) and it works fine. Can someone please fix the problem. Thanks in advance.

    Sorry just looking quickly here.

    The question which I believe is in your sublayout.  You tell your mCategoryNavigator field is the maximum width.  This isn't.  There only the width rest once the buttons have been added.

    There are two ways you can solve the problem.

    The simple way is just to spend the maximum width in the super.sublayout for mCategoryNavigator and no maxWidth.

    But the best way is to remove this sublayout completely and in your sublayout for the Manager.  In this handler, the layout and position your two buttons, then give the drop-down field which remains as its maximum width.

    Two other comments:

    (a) I would like to forget calling super.layout in your HeaderMenu and make everything in your own sublayout.  It would be a good exercise.  Remember the last thing you do is a setExtent, once you have placed all and so that you know how much space you need.

    (b) If you never call super.layout and then do a setExtent to get the correct size, the alarm should sound.  It's a bit like someone who gives a piece of paper, asking them to draw a picture and then decide that in fact the piece of paper is a different size of paper, that they needed to make the drawing.  You are actually asking someone else to do something and then ignoring what they have done (or at least a part of it).  If you find that you need to do, then look for another way as setExtent substitution causes the sorts of problems you found.

  • Re-use of custom list Designer

    Hello

    I created a custom to change the itemType of my lists. I would like to do something similar to the example of decorator list (except with different queres) but I was wondering if I can reuse the custom itemType that I created. The example uses the database itself to check the "is_group" (activate the element type), but I really don't want to cluter upward from my database in this way (TOC)...

    QString GroupArtistDataModelDecorator::itemType(const QVariantList& indexPath) {
            QVariant data = bb::cascades::datamanager::DataModelDecorator::data(
                    indexPath);
            if (data.isValid()) {
                QVariantMap map = data.value<QVariantMap>();
                int isGroup = map["is_group"].toInt();
                // Verifies that this data item is of group and returns the new type.
                if (isGroup) {
                    return QString("group");
                }
            }
            return QString("");
        }
    

    Is there a way around it that I might be able to use the card [' ""] to filter the data, and using a switch statement, return an itemType on this basis?

    What would be the most effective way to do it?

    Is it also possible to add a parameter, for example

    QString GroupArtistDataModelDecorator::itemType(const QVariantList& indexPath, string itemTypeParameter)
    

    And then call it in QML:

    * I hope I'm not being too imaginative here.

    Or y at - it no other choice than to create individual datamodels customized for different model types?

    Thanks in advance!

    I see no reason why you can't use a switch in the method of itemType rather than add a new field to your DB. Here's a possible scenario for implementation.

    Define the subcategory structure in the GroupArtistDataModelDecorator.hpp header file:

        struct SugCategory
        {
            enum Type {
                  News = 0,
                  Technology = 1,
                  Sports = 2,
                  ...
            };
        };
    

    And in the itemType method, you can use a switch that activates cases based on the map ["category"] m:System.NET.SocketAddress.ToString () for example

    QString GroupArtistDataModelDecorator::itemType(const QVariantList& indexPath) {     QVariant data = bb::cascades::datamanager::DataModelDecorator::data(                indexPath);
         SubCategory::Type category_case;     if (data.isValid()) {         QVariantMap map = data.value();         QString category = map["category"].toString();
    
             if(category=="News") category_case = SubCategory::News;
             else if(category=="Technology") category_case = SubCategory::Technology;
             else if(category=="Sports") category_case = SubCategory::Sports;
             ....
    
             switch(category_case)
            {
             case SugCategory::News:
                 return QString("News");
                 break;
    
            case SugCategory::Technology:
                 return QString("Technology");
                 break;
    
             case SugCategory::Sports:
                 return QString("Sports");
                 break;
    
             .....
    
             default:
                 break;
    }
    

Maybe you are looking for

  • Why am I Chinese characters on Web pages?

    All of a sudden I get all Chinese characters on one site - publicdomainpictures.net. Change the encoding don't fix and I can't seem to get the automatic detection to turn on (it is off). When I display the info from the page, the html code said that

  • New drivers for nvidia 9600M GT series.

    I'm guessing that the video card that came with my laptop is not totally "real" because I can not update my graphics card by using the nvidas site or their drivers, the only way is to do it through this site, much more recent than this site is out, b

  • not be ativan las camaras en mi to laptop

    Because computer toshiba laptop not activa camara integrada como tampoco una adicional, so el equipo me as ambos on how correctmente devices.

  • How can I get Tun Miniport, Microsoft card to work properly.

    There is an exclamation on it in Device Manager, but windows declare that it does not work correctly I'm on hp Pavilion dv6000

  • Flash blackBerry Smartphones - when?

    We are EVER going to get Flash on these Blackberrys. My coworkers sent me to customer sites for review & I have to wait until I get to a REAL computer to fully consult sites. Should I get an iphone [[SHIVER]] to keep up?