Blackberry hide fields - blackberry

I have a dropdown list in which I select how many people are going to a party. When the user changes the value of the dropdown list, I want as many fields as the number selected to appear and hide the rest.
But I don't know how can I hide or delete fields because I don't know their index.

Yes you will need to have the fields you want to hide as a global variables.
You will also need to get the value the user has selected and use that to work out what fields should be removed or added.
One way would be to add all the fields in order to a vector or an array when the screen is initialised. Once the user has selected a value you could iterate through the fields and use the current index of the list and the user selected value to work out if the field should be removed or added.

If you have the field objects, then use Field.getIndex() to find the index of each field within its manager.

Related

Keep list items in their original order of selection

In my app, when I select items from a list using check boxes, their IDs are passed to the controller in ascending numerical order, regardless of the original sequence of selection. I've noticed that the params organize the IDs this way automatically. This results in the selected items being stored and shown without respecting the order they were originally selected. How can I keep the original order of selection? Thank you.

How to dynamically arrange the sequence of columns to be displayed based on the priority set for each column by user .In UI-Grid

User has options for selecting columns he/she wants to see(from a list of check boxes user can select) and they can also set priority for each column i.e which column should be displayed first,second and so on .How to make this happen .
Thanks
I have not tried this before. But I think what you can do is sort you columnDefs array in the the grid options dynamically. And then do queueRefresh()

Variable-length form submissions

I'd like to create a form_for statement which allows the user to select elements one-by-one from a drop down menu (or an auto-complete field). As the user selects each item, they should be displayed in list format at the top of the screen. When the user has finished selecting elements, the form can be submitted and the list of selected elements is sent to the receiving controller action.
Can someone tell me how to implement this?
Maybe Chosen is what you need.
Take a look at:
http://harvesthq.github.com/chosen/

Rails-Haml, Table display of checkbox selection

I have a table that displays data for the items selected in the checkbox above, like a[], b[], c[]. Initially, when the page is first loaded, the table display is empty. When checkbox selections are made, the tables displays the data for the selection. Then when I untick all checkboxs and press display, the table display should be empty.
In the controller the variable for checkbox selection is thus>
#selected_brands = params[:brands] || session[:brands] || {}
as you may realize, params[], and session[] are values submitted by form in the view. {} -> when no checkboxes are selected.
Again in controller, I have this
#products = Product.find_all_by_brand(#selected_brands.keys)
The problem I have is, when I have unchecked the boxes, following the previous selections I made, the table displays data from previous session, instead of an empty table. What am I not doing?
You run into a HTML issue bugging lots of people: when you uncheck all checkboxes, nothing is sent to the server, and thus no change is recorded, so the last situation is still recorded.
There are many solutions to this (events, javascript, serverside code), so my advise is to broaden your search to generic html how to handle this situation best.
If you don't like Javascript, and have no problem with too many db-actions, remove all selected brands for the product and reapply the chosen ones when you get this result.

Delphi - Using DBGrid to select rows from a search

I have searched a database using a query.
The results of the search are displayed in a DBGrid component for the user to select the row s/he wishes to proceed with.
DBGrid always sets the record pointer to the first record in the results set, so a row is always "selected" by default. I need to change this behaviour to no row being selected when the data is first presented so that I can determine if the user has actually made a selection.
Is it possible to tell if no selection has been made, i.e. no row has been selected by the user?
Any help very much welcomed!
You can include dgMultiSelect into DBGrid.Options, then DBGrid.SelectedRows will contain list of explicitly selected record bookmarks. Without dgMultiSelect the DBGrid always track the current dataset record.

Resources