How to wrap long text in spinner items in codenameone? - spinner

In below image item names are getting clipped off. so i want to display spinner items in multi lines in codenameone. for that I have created custom picker and changed extension from Button to SpanButton and it is effecting to selected item but not drop down item.
how can i resolve this?

Spinner is deprecated for a reason. It is based on the List class which is stateless and derives its concepts from Swing. That means the same component object is used both for all selected values and another component is used for all unselected values.
If your first element that was unselected didn't span this will behave in the same way for all the following elements. That's just how a lists work.

Related

Combobox not displaying the data items

I have been trying to add Data items for my combobox in the DialogWindow of my mfc project, at design time by setting strings delimited by semi-colons for the Data property of this combobox.
But it just shows empty combobox at runtime. I tried using AddString() method of this combobox manually in the OnInitDialog() event of the DialogBox too. But that was also not working.
Tried creating a demo project again and when I added the combobox and put the value a;b in the Data property of it, it is showing up. But tried the same on my project and it is still showing the empty list in the new combobox! Tried to compare both project's code, like the header files and initialization's etc. Found that both are same. Other than some event declaration for the buttons and my custom c++ code in my project, the rest of the code is same as that of the newly created demo project!
Why in my project this combobox is showing an empty list of items? :(
EDIT:
Just noticed that the items are already in the list. But the dropdown is of small height and thus preventing the actual items from showing up! :(
Tried to look increasing the size of the combobox, but I couldn't find any property in the Property Window and dragging the corners of th combobox doesn't increases the height either! :(
Increase the size of the dropdown list like this, in the design window:
Click on the arrow on the right side of the combobox (highlighted in yellow on first pic). Then click and drag the bottom mid resize marker to increase the height (highlighted in the second pic).
This will increase the size of the dropdown list.
Otherwise when we try to click on the resize markers to increase the height, it would be disabled. So make sure you click on the arrow on the right side of the combobox first.

Scroll to a Specified Row in an Extended Data-Table Using AJAX4JSF and/or JSF/RichFaces

I would like to scroll automatically to a given row in a JSF/RichFaces Extended Data-table (rich:extendedDataTable). Ideally, I would like to use two extended data-tables with vertical scrollbars on both.
When I select a row in a first table the corresponding row gets selected in the second table (do this from the managed bean, by playing with the selection attribute of my table).
The second table then scrolls automatically so that the selected row becomes visible, even if hidden.
The solution should not involve the rich:datascroller, but instead use the out-of-box JSF/RichFaces vertical scrolling.
Thanks for helping!
Matthieu
So well I finally developed my own kind of scrollable datatable, playing dynamically with the "first" and "rows" tags of both the datatable and collapsible subtable.
Relevant values are dynamically computed by the managed bean.

viewpanel selections being unselected on dialog box show

I have an extension pages dialog box on the same page as a viewpanel that has check boxes enabled. If I check some check boxes then show the dialog box, the selections in the view panel become unselected. Is anyone else seeing this?
I have the same issue and it looks like we're trying to do the same thing. I plan to add the selected IDs to a sessionScope, update their values, then remove the sessionScope.
I found this one, so I'll update here to see if it works: get the unid of selected documents and save to scoped variable
UPDATE:
I got it to work by setting a sessionScope variable for the selected IDs, as in the above example:
sessionScope.put("SelectedIds", getComponent("viewPanel1").getSelectedIds());
In the SSJS script, I changed the code to read the sessionScope array instead of the viewPanel's selections.
Fortunately, the IDs are very small (3 characters), so if there are a lot of documents, it should be ok.
Good luck!

Rich pick list tab order

I am using rich:picklist. It has to two list boxes as it has and four buttons in between for moving one or all . I need to give tab order to this picklist together with buttons and boxes.
Can anyone help?
I think you can't beacause there isn't tab index on the component.
Looking on the generated html source, boxes are tables and buttons are div : hard to define a tab order without the generated ids on such components...

DrawItem in listbox (VC++)

When we will use DrawItem for a listbox?
Normally, if the listbox is ownerdraw, we will use DrawItem. What are the other senarios we use drawitem?
To elaborate on Rashmi Pandit; A ListBox with override DrawItem can also be used to 'visualize' objects. In a project I'm working on, a ListBox is used to display rows from a database. Each row / item is visualized using formatted Strings, Icons etc.
Overriding DrawItem (and MeasureItem!) is ideal for this purpose. Of course, the internal structure has to be tweaked a bit (the standard Items property cannot be used for objects), but it is certainly worthwhile.
Message WM_DRAWITEM is sent only to owner-drawn List boxes.
You can use DrawItem when you want to override the default implementation and custom the way a listbox is drawn. For e.g. in the list there might be some item which should is the default item and you would want it to be highlighted so that the user knows it is the default item.
Here's an eg for a combo in C#: Higlighting a particular item in a combo box

Resources