Announcement

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

    Included Field in Non Editable Dynamic Form is Editable

    Chrome 18.0.1025.152
    SC_SNAPSHOT-2012-01-19_v8.2p/PowerEdition Deployment 2012-01-19
    Windows 7 64bit
    RSA 8.0.4 WAS 8.0

    I have a hibernate datasource that includes a field from a related datasource. When I add a dynamicform with canEdit = false, the included field is displaying an editable textbox rather than a <div> label like the rest of the fields.

    Datasource
    Code:
    isc.DataSource.create({
        fields:[
            {
                title:"TransmissionID",
                type:"sequence",
                name:"transmitSessionId",
                primaryKey:true
            },
            {
                title:"Employee #",
                name:"employeeNumber"
            },
            {
                includeFrom:"device.serialNumber",
                title:"Device Serial #",
                type:"text",
                canEdit:"false",
                name:"serialNumber",
                valueXPath:"device/serialNumber"
            },
            {
                title:"Start",
                type:"date",
                name:"startTime"
            },
            {
                title:"Finish",
                type:"date",
                name:"stopTime"
            },
            {
                title:"Telxon Completed",
                type:"boolean",
                name:"telxonCompleted"
            },
            {
                title:"Server Completed",
                type:"boolean",
                name:"serverCompleted"
            },
            {
                title:"Shopback Requested",
                name:"shopbackFileNumber"
            },
            {
                title:"Transaction Count",
                type:"integer",
                name:"transactionCount"
            },
            {
                title:"Error Log",
                type:"boolean",
                name:"errorLogExists"
            },
            {
                hidden:true,
                name:"device",
                foreignKey:"device.serialNumber"
            }
        ],
        ID:"transmission",
        serverType:"hibernate"
    })
    isc.DataSource.create({
        inheritsFrom:isc.DataSource.create({
            xmlFromConfig:"true",
            generatedBy:"SC_SNAPSHOT-2012-01-19_v8.2p/PowerEdition Deployment 2012-01-19",
            entityName:"amgreetings.telxondatawedge.rest.bean.Device",
            dataSourceVersion:"1",
            fields:[
                {
                    type:"text",
                    name:"landmarkCode"
                },
                {
                    type:"text",
                    name:"loginCode"
                },
                {
                    type:"text",
                    name:"employeeNumber"
                },
                {
                    type:"text",
                    name:"serialNumber"
                }
            ],
            ID:"device_inheritsFrom",
            serverType:"hibernate"
        })
    ,
        fields:[
        ],
        ID:"device",
        serverType:"hibernate"
    })
    Dynamic Form
    Code:
    public class DetailGroupForm extends DynamicForm implements HasText{
    
    	public DetailGroupForm(){
    		this.setIsGroup(true);
    		this.setNumCols(12);
    		this.setWidth100();
    		this.setWrapItemTitles(false);
    		this.setCanEdit(false);
    		this.setStyleName("detail-group-form");
    	}
    
    	@Override
    	public String getText() {
    		return this.getGroupTitle();
    	}
    
    	@Override
    	public void setText(String text) {
    		this.setGroupTitle(text);
    		
    	}
    	
    }
    Attached Files

    #2
    Your code doesn't do anything (no setDataSource() call). Please don't post code you haven't actually tried.

    The problem is your DataSource definition has the canEdit attribute as the String "false" instead of the boolean value of just: false.

    If this came from the DataSourceLoader servlet it could be caused by bad, stale or missing isomorphic/system/schema files, specifically your DataSourceField.ds.xml should have a declaration of canEdit as a boolean field.

    Comment


      #3
      It is indeed coming from the DataSourceLoader, so stale isomorphic files makes sense. I will copy in the latest files and see if that corrects the problem.

      I just submitted the relevant parts (obviously enough of it for you to lead me to the solution), of course I tried it, or I wouldn't have had a screen shot. It would be nice not to be accused of something when trying to get help as a paying customer.

      I understand you have to deal with people all day long, but a little friendliness goes a long way in customer service.

      Comment


        #4
        This account is not marked as a customer account - perhaps you have another.

        Regardless, we're not sure what's wrong with "Please don't post code you haven't actually tried" - it even starts with "please"??

        Of course you had tried some other code in order to arrive at those screenshots, but what you posted, you hadn't tried *on its own*. In this case it turned out that all that was necessary was to add a setDataSource() call, but more generally, when a bit of code from a larger app is posted as though it were the only code involved, that can create a wild goose chase, and frequently does.

        Comment

        Working...
        X