Blackberry list field without canvas - blackberry

Is it possible to create a customized list field in BB, where each row will have 4 different labels, and a bitmap field, without implementing the drawListRow method?
Since drawListRow uses canvas I want to avoid it. Because, I need to display a browser field in list row. Or is it possible to add label fields in list row?

You probably aren't going to be able to implement this the way you want - try putting more than one BrowserField on a screen at once and you'll soon run into multiple issues. I'd suggest creating a custom Field to act as a row instead, or try and get the desired look n feel using Field Managers.

Related

Kendo UI Grid data bind to two table DB

I am trying to figure out two things. First, is it even possible. Second, am I on the correct path?
I am making an ASP.net Kendo UI Grid that just needs a very simple two table, inner join from an Entity Framework model. The issue is that one of the fields is incredibly large. It requires me to set the value to the json object size to max int value just to be able to return a single table result.
Because the resulting set is so large, I do not seem to be able to use a view model. It just returns a size limit error on that as well. Is there a way to return a very large dataset from two tables to a single Kendo UI grid? I have tried every suggestion from every existing answer on Stack Overflow and the Telerik forums.
I don't really think that some user need information which cannot be handled by default json object size.
May be should load first 50-100 characters from that field to grid and if user click on cell load rest of the data.
Another way is using virtual scroll or paging.
If kendo model cant handle your field size, you can add columnt to each row with view large data button and open window with text field loaded from db on click.

How to display multiple columns in TDBLookupComboBox?

I tried setting ListField property to "Column1;Column2" but only Column1 is diplayed. Is it even possible to diplay multiple columns in this component or I must search for some 3rd party solution?
Using C++ Builder XE6...
Multiple columns in ListField will only show those columns during dropdown. If you want to show multiple fields even in closeup mode you should add a calculated field for use in ListField.

Click inside UILabel

I'm working with an iOS application. What I'm trying to accomplish,
Let's say the text for the UILabel is "Rikard bla bla bla Rikard".
So in this text I have tagged two people. And when I click on one of them I display a detailed view about that person. So this is working great if I just have one user named Rikard, and it works with multiple too and I can present the detailed view. But my problem is that I don't know which user I clicked on if I have tagged multiple people with the same name. I know I have to go for the ID. Right now I display by name, so it's not that strange that it's not working.
Should I save information in the database in which order the user entered the two tags or how can I ever know who is who?
Please point me in the right direction. The functionality is working great, it's just the logic for who to display when I click. I want to recreate the tagging system that Facebook have when people comment a photo and tag people in it. You can write multiple names there and Facebook will of course know who is who.
ADDED
So what I do when I'm creating my tags. I choose from a list of available tags or I can write them. I will always know which tag to save the current comment with. But the problem occurs when I display them in to different parts,
The first part is just a UILabel with all the tags in a row, separated by blank space. Here I know where the user tapped and I can display the detailed view for the with the name.
The second part is all of the text, I can find where the tags are located, on which line and between what pixels on that line. And I know when I click on them.
But what I need is the logic for clicking two tags with the same name in the same UILabel. Should I somehow save the order of how I saved the tags?
One option that comes to mind is using an NSAttributedString in the label. You may add arbitrary attributes to ranges of text using that class, and its mutable subclass. Thus, you could add a custom attribute to the range of each user's name, and assign for the corresponding value some unique identifier for the user – possibly an NSNumber or NSString that can be used to retrieve the proper information.

TDBGrid columns design time or run time?

I am using TDBGrid for the first time.
I didn't even notice the Columns property in the object inspector and everything went just fine: the grid was filled.
Then I saw the Columns property and tried it. When I use the object insector to add items to the Columns property of the grid, they do not all of them show up at run time. To me, it looks like the FieldName property is important. It looks like it is correct, but there are no values in some columns.
If I leave this property blank (no columns at all) it seems that the control populates it itself at run time and I do see all the columns. I could live with that. When I set column titles at run time it works, but setting column width does not.
[Update] Thanks for the feedback. I am learning slowly. Now I see what is happening. I wanted three of the five columns to be calculated. Two are gotten from INNER JOINs and the third from an SQL 'cast' of SELECT ... FROM_UNIXTIME(<table>.time_stamp).
If I do not define the columns at design time then these values are populated at run time when I execute my SELECT. Cnn anyone tell me how to set things up at design time? Thanks
There is no difference in functionality between runtime and designtime set up columns. That is: what can be done designtime can also be done runtime, and vice versa.
When te Columns property is kept empty, the grid fills it by default with all fields it finds in the linked dataset, once the dataset is opened. All column specific settings, such as alignment, width, title caption, etc... are set to default, based on the type, length and name of the corresponding field. This is the lazy way which sure could be sufficient.
You could deside to use your own setup or modification of the columns property, for one or more of the following reasons:
Change the order of the dataset fields in which they must appear in the grid,
Truncate the width of text fields (especially VarChar fields or Char fields with a large length normally result in colums that are too wide for normal presentation and/or user interaction),
Change the alignment of the fields (normally numeric fields are right aligned by default),
Hide one or more fields from the dataset,
Etc...
These own settings can be done desingtime as well as runtime.
Using the designtime columns editor is the preferred and RAD way in need of these customizations. Open the editor by double clicking the grid or the property, or via the grid's context menu. If the linked dataset is active then the command Add all fields is enabled, which does exactly the same as if you did not select any field at all, i.e. the default behaviour as described in the second paragraph.
The best way to define the columns on a dbGrid is to doubleclick the dataset in order to create variables that the form knows about (persistent fields). You can edit various properties of these variables such as DisplayLabel, DisplayWidth and DisplayFormat.
You can also add calculated fields by double clicking on the dialog box which appears when you double click on the client dataset.

CustomListField using VerticalFieldManager

My requirement is to create a customlistfieldmanager by extending verticalfeildmanager, I am not able to figureout how to do this?
I am not able to understand why my manager has asked me to use this method.
any sort of help is welcomed!
It's possible that he's asked you to do this because of the most limiting factor of a normal ListField: you're stuck with uniform heights.
What you'll need to do is have a parent container that is a scrolling VerticalFieldManager. Inside of that will be custom Managers that can handle the same functionality as the row would in a ListField. It needs to accept focus and fire off an event when it's clicked. You'll also need to keep track of what item number it is, so that when it's clicked it knows how to notify any listeners about which one was selected. Also, the parent VFM will need to be able to keep track of which "row" is currently selected -- in this case which one has focus.
Edit for comment
If you add a NullField into each of them it can accept focus but won't actually show up as anything. To determine if a "row" (the Manager) has focus, you can use getFieldWithFocus() on that Manager and the one that doesn't return null is the row that is selected. You will probably also have to do some custom painting to draw the selection highlight
You will have to dynamically add and remove custom elements from your CustomListFieldManager as you add and remove elements from a VerticalFieldManager.
Your manager asked that because he want you to learn how to handle custom object to understand how to use managers.

Resources