extJS combobox setValue() but post ID - combobox

I have a combo populated with names - each with a unique ID that is not shown - just the name is rendered.
When I manually select from the combo and submit - the form POST's the ID of the name which is perfect.
However I need to set the value of the combo dynamically under some circumstances and do by calling setValue('Name') but when I POST the ID value is coming out as the string name set by setValue()
How do I set the name (or the ID) but POST the ID and show the name in the combo?
I have tried calling setRawValue() while passing the ID in hopes the control would translate and show the textual form - but no dice :(

You have setValue() and setRawValue() backwards. Use setValue('id') to set the combobox value, it should automatically update the display value if you are using a renderer in the combobox config.
Think of setRawValue() as setDisplayValue().

Related

Update form field value dynamically

I need to update the form field value using javascript as below:
var frmRec = App.frmEdit.getRecord();
frmRec.set('CallingName', 'Tesing calling name');
When I check the form data via the console, I can see the calling name field is updated:
console.log('rec: ', App.frmEdit.getRecord());
But the textfield in the form is not updated, old values still show up in the form. How can I "refresh" the value of the TextField in this case ?
Thanks in advance
If your data binding is setup correctly there is no need to refresh anything. The Extjs form supports two-way binding change to the record would be reflected in the text field and any change to the text field would be updated in the record.
two way binding example
The kitchen sink examples have lots of data binding examples.

Kendo UI ComboBox using angularjs takes time to display value on preview

We are working with kendo ComboBox using angular js. We bind value to ComboBox using angularjs scope. On preview event, when we assign value on load time (fetched from database) to ComboBox, it takes time to display value on front side in ComboBox. As we marked on preview time, first it binds data to ComboBox and then display value. Is there any solution to display selected value/text on front side, whether the ComboBox get bound or not?
Yes you can do it by applying value in the modal and setting the text accordingly.
Like Your model is countryId and have text value as countryName and name of the combobox is countryComboBox then you can use it like below:
$scope.countryId = 1 (id of which you want to be displayed at first)
$scope.countryComboBox.value(1)
$scope.countryComboBox.text('INDIA')
it will initially set the text to INDIA.

ADF: List of Values Update Multiple Fields

I have an LOV added to my view object which updates 6 fields - done all through the LOV wizard in JDeveloper. It works perfectly fine when test running the application module - all fields update with the proper values after selecting a value from the LOV. However in my JSPX form, the only the field that gets updated is the one that the LOV is attached or is initiated on.
On my form, i only display 2 out of the 6 fields - the field which initiates the LOV and another editable field that the LOV is supposed to update. The part where this gets interesting is that the 4 other fields in my view object that i dont put in my form, are updated successfully by the LOV! But the one additional editable field that i left in my form, isnt updated.
Why is that?
I could just write a method in my View object Row Implementation class to update that editable field manually, but i feel like theres something more straight forward via declarative approach.
Thank you!
Fixed!
I needed to update two settings on my 2nd field of the form.
Removed the default bindings on the "Required" attribute and set it to "false".
Set "ShowRequired" to true
After that, I saved my changes and re-ran my application and the field updated properly!
I hope others find this helpful!

Set value for ExtJS.form.ComboBox

I have an Ext.grid.EditorGriPanel which has an combobox editor in its columnModel (the store of combox has just only 2 items: enabled/disabled). When a new blank row is inserted to grid, I want the combobox in that column have to be set to a default value (enabled), and the dropdown is not expanded.
I've tried to use
grid.colModel.columns[2].editor.select(0)
to get the combobox editor and set "enabled" value for it, but it did not work. Another way is using grid.colModel.columns[2].getCellEditor(rowIndex), but it returns an EditorGrid (I was so surprised because the ExtJS 3.3.1 API doesn't have this component).
Could you please help me on this problem?
Thank you so much!
When a new blank row is inserted to
grid, I want the combobox in that
column have to be set to a default
value (enabled), and the dropdown is
not expanded.
When the new record is inserted to the grid's store, the value of your column (in the record) needs to be set to "enabled". I'm not sure if you are doing it like this currently? In other words, the value must not be set to the editor of the column. Set it directly in the record.
(Also, you can define default values to be used for all records using the recordType property of the store - see ExtJS API documentation for more details - but this is optional.)
Finally, note that the combobox will not be displayed immediately after the row is added. The combobox is displayed only when you start editing that particular cell - this is the way EditorGrid works in ExtJS. But at least you should get the new row to immediately display the correct value ("enabled") with this advice.

Get data into one form field based on another's field in access 2003

I am trying to update existing form field based on another combo box selection.
I have a DB with such relations: http://img696.imageshack.us/img696/7396/relationse.jpg
I have a such form: http://img233.imageshack.us/img233/9758/getdata.jpg
Which Offers to select only existing IDs in database.
All i want to do is when user selects (change) existing combo box "Filmas_ID" value, in nearby input box with value "Unbound" shows up data related to this ID (You know - Just for informative reasons).
(SELECT Filmas.Nosaukums FROM Filmas WHERE Filmas_ID = combo box "Filmas_ID" value; )
It looks very simple, but i had no success yet to get it work.
Thanks for your help! =)
There are a few handy ways to do this, one involves including the data in the combo. Let us say the combo is set up like so:
RowSource : SELECT Filmas_ID, Nosaukums FROM Filmas
ColumnCount : 2
You now have a choice of setting the column widths so that filmas_id is selected, but Nosaukums is shown in the combo. Alternatively, you can set the textbox to reference the combo column, like so:
= mycombo.column(1)
Where columns count from zero.
Another method is to use DlookUp in the control source of the textbox:
= DLookUp("Nosaukums","Filmas", "Filmas_ID = " & mycombo)
Where Filmas_ID is numeric and the required value is in the bound column of the combo.

Resources