removing fields from manager - blackberry

I have a parent screen for my application in which there are 4 custom managers,custommanagers1, custommanagers2, custommanagers3, custommanagers4 for all the screens of my application it is enough if I manage to change the custommanager2(removing fields and adding fields).
Any sort of help is welcomed
A Y

You want something like:
myManager.replace(oldField, newField)
If not, I'm not getting the question.

Related

Saving data and displaying it in a form Rails 4

I have created a call report form with my contact's first name & contact's last name in my scaffold. Although I can clearly see the fields in the form and I can go ahead and edit them, the fields of contact_first_name & contact_last_name are always empty after being saved and returning to my view. I don't know what to do or how to approach this issue.
Any suggestions would be greatly appreciated.
There could be many problems:
contact_first_name or contact_last_name could be misspelled.
in controller they may not be permitted
you might be overriding these fields somewhere
etc etc
Possible solutions or the directions to the solution are:
check database for their existence
check spells
check them in permit list
check the logs
But Code would be helping for both you and answering persons. So please post code with your question.

How to customise naming of symfony 1.4 form elements

I know this is possible but I can't seem to find the right search string to get the answer online.
I have MyForm()
and I want to create 5 of these rendered within the same form so I want to change the naming structure of the form elements thus:
name="forms[1][fieldname1]"
name="forms[1][fieldname2]"
name="forms[2][fieldname1]"
name="forms[2][fieldname2]"
etc
so that when it is submitted I can just iterate through the $_POST['forms'] array, binding each one to a MyForm instance and validating.
I'm sure you can customise he naming of fields for symfony forms in some global way rather than going through each widget but I just can't find it on the web.
Anyone point me in the right direction?
Thanks.
Solved own problem :
$this->widgetSchema->setNameFormat('my_form[][%s]');

Dynamic embeddedForm

I'm looking to add an embeddedForm dynamically in Symfony 1.4 using Doctrine.
What I'm mainly looking to do is:
1) Only show the relation based on whether or not a checkbox has been ticked
2) If checked, show the embeddedForm
3) Have then the ability to add a new embeddedForm or delete an existing form
I have seen ahDoctrineEasyEmbeddedRelationsPlugin, which looks pretty good with los of configuration. The only problem was that 'newFormsInitialCount'=> 1, means that there is always 1 form as default. I need 0 forms as default and only.
I've also seen a couple of tutorials, but all seem to have at least one relation by default.
For me, the embeddedForm needs to be OPTIONAL, and only display when needed.
Thanks
Follow information based on these links :
http://www.thatsquality.com/articles/stretching-sfform-with-dynamic-elements-ajax-a-love-story
http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms#chapter_06_sub_the_form_saving_process
First is about adding "subforms" with ajax, derived from second you could hide the unneeded form fields and toggle them per javascript (e.g. jQuery.toggle())) !

auto_complete_for: prevent the first item from being auto-selected

The auto_complete_for dealio from script.aculo.us is great an all, but is there a way for me to selectively disable the fact that it always auto-selects the first item in the list?
The problem is that, if I want to type my own entry that is new, and novel, I don't want the first item in the list to be auto-selected. The reason is because when I TAB out of the field, it selects, and fills the text box with that first item.
I got around that, somewhat, by making the first item in the list the same as what I'm typing, but that's not perfect either, because the auto_complete list doesn't always update with every keystroke, depending on how fast I type. I've tried setting the list refresh rate to the lowest value (1 millisecond) but no go.
What I really want is an option in "auto_complete_for" that doesn't select that first item at all - the same way that Google Instant doesn't automatically select the first suggested search phrase - you have to arrow-down to select one.
Maybe I can do this via an HTML option that I'm missing?
Looking at the source, there doesn't appear to be an option for that, but I bet if you changed line 284 of controls.js to this.index = -1; it would do what you want.
Otherwise, it might be time to look for a different autocomplete widget.
If your requirements are too far away from the available plugin, then I guess there is no point in tinkering around. Its best to write your own JS code.
You might want to consider this: https://github.com/laktek/jQuery-Smart-Auto-Complete
or this : https://github.com/reinh/jquery-autocomplete
I'll add another alternative that works great with Rails 3:
http://github.com/crowdint/rails3-jquery-autocomplete
I recently implemented auto complete for more than a field for Rails 2.0.2.
The plugin I used is:- https://github.com/david-kerins/auto_complete . Not sure if it supports Rails 3.
I have also encountered issues on implementing the above scenario and have posted questions( Implementing auto complete for more than one field in Rails ; Implementing a OnClick kind of functionality and formatting wrt Rails Partial-Views ) on stackoverflow for the same, I have been lucky on getting things working for me based on my requirement.
Kindly refer to these questions, they might have relevance to your requirement.

How to design a system like google base with dynamic attributes? in Ruby on Rails

I am wanting to create an application that can allow users to add products for sale.
I want to make it so that a user can add whatever type of product he/she likes and let them also create stored and searchable attributes for their products - alot like google base does.
Does anyone know of the best way to do this ie model it.
I don't really want a table for each category as this would be possibly 1000s of tables.
What is the best way to do this? has anyone got good / bad experiences of this?
Is there any plugins that does this?
Any help would be great
thanks
rick
It sounds like what you want is a tag system.
If you want something more flexible you might want to look at using a document store instead of a database, for example CouchDB.
If you don't want to keep this in a relational database I'd suggest creating a Model called "Descriptor" that would contain the ID of the item being added, the name of the attribute "Color" and the value "Red".
To help keeps things consistent you could also structure pre-set groups of descriptors (for cars: make, model, color) as well as provide auto-completes for the value entry text fields.

Resources