Blackberry complex list - blackberry

I've got an interesting problem that I'd like some advice and opinions on if you would be so kind. I'm not after code as I prefer to write that for myself. My background is J2ME and Android but I've recently taken up Blackberry.
What I need to write is something akin to the Android ListView albeit a little simpler.
Each row consists of 3 items. There's an image/icon, a multi-line (2 or 3 row) text element and an imagebutton of some form.
However, each row has only 2 columns. The icon/image & multi-line text are combined for the first column and are clickable (with both the column (0) plus the row ID identifiable). The next element in the row (1) is a clickable image (common to all rows - this also needs to have an identifiable row ID). There must be different actions for each column/row cell.
There is a need for multiple rows to be scrollable vertically and there may well be a lot of items.Each row needs to fit the screen width with the icon/multi-line text justified to the left and the clickable image justified to the right. Each row needs all of its components vertically justified (possibly centred) for neatness.
So what we have (for a row) is:
[clickable image/multi-line text combo][clickable image]
Ideally there will be a common background (gradient shaded) for each row once focussed. This should span both columns seamlessly.
Any thoughts would be most appreciated.

The simplest approach is probably to have a VerticalFieldManager for the list, populated by HorizontalFieldManagers for the row.
As for the inner part of the row (the columns) you can pass FIELD_LEFT to the first field and FIELD_RIGHT for the second for alignment. The image-multitext field you can create yourself by extending ButtonField and overriding the paint method. You can use the Graphics object to draw your image and text. A different approach (and perhaps a simpler one) is to extend the HorizontalFieldManager, add your components and make it clickable by capturing the click events.
One thing to realize about Blackberry is that there are many ways to do something, if one thing doesn't work quite the way you want it to, try something different. Hope this help you get started!

Related

how can i combine cells in fastreport?

i have a table. to print like this
https://up.djelfa.info/uploads/155762484493151.png
I want to make the observation take the whole table means it remains empty. The empty box takes all the table.
https://up.djelfa.info/uploads/155762492124361.png
im working with fastreport 5 vcl
master data
https://up.djelfa.info/uploads/155762509600791.png
Per your last link, it appears that you have hard-drawn the cell lines in your master data row. This means they will print for each row. There are, however, multiple ways to get around this:
Make the upper and lower lines for your Observation column separate objects (e.g. LineObsTop and LineObsBottom). Then, in the MasterData Band's OnBeforePrint, adjust the visibility of these based on the values of the column
Don't hard-code cell lines! Instead, make sure the cell fields all align perfectly and use the fields' Frame properties. Then use the Observation field's OnBeforePrint to adjust the frame based on value.
Similar to #2, but use conditional formatting for the cell, adjusting the frame.

Creating a signup form using a tableview in xcode (like SnapChat)

I am looking to improve my app's signup and login form from standard text boxes to using table rows (or something similar).
I am pretty much inspired by the forms which SnapChat have created, which you can see below...
I'm trying to figure out how they accomplished this, and am thinking it must be a table view with 3 cells (Static?), and the text below is part of the footer of that selection of cells.
How is one able to then capture data into it directly?
Am I right in maybe assuming that each cell is 'custom' with a text field in each one (with placeholder text) with a no-borders style on the text field?
Or has this been achieved via some other way?
Keen to hear your thoughts. Thanks!
You absolutely could do that with a table view. But I don't think this one is. Notice the divider lines start at the far left rather than at 15 pixels in (with the text). The separator lines are also two pixels tall rather than one. So I'd say it's a safe bet that it's just a simple view with 1 pixel tall UIView's for lines.

Resizable columns / panels for content in jquery?

does any one know if there is an example available for sliding panels in jquery? If so, can someone send me a link? This is what I want to accomplish.
On my main screen I want to have three divisions. One right column that covers half the screen and then the left column divided in two rows. I want to expand and/or shrink the right column and/or left column and/or the top row in the left column and/or the bottom row in the left column.
Think og it as an IDE with the left side of the coding area and right side as project explorer and the properties. The coder would like to see any three of the sections at once or would like to expand each working area.
I am looking for a jquery solution for such!
Thanks
Sounds like the way jsfiddle.net works
This is available as a plugin. http://docs.jquery.com/UI/Resizable
You could also use the jQuery splitter plugin: http://www.methvin.com/splitter/
Also see (2011): http://jcubic.wordpress.com/2011/03/06/jquery-splitter-split-container/
Flexigrid is a new (2012) option: http://flexigrid.info/
The most robust solution for this is to use the jQuery layout plugin. You can find it here: http://layout.jquery-dev.net/

Items to move up dynamically

If I have a a number of elements in one table column and I drag them one at a time to another column utilizing jQuery UI, how do I make remaining items in the first column move up, i.e. fill the gap left by the items that were moved. Assuming table cell valign="top".
I think it has to do something with DOM. It seems that even after I drag the item is it still in the same column.
You might want to use jquery ui's sortable instead.
http://jqueryui.com/demos/sortable/#connect-lists
You can connect lists and anything moved from one list will move the remaining elements to fill any gaps
However you are not giving us any code/markup to work with so I can only guess. Hope this helps!

Add gui components from bottom up instead of top down

Is it possible to add gui components to blackberry screen beginning from the bottom instead of the top ?
Thanks
A quick response would be no but let me explain why and suggest afew work arounds;
Screens don't actually handle the laying out of fields onto themselves, to do this they delcare a delegate manager which can be any type of manager, vertical, horizontal etc. The problem is all managers begin painting themselves from the top left. For a manager to paint fields starting from the bottom it would have to know exaclty where the bottom is located and add components up rather than down which goes against all the low level code inside the manager class. You can read more on managers in the BlackBerry API documentation.
You could still achieve an effect similar to this though by tweaking how you add fields and playing with field styles. For example consider this code:
add(new LabelField("field 1"));
add(new LabelField("field 2"));
This would give us the results;
field 1
field 2
because field 1 is drawn then field 2 below it. However if we were always to insert fields at the begining of our manager e.g. position 0 like so:
insert(new LabelField("field 1", FIELD_BOTTOM), 0);
insert(new LabelField("field 2", FIELD_BOTTOM), 0);
We would get the results;
field 2
field 1
Which is the results you'd expect from a screen described in your question.
I'm not really sure how you'd get the fields to paint to the bottom of a screen though, you could try researching the "position relative bottom" styles but I'm honestly unsure.
You are probably using a VerticalFieldManager, and the documentation on that says:
A vertical field manager lays out
fields top to bottom in a single
column.
So if you
manager.add(field1);
manager.add(field2);
manager.add(field3);
The order of the fields on the screen will be just that.
But you could do something like this:
Vector v = new Vector();
v.add(field1);
v.add(field2);
v.add(field3);
for(int i=v.size()-1;i>=0;i--) {
manager.add((Field)v.elementAt(i));
}
Sort of. You can use the Manager#insert(Field, int) method and always insert at the zero index. If you do this with a VerticalFieldManager, it would simulate a bottom-up adding of Fields to the Manager.
Some of the answers so far are to use Manager.insert(Field, int), and keep inserting at position 0. This will work, but the running time of the insert is linear in the number of elements already added to the manager. Meaning this solution will have an overall quadratic running time. Not a big deal if you're adding under 10 fields, but if you're planning on adding more than that, the insert overhead will be substantial.
If you can do the inserts top to bottom, by reordering the fields as Muger's solution suggests, the running time will be much improved.
Finally, you can write your own BottomUpVerticalFieldManager that does the layout the way you want. When you write your own manager, you can layout the fields in whatever way pleases you. In this case, it would be bottom to top. Writing your own manager may seem daunting, but it will give you considerable freedom in the future when trying to solve layout issues.

Resources