how to get selected item index in form in j2me - java-me

I am appending 20 images in form by using loop.when i am scrolling these images up and down i want selected image index so that i can view bigger size of selected image.
i used this form.append(image)
is there any method or way to get selected item index in form like in list there is getSelectedIndex.
plz help me and provide me gud solution ..

The APIs for javax.microedition.lcdui.Form don't provide a means to get the selected item index, most likely because it wasn't designed for that kind of use. For the use case as described in your question, the correct approach would be to use javax.microedition.lcdui.List. In addition to determining the selected item, List also provides other useful APIs such as setting a select screen command for the items in the list.

Related

Is it possible to display dict.values() under the wx.ComboBox but transmit dict.keys() to Bind event?

I'm working on a GUI based on wxpython and have the following question regarding wx.Combobox feature:
Is it possible to display dict.values() in the drop down list and select one of the displayed item but in Bind event send dict.key for this item somehow? I want to present possible options for selection in a user friendly way - example is below.
I think it should be possible with the dictionary but don't know how to realize that.
I'm parsing all Sections from INI file with configparser to a list:
sections= ['123ABC456','123DEF456','123GHI456','123JKL456','123MNO456']
and assign it to Combobox:
self.combo_sections = wx.ComboBox(panel, choices=sections)
self.combo_sections.Bind(wx.EVT_COMBOBOX, self.on_combo_sections)
self.on_combo_sections function is parsing section's options.
What i need is to convert list items to a readable format:
['ABC','DEF','GHI','JKL','MNO']
And display these values under combobox drop down list. Since initial Section's values are essential for further work - based on section name, configparser gets section's options, how can i send original values instead of formatted ones but still display formatted ones under the drop down?
Thanks in advance for any inputs!
wxComboBox supports associating the so called "client data" with each of its items, so you can use this and store the sections value as this client data, then you will be able to get them back whenever you have an index of combobox item.
Alternatively, just keep your own array in combobox items order and store the sections in it -- this is more or less how "client data" is implemented internally anyhow.
The main advantage of using built-in client data support is that it is kept in sync even if the items are added/inserted/deleted to/from the control, but if your combobox doesn't change after creation, using your own data structure should be simpler.

Drupal 8 - Display one image from multifield based on the title attribute

I'm working on a Drupal 8 project and having issues trying to access one particular image of an image multifield, eg {{field_images}}.
I have a View with Exposed Filters which returns a list of nodes based on selected taxonomy terms. One of those taxonomy terms, has values that may match the title field of images contained within field_images.
The view displays a teaser list of content based on the filters, which then links to the full node content page.
Normally, the node list returned in the view will only display the first image from the multifield, displayed in the template like this {{ content.field_images.0}} or by simply limiting the images returned in the view itself.
However, in the case that an exposed filter value in the view, say "bathroom" is selected, I want to be able to find an image from field_images that has "bathroom" in the title and display that instead.
Is there any way using either twig logic or views that I can achieve this?
Thanks so much for any assistance anyone may have!

how do i add ext.net dynamical web form control and retrieve its contain value to save in DB.?

i want to dynamically add two text box and obtain values from those and display as message ...
please help me though example to demonstrate this scenario where I can learn and apply for my actual problem
Take alook at those examples
http://examples.ext.net/#/XRender/Basic/Add_Items/
http://examples.ext.net/#/XRender/Basic/New_Window/
*those links ,official web site of ext.net.
instead of adding tab or windows ,just change them to TextField.
u can assign unique id for each element added dynamically,and reach those element via Id

UIA - AutomationElement doesn't return correct name when list view changes

I'm trying to read the contents of a "list view" using automation. The first time I navigate to it, I'm able to go from item to item, getting the correct text for each list item. However, when I display a different screen (which is apparently reusing this display object), the text on the screen is different, but automation gets the same text as the first set. From then on I can only get the text for the first view I looked at. It's like the text is being cached and I'm only able to look at the cached view. UISpy, however, seems to grab the right values every time, and if I use it while my automation is paused, I end up getting the right values.
In my automation, I use Find to grab the header, and walk the tree to the List View and get the text for each element. I thought if you used the Current property, you got the live data. Apparently I was mistaken. How do I either refresh the tree or get the REAL data?
Yes, the Current property on a certain AutomationElement will return its current, 'live', value. UIA will not cache anything automatically, you'll have to declare it yourself and explicitly access the Cached properties.
What's probably happening is that the new tree items you're seeing after selecting a different screen, are actually re-created (and that actually makes sense, UI-wise), not just updated. You could easily determine if this is the problem by selecting the first screen and writing down the tree items' RuntimeId property (you can see it in UI Spy). Then, select the second screen and check if the RuntimeId has changed. If it has, then it's just not the same object instance.
If this is the case, all you need to do is get the items again. It'll be easier to do this using AutomationElement.FindAll with a ClassName property condition.

Best way to implement <next>, <prev> element links from search list

In my web application I got a search results list (SR). The search is heavily parametrized. Each element on the list can be clicked and then the element's own page (EP) is displayed.
Now, the customer wants to have the ability to go to previous and next element from the search list that was used to enter the element page.
How would you implement this? I can either pass the search conditions to the EP and the element's index on the list, then prev/next would just mean to rerun the search query, get previous / next index and display it (still passing the conditions and new index).
Or is there a better approach?
How intensive is your search process? It sounds like something you don't want to execute anymore than necessary. What if you when you render the search results you also store in a list the unqiue EP IDs on the server. You can then navigate through that using indexes for prev/next and the unique ID of the EP element to load details? You can then also store the query term and repopulate the search results with a 'Back to Search' link?

Resources