Changing the Updatable property of a View Object Attribute through code - oracle-adf

Is there a way to set the "Updatable" property of an attribute in a view object through code ?
I checked the API docs for the AttributeDef class but there is no method to set this. there is a constant (UPDATEABLE_WHILE_NEW) which gives the current value.
My requirements in short - I have a ADF editable Table. Based on a flag whether it is SET or NOT, i need to make a particular column such that the inputTextBox on this column must appear for only the new rows inserted into the table. For all the existing rows users should not be allowed to edit values on this column.
I know this can be controlled with the UPDATABLE property on the attribute in the view object by setting the value as "WHILE NEW".
Now i need to control this through code at runtime.
Please let me know on ow to do this.
Thanks.

change read-only property of your field according to your flag value

Related

How to propagate changes from Entity row to View row

Normally, if we update an attribute in a View row, we can easily see the updated value in the Entity row as changes are propagated down the hierarchy.
My question is if we instead update an attribute on the Entity level, is there a way that we can get the new value on a current View row of a View object that was built using that Entity.
If you update an attribute on EO level, it will automatically update the VO attribute as well. It goes both ways.
Seeing you are asking this makes me think you tried it and it didn’t look like working. If that’s the case, you are probably having a Partial Refresh problem in your screen. You can try using a partialTrigger.

Calculated View Object Attribute not able to be used in JSPX page

Hello I have a View Object "Validationerrortallygroupsview" In this VO I have a calculated attribute that is generated by a join in the query. The calculated attribute is RuleName1 (RULE_NAME alias).
Here is where I show the attributes:
The SQL query that backs this View Object has a join with another table and this join is what generates this extra RULE_NAME attribute:
The SQL Query tests fine and everything but when I go to my JSPX page to actually reference this attribute using EL, the new attribute doesn't show up in the variable.
I have a row variable that is simply used to iterate through the bindings for a table Control, ruleName1 is not an element that I can choose off of that variable, I can only choose the Attributes that were defined originally as part of the Entity:
Can you check the tree binding whether the attribute "RuleName1" is present or not ? If not , you may need to refresh the data control once and add it to attribute list of the tree binding .
Drag&Drop that property from your DataControl, or better the whole form/table in a clean page to see what is going on.

Changing the properties of a field dynamically

In my application's viewport i'm showing the form panel with a list of fields in center region and property-grid in east region.
I need to show the list of properties of the field in the property-grid on selection of the field.
The user is able to change the properties.
Now my requirement is to apply the properties dynamically to the field.
Is there any generic way to achieve this?
Can someone help me?
Some properties have getter and setter functions, but not all of them and I doubt they are consistent enough for what you are trying to do.
My suggestion would be to store the config object for each field, the config object would have each property that you want to be able to change using your property grid. When a property changes, remove the field from the form. Re-create it using Ext.create and passing your config object as the second parameter. Then just insert the object back into the form.
EDIT: You can probably skip using Ext.create by using the insert function on your form panel, it seems to be able to accept a config object directly.

ExtJS 4 - How to avoid grid column value becoming null when column editor is combo-box?

I have a column in a grid with editor as combo-box.
When the grid is loaded then all the column values get displayed properly.
The issue is, when user clicks at the column (having combobox as editor) to edit it then the column value becomes null as shown in the attached screenshot.
I understand that the value becomes null as the store of combobox has not been loaded yet.
I can not use autoLoad true due to the heavy amount of data present in the combobox store. Moreover, even if I use autoLoad:true for the store with paging in it, then that too safeguards only those values which are present in the first page and not all.
Thus, how can I maintain the value in grid column when that value is not present in the store of combobox used as editor for the column?
Could anyone guide at this?
PS: I am using ExtJS Ver 4.0.2a
I have been able to find a solution for this.
It has more to do with the version of ExtJs. If we upgrade to 4.0.7 and then use forceSelection:false for a combobox then things work fine as expected. That is, the combo-box accepts a value which doesn't exist in its store and doesn't set the current value to null.
Hope this helps someone else too looking for something similar.
I would suggest having the grid record contain both that columns value, as well as display value. If the combo store lookup is unable to find a matching value (because that combo store hasn't been loaded yet), then revert to showing the display value stored with the grid record.
You might also need to have the afteredit event on the grid update that grid records display value after that column is edited for a particular row.

Forms Databinding - DataSet not updating?

I have a Form (Compact Framework, actually) with a few fields, a date and a string, among other things. Both TextBox controls are bound to properties in a BindindSource.
The BindindSource has a DataSet as its DataSource property, and the DataMember is a table in a SQL CE database.
When I want to add a new row, I call bindingSource.AddNew(), then bindingSource.MoveLast(). The form shows the default values (as defined in the DataSet) and I can edit all the fields.
To save the form, I call bindingSource.EndEdit() and insert the values from the DataSet row into the database, using a TableAdapter method. The date makes it into the database, the string does not. Instead, the default value for the string is saved, not the value that I typed in the text box.
When I inspect the data in the DataSet table's row after calling EndEdit(), the date field is updated with the data from the form, the string is not.
Oddly enough, when I edit an existing row with the same form (without calling AddNew), the string field is updated and persisted just fine. So this only happens after calling AddNew() on the BindingSource. What am I missing? Where should I start looking?
The code is a bit too much to post here, unfortunately.
I found the issue - I had accidentially select the same column in the BindingSource for both the Tag and the Text property of the TextBox. I think what happened was that the Text was written back first, the Tag second, and because the Tag was not updated, it overwrote the modified value.

Resources