Buttons Stay Grey When Enabled

I have a form that loads in a disabled state. The buttons are greyed out.

If I call:

ScreenerEditForm.disabled = false;

The buttons stay greyed out until they are moused over.

Then, if the form is disabled again, the buttons do not get greyed out (but are non-clickable).

I have tried using the property of disabled=true for the form object. I have tried setting it to false and then after it loads, setting the disabled to true.

Any clue why this would be?

Form:

isc.DynamicForm.create({
                                ID:"ScreenerEditForm",
                                useAllDataSourceFields:false,
                                dataSource: "ScreenersDS",
                                width:"100%",
                                height: 300,
                                numCols:5,
                                margin:5,
                                overflow: "auto",
                                cellPadding:3,
                                autoFocus:false,
                                enableButtons: function(enabled){
                                },
                                editRecord : function () {
                                    var returnValue = this.Super("editRecord", arguments);
                                    ScreenerEditForm.getField("ScreenerAssignShowsbtn").disabled = false;
                                    return returnValue;
                                },
                                editNewRecord : function () {
                                    var returnValue = this.Super("editNewRecord", arguments);
                                    ScreenerEditForm.getField("ScreenerAssignShowsbtn").disabled = true;
                                    return returnValue;
                                },
                                 editNew : function () {
                                    var returnValue = this.Super("editNew", arguments);
                                    ScreenerEditForm.getField("ScreenerAssignShowsbtn").disabled = true;
                                    return returnValue;
                                },
                                fields: [
                                    { name : "screenerid", title:"ID", canEdit: false, hidden: false },
                                    { name : "pathname", title:"Filename", canEdit: false},
                                    { name : "url", title:"URL", width: 625, height: 20, colSpan: 4, required: true, type: "text", length: 300 },
                                    { name : "title", title:"Internal Name", width: 300, type: "text"},
                                    { name : "active", title: "Status", width: 150, defaultValue: 0, valueMap: { 1:"Active" , 0:"Inactive", 2:"Archive" }},
                                    { name : "description", title:"Description", width: 300, type: "textarea", rowSpan: 3, required: true },
                                    { name : "permissionlevel", title:"Access Level", defaultValue: 60005,  valueMap: { 60001:"1 - Screeners",  60002:"2 - Aired Shows",  60003:"3 - Pilots",  60004:"4 - Restricted Pilots",  60005:"5 - Staff Only" }},
                                    { name : "episodenumber", title:"Episode"},
                                    { name : "runningtime", title:"Running Time"},
                                    { name : "note", title:"Notes", rowSpan: 2, height: 44, width: 300, type: "textarea"},
                                    { name : "language", title:"Language"},
                                    { name : "source", title:"Source", endRow:true},
                                    {name:"saveScreenerbtn", editorType:"button", align:"center", 
                                        width:75, title:"Save", click:"ScreenerEditForm.saveData()", startRow:true, endRow:false},
                                    {name:"ScreenerAssignShowsbtn", editorType:"button", align:"center", 
                                        width:150, title:"Assign Show", click:"AssignSceenerToShow()", startRow:false, endRow:false},
                                    {name:"ScreenerPreviewbtn", editorType:"button", align:"center", 
                                        width:75, title:"Preview", click:"MovePlayerPreview()", startRow:false, endRow:false}
                                ],
                                clearDetails : function () {
                                    screenerIdByScreener = 0;
                                    ScreenerEditForm.editNew();
                                    ScreenerXShowByScreenerList.fetchData({ ts : isc.timeStamp(), screenerid: 0 });
                                    }
                                })

You should be calling setDisabled() at both the DynamicForm and FormItem level. In general, if a property has a setter, you must call it to change the property.

aaah! Thanks

Hello,
I have exactly the same problem but with checkboxes, what do you mean by calling setDisabled at the DynamicForm level?

I use:

myDynamicForm.getItem('chkRegister').setDisabled(true);

I think this is calling it at the FormItem level?
I also tried to disable the whole form

myDynamicForm.setDisabled(true);

Is that what you mean by : at the DynamicForm level?

Using either way or a combination of both doesn’t solve the problem

I’m using SmartClient 6.5

  1. On the same subject, i think there is a bug with disabled textboxes in IE, I get an invalid image in the display. Checking with Fiddler, i see that SmartClient uses the ‘standard’ skin blank image whatever the skin is used
/myApp/isomorphic/toolkit/skins/standard/images/blank.gif

I noticed it since I have not copied the ‘standard’ skin in my application
Maybe there is a way to correct that?
Other, of course, than copying the file in my application directory.

Thank you

Hi gli,

The previous poster was directly assigning to the disabled property, which does nothing. If you want the whole form disabled, call dynamicForm.setDisabled(), if you want an individual item disabled, call formItem.setDisabled(). Note that although the item becomes inactive immediately, you’ll have to markForRedraw() in order to see the visual change.

On the standard skin / blank.gif issue: what skin are you seeing this in, and have you made any customizations? If you don’t want to dig into this, you could copy just the skin/standard/images/blank.gif file to avoid the 404.

hi,

thanks for the markForRedraw(), it solved me other similar cases as well!

As for the blank.gif, it does the same thing for the SmartClient and TreeFrog skins, and I haven’t done any customizations, just copied these skin directories to my application. I had already copied the file, I just wanted to point out the problem.

Thanks

Hi Gli
We’re not seeing the request for the standard skin blank image in our tests, but it would be interesting to get to the bottom of where this is coming from.

  • Which version of SmartClient are you using? (You can get the full version info by looking at isc.version in the developer console)
  • If you copy and paste the code below into a new HTML file and save it into your env (changing the paths to the isomorphic library files as required) do you see the problem? If not there is likely something more than rendering out disabled text items, and we may need to see some more code (at least the source for your form and an idea of what else is on the page) to get to the bottom of this.
<HTML>
<HEAD>
 <SCRIPT>window.isomorphicDir='/isomorphic/';</SCRIPT>
 <SCRIPT SRC=/isomorphic/system/development/ISC_Core.js></SCRIPT>
 <SCRIPT SRC=/isomorphic/system/development/ISC_Foundation.js></SCRIPT>
 <SCRIPT SRC=/isomorphic/system/development/ISC_Containers.js></SCRIPT>
 <SCRIPT SRC=/isomorphic/system/development/ISC_Grids.js></SCRIPT>
 <SCRIPT SRC=/isomorphic/system/development/ISC_Forms.js></SCRIPT>
 <SCRIPT SRC=/isomorphic/system/development/ISC_DataBinding.js></SCRIPT>
 <SCRIPT src=/isomorphic/skins/SmartClient/load_skin.js></SCRIPT>
</HEAD>
<BODY>
<SCRIPT>
isc.DynamicForm.create({
    ID:"testForm", backgroundColor:"orange"
    items:[
        {name:"foo", defaultValue:"100"},
        {name:"moo", defaultValue:"200", disabled:true}
    ]
});
 
isc.DynamicForm.create({
    disabled:true,
    ID:"testForm2", top:300, backgroundColor:"gold",
    items:[
        {name:"foo", defaultValue:"1000"}
    ]
});
</SCRIPT>
</BODY>
</HTML>

Thanks
Isomorphic Software

  1. Version 6.5

  2. I tried your example but i didn’t see the problem.
    It is in a tab and it’s in a normal dynamic form that I see the problem.
    Sorry but I don’t have time right now to look more into it or send you code.

Hi Gli,

Just a further thought - you could create this problem if you either created components or called certain methods, such as isc.Canvas.imgHTML(), before load_skin.js was loaded for the skin you are trying to use.