PDA

View Full Version : s has no properties



captainm1uk
1 Nov 2007, 3:51 AM
Hi

I have a form which uses the following js to style and render the notes fields on the form



/*
* Ext JS Library 1.1.1
* Copyright(c) 2006-2007, Ext JS, LLC.
* licensing@extjs.com
*
* http://www.extjs.com/license
*/
Ext.onReady(function(){
Ext.get('mb1').on('click', function(e){
Ext.MessageBox.show({
title: 'Feedback',
msg: 'Please enter any relevant feedback:',
width:400,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: showResultText,
animEl: 'mb1'
});
});

var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var myDate = day + "/" + month + "/" + year
//var myName = document.forms.Name.value

function showResultText(btn, text){
if(btn=='ok'){
document.forms[0].DeptFeedback.value=document.forms[0].DeptFeedback.value+"Comments added by "+ " on "+ myDate +"\r"+text+"\r"+"\r"
}
};
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'qtip';

var department = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'Department',
width:120,
forceSelection:true
});
department.applyTo('Department')

var depteffected = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'DeptEffected',
forceSelection:true
});
depteffected.applyTo('DeptEffected')

var myName = new Ext.form.TextField({
vtype:'alpha',
allowBlank:false,
disableKeyFilter:true
});

myName.applyTo('fName');
var myPhone = new Ext.form.TextField({
allowBlank:false,
vtype:'alphanum'
});

myPhone.applyTo('phoneno');
var email = new Ext.form.TextField({
allowBlank:false,
vtype:'email'
});

email.applyTo('email');

var grow = new Ext.form.TextArea({
allowBlank:false,
width:600, grow:true
});
grow.applyTo('Comments');

var grow = new Ext.form.TextArea({
disabled: true,
//rendered: true,
width:600, grow:true
});
grow.applyTo('DeptFeedback');
});


If I open up the notes form in a browser it works fine. But if I open the form up from a uiview I get s has no properties (see attached) at line 22230
Can anyone tell me why this happens. The page then loads but all the fields are not there

RWaters
1 Nov 2007, 7:21 AM
Can you spin open that box and show the stack trace?

Not sure exactly where the error is coming from.

captainm1uk
1 Nov 2007, 7:36 AM
Hi

Here is a screen shot for you

Thanks

Zakaroonikov
1 Nov 2007, 12:36 PM
Hi

I have a form which uses the following js to style and render the notes fields on the form



...
var department = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'Department',
width:120,
forceSelection:true
});
department.applyTo('Department')
...


If I open up the notes form in a browser it works fine. But if I open the form up from a uiview I get s has no properties (see attached) at line 22230
Can anyone tell me why this happens. The page then loads but all the fields are not there

I don't think you need the second statement 'applyTo' if you specifiy Department as the transform config parameter. Also I would make sure your form has a select field called Department. I also tend to put in the ID the same as the name in the HTML properties tab on the field dialog.

captainm1uk
1 Nov 2007, 1:24 PM
Hi

I after posting this thread I remmed out the applyto and made sure that the html attrib of the field said Department but still the same error :(

I like the errors in js they are so descriptive !!!!

Why can't they say "nope sorry your missing .... "

Lotus notes does the same by saying "error no more info" on apps in the past - well doner IBM !!!!

This only happens if I open the page in the center panel of the db - if I open it in a new window it works fine - so it is maybe something in the grid panel that it doesn't like

captainm1uk
2 Nov 2007, 8:54 AM
Hi

Could this be something to do with the above fields being in read mode when the form opens ?

Thanks

RWaters
2 Nov 2007, 12:53 PM
You will not be able to use transform on any fields if the document is in read mode. There is no actual html field for it to transform.

captainm1uk
2 Nov 2007, 1:43 PM
How would I get round this then ?

RWaters
2 Nov 2007, 4:58 PM
pass through @isdocbeingedited to a javascript variable.

captainm1uk
5 Nov 2007, 4:41 AM
Hi

Thanks for that - as you and Zakaroonikov pointed out if I add a statement around the code above (isnewdoc etc) it worked fine

Many thanks