i am working with j2me List.It contain many elements.I want when i select the any of them
i can use it value in my required function.e.g in my code i select a number when i select it
i press a command chat a text area is shown when i write some text there this i can get easily
but how the selected element from list how i can get it .....
<Object Of List>.getSelectedIndex();
You can maintain a Vector which have the same data as filled in List Component.
Now you can get getSelectedIndex and can retrieve object from Vector from the position to get the selected Data.
Related
I have a properties page that looks like this
property1=value1
property2=value2
property3=value3
property4=value4
And my plan is to be able to create a page in my app that will display these values and allow the user to change and save them.
The way that I thought I would do this is to create a method that will iterate through the file and populate a text control with the data.
I am using the 'propertyNames' function explained here https://www.codenameone.com/javadoc/com/codename1/io/Properties.html
Unfortunately when I use this, all that is listed are the properties and not the values
Is there a way to show the entire contents of the properties file?
The other way I was thinking about doing it is to create a list of buttons that correspond to the keys - so one button for each key [with the key name as the button label] - and then when the user clicks on the button it displays the key value in an editable text box, and a save button that writes it back to the file.
Is this possible?
Thanks
propertyNames gives you all the keys, then you can retrieve the value of each get key using getProperty:
for(String key:props.propertyNames()){
String value = props.getProperty(key);
output += key+"="+value+"<br/>"; //however you output your stuff
}
After letting the user set new values, you can set them using setProperty(key, newValue).
I have a java servlet application where the database is populated by selecting an entry from a dropdown list and entering the values. On another page I have the same dropdown list and also have a find button to display the values that were previously entered by selecting an entry from the dropdown list. I want to get rid of this find button and dynamically display the previously entered values on this page. I heard this can be done using ajax. Please help me out.
Since the code is too much to share I have uploaded the snapshots of both the pages.
https://www.dropbox.com/s/10qmpxzwm8sik8a/1.PNG?dl=0
Here I am entering the values in estimate by selecting the project
https://www.dropbox.com/s/w8macftnm3rez3a/2.PNG?dl=0
Here I want to get the values just by selecting the project from the drop-down without clicking the Find button
You need to be specific with your question.
If I got you right...
You can use a variable in javasceipt to hold the value that was enterd on the other page you got.
Then while using the dropdown on the other page you can retrieve the values that you store and use a simple ajax request with json data to your servelet.
Check here for examples: http://api.jquery.com/jquery.ajax/
i have a friend list from facebook and above the list ,there is edit text box.
i able to retrieve the name from the list .
When i click on the one position from the list ,i want to show that name to the edit text,then if other name is selected ,then it added to the edit text box after first selected name and so on.
I had tried finding the way of doing this ,but could not able to get the proper answer for implementing this .
added the name to the list which is being selected by the user.
for example
below is the list and above is the edit text when i click on the list view position,the
value of that particular position to be shown in the edit text,now if other position is
clicked by the user ,in the edit text ,it will be shown as name1,name2.
if third value is selected from the list then i should be shown as name1,name2,name3
and so on.
When i am trying to add in the array list,on clicking ,it overwrite the previous value and shown only one value in the edit text.
Regards
inder
Look here, this is a beautiful solution for you to use in your code
i m new to android .
i m doing my final yr project in android.
Is the any way to use more elements in list view control....
for example: fetch more data frm database and add it at runtime.
the formate may be
text text
text text
text text
text text
etc.....
refer this page for model https://play.google.com/store/apps/details?id=app.diaryfree&feature=search_result#?t=W251bGwsMSwxLDEsImFwcC5kaWFyeWZyZWUiXQ..
(in this page sample image for that application wil be given, like that report i need to display my data.)
is any other control there for that??? how to add runtime more assign more than one element value???
like this
and how to find which row is clicked?
thankz in advance
you can create custom list views to format the listview the way you asked for. And cursors are a good way to fetch data from a database and pass it to a listview. you can use adapters for that.
a sample code for custom list view can be seen here
to find out which item is clicked you need to use onListItemClickListener like given here Android: onListItemClick in Activity
I have two fields in a webpage. Both are composite primary keys. Out of that when I select one field (eg. out of a list of countries I select - India), the second field should display all the values corresponding to the previous field (eg. after selecting India I should get all the states in another drop-down menu).
I'm implementing this using JSP and Ajax.
Can someone please help me with this or send me the code snippets.?
Neal,
There are various codes available like this. Just do googling.
Try with link