Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    includeFrom fields still editable

    Hi,

    There seem to be a problem in DynamicForm when trying to turn canEdit() to false. Here is a small example:

    Code:
    DataSource.load("test", new Function() {
    			
    			@Override
    			public void execute() {
    				DynamicForm form = new DynamicForm();
    				form.setDataSource(DataSource.get("test"));
    				form.setCanEdit(false);
    				form.fetchData(new Criteria("ID", "1"));
    				form.draw();
    			}
    		}, true);
    And here is the datasource definition:

    Code:
    <DataSource
        ID="test"
    	serverType="sql"
    	tableName="SEC_OPERATOR"
    >
        <fields>
       		<field name="ID" type="integer"	hidden="true" primaryKey="true" />
            <field name="NAME" type="text" title="Name"/>
            <field name="BUNIT_ID" type="integer" foreignKey="businessUnit.ID" hidden="true" title="Business Unit"/>
            <field name="BUNIT_NAME" type="text" includeFrom="businessUnit.NAME" title="BUnit" />
        </fields>
        
    </DataSource>
    In the dynamic form, the BUNIT_NAME field is still editable, altough I've called setCanEdit(false) in the dynamic form.

    Note that if I add:

    Code:
    form.getField("BUNIT_NAME").setCanEdit(false);
    ... then the field is read-only as expected.

    Can you please have a look if fix this if necessary?

    Thanks,

    Thomas

    PS: We are using SGWT 4.0 (Power edition)
    Attached Files

    #2
    Is the field definitely editable, or does it just *look* editable? There's a feature, readOnlyDisplay, for which the default value is "readOnly", and which we would expect to render formItems that look enabled, but that can't be edited...

    Comment


      #3
      Thank you.
      Yes the field is unfortunately defenitely editable, as you can see in the screenshot I attached (and the first one, which is not an 'includeFrom' field is not editable, though I did not code anything special for any field).

      Thomas

      Comment


        #4
        Ok, we'll take a look and update this thread when we have more information

        Comment

        Working...
        X