How to customize a ListField in BlackBerry?

Try something like this: class TaskListField extends ListField implements ListFieldCallback { private Vector rows; private Bitmap p1; private Bitmap p2; private Bitmap p3; public TaskListField() { super(0, ListField.MULTI_SELECT); setRowHeight(80); setEmptyString(“Hooray, no tasks here!”, DrawStyle.HCENTER); setCallback(this); p1 = Bitmap.getBitmapResource(“1.png”); p2 = Bitmap.getBitmapResource(“2.png”); p3 = Bitmap.getBitmapResource(“3.png”); rows = new Vector(); for (int x = 0; x < … Read more

One or more resources has the target of ‘head’ but not ‘head’ component has been defined within the view

This means that you’re using plain HTML <head> instead of JSF <h:head> in your XHTML template. The JSF <h:head> allows automatic inclusion of CSS/JS resources in the generated HTML <head> via @ResourceDependency annotations. PrimeFaces as being a jQuery based JSF component library needs to auto-include some jQuery/UI JS/CSS files and this really requires a <h:head>. … Read more

How to maintain widgets aspect ratio in Qt?

You don’t have to implement your own layout manager. You can do with inheriting QWidget and reimplementing int QWidget::heightForWidth( int w ) { return w; } to stay square. However, heightForWidth() doesn’t work on toplevel windows on X11, since apparently the X11 protocol doesn’t support that. As for centering, you can pass Qt::AlignCenter as the … Read more

What is the need of JSF, when UI can be achieved with JavaScript libraries such as jQuery and AngularJS

JSF to plain JSP/Servlet/HTML/CSS/JS is like as jQuery to plain JS: do more with less code. To take PrimeFaces (jQuery + jQuery UI based) as an example, browse through its showcase to see complete code examples. BootsFaces (jQuery + Bootstrap UI based) has also a showcase with complete code examples. If you study those examples … Read more

What are MVP and MVC and what is the difference?

Model-View-Presenter In MVP, the Presenter contains the UI business logic for the View. All invocations from the View delegate directly to the Presenter. The Presenter is also decoupled directly from the View and talks to it through an interface. This is to allow mocking of the View in a unit test. One common attribute of … Read more