Hello,
I have searched through the forums and attempted to get all of the relevant details around using the getGroupValue() function, but I am still missing something. I have the name parameter, id parameter, have added and removed the group parameter for each button, but no matter what I do, I get an "on" return value from the getGroupValue() if a button is selected. Radio Button getGroupValue returns on [Archive] - Ext JS Forums:: [Archive] Radio Button getGroupValue returns on Ext: Help View Full Version : Radio Button getGroupValue returns on lonerzzz. 01-19-2008, 04:30 AM http://extjs.com/forum/archive/index.php/t-23598.htmlHOME |
Everything else works and diving into the code with firebug, the radiobutton value has been set to "on" overwriting any values I may have set. tmt.form:: Programmatically check radio buttons or checkboxes based on their values. Returns an array of submit button nodes contained inside a given node http://www.massimocorner.com/libraries/form/?N=DHOME | jsx3.gui.RadioButton Summary:: radio button, which is equivalent to the name property on a Use getGroupValue() instead. String. getValue() Returns the value of this radio button. http://www.tibco.com/devnet/resources/gi/3_6/api/html/jsx3/gui/RadioButton.htmlHOME |
I would appreciate any suggestions. Here is code.
Jason
searchPanel = new Ext.FormPanel({
labelWidth: 45,
frame:false,
bodyStyle:'padding:5px 5px 0',
width: 286,
items: [{
xtype:'textfield',
id: 'searchCriteria',
fieldLabel: 'Search',
width: 284,
minLength: 1
},
{
xtype:'fieldset',
title: 'Search In',
checkboxToggle: false,
autoHeight:true,
items: [{
layout:'column',
labelWidth: 0,
border:false,
items:[{
columnWidth:0.35,
layout: 'form',
labelSeparator: ' ',
border:false,
items: [{
xtype:'radio',
id: 'ts1',
boxLabel: 'Thread Title',
name: 'searchtype',
value: 'Thread Title',
checked : true
}]
},
{
columnWidth:0.46,
layout: 'form',
labelSeparator: ' ',
border:false,
items: [{
xtype:'radio',
id: 'ts2',
boxLabel: 'Message Contents',
name: 'searchtype',
value: 'Message Contents'
}]
},
{
columnWidth:0.19,
layout: 'form',
labelSeparator: ' ',
border:false,
items: [{
xtype:'radio',
id: 'ts3',
boxLabel: 'Both',
name: 'searchtype',
value: 'Both'
}]
}]
}]
},
{
layout:'column',
border:false,
items:[{
columnWidth:0.35,
layout: 'form',
labelWidth: 30,
border:false, scripting.com/frontier/source/OPML10.1a6src (Windows)/Common/:: hvalue) { /* return the value of the first radio button in the group thats on. { case grouptype: return (getgroupvalue (hobj, hvalue)); default: return http://www.scripting.com/frontier/source/OPML10.1a6src (ntime/Source/iowaparser.cHOME |
items: [{
xtype:'textfield',
id: 'userFilter',
fieldLabel: 'User',
width: 80
}]
},
{
columnWidth:0.65,
layout: 'form',
labelWidth: 60,
border:false,
items: [{
xtype:'combo',
id: 'channelFilter',
fieldLabel: ' Channel',
width: 152
}]
}]
}
],
buttons: [{
text: 'Search',
handler: function(){
var component = Ext.ComponentMgr.get('searchCriteria');
var searchCriteria;
if ((!component.validate())
((searchCriteria = component.getValue()) == ''))
{
component.markInvalid('');
return;
}
component = Ext.ComponentMgr.get('userFilter');
if (!component.validate())
{
component.markInvalid('');
return;
}
var userFilter = component.getValue();
var searchLocation = Ext.ComponentMgr.get('ts1').getGroupValue();
var channel = Ext.ComponentMgr.get('channelFilter').getValue();
Ext.Ajax.request( ....... );
searchWindow.hide();
}
},{
text: 'Cancel',
handler: function(){
searchWindow.hide();
}
}]
});
Thanks for that :). It worked like a charm.
For others who might hit the same problem and are looking through the forums, the bold content is the essential content. The working code is here:
searchPanel = new Ext.FormPanel({
labelWidth: 45,
frame:false,
bodyStyle:'padding:5px 5px 0',
width: 286,
items: [{
xtype:'textfield',
id: 'searchCriteria',
fieldLabel: 'Search',
width: 284,
minLength: 1
},
{
xtype:'fieldset',
title: 'Search In',
checkboxToggle: false,
autoHeight:true,
items: [{
layout:'column',
labelWidth: 0,
border:false,
items:[{
columnWidth:0.35,
layout: 'form',
labelSeparator: ' ',
border:false,
items: [{
xtype:'radio',
id: 'ts1',
boxLabel: 'Thread Title',
name: 'searchtype',
inputValue: 'Thread Title',
checked : true
}]
},
{
columnWidth:0.46,
layout: 'form',
labelSeparator: ' ',
border:false,
items: [{
xtype:'radio',
boxLabel: 'Message Contents',
name: 'searchtype',
inputValue: 'Message Contents'
}]
},
{
columnWidth:0.19,
layout: 'form',
labelSeparator: ' ',
border:false,
items: [{
xtype:'radio',
boxLabel: 'Both',
name: 'searchtype',
inputValue: 'Both'
}]
}]
}]
},
{
layout:'column',
border:false,
items:[{
columnWidth:0.35,
layout: 'form',
labelWidth: 30,
border:false,
items: [{
xtype:'textfield',
id: 'userFilter',
fieldLabel: 'User',
width: 80
}]
},
{
columnWidth:0.65,
layout: 'form',
labelWidth: 60,
border:false,
items: [{
xtype:'combo',
id: 'channelFilter',
fieldLabel: ' Channel',
width: 152
}]
}]
}
],
buttons: [{
text: 'Search',
handler: function(){
var component = Ext.ComponentMgr.get('searchCriteria');
var searchCriteria;
if ((!component.validate())
((searchCriteria = component.getValue()) == ''))
{
component.markInvalid('');
return;
}
component = Ext.ComponentMgr.get('userFilter');
if (!component.validate())
{
component.markInvalid('');
return;
}
var userFilter = component.getValue();
var searchLocation = Ext.ComponentMgr.get('ts1').getGroupValue();
var channel = Ext.ComponentMgr.get('channelFilter').getValue();
Ext.Ajax.request( ....... );
searchWindow.hide();
}
},{
text: 'Cancel',
handler: function(){
searchWindow.hide();
}
}]
});
You need to set the inputValue config option of the checkboxes.
I tried the
Ext.getCmp(id of one of the radio button).getGroupValue() to retrieve the radio button values.
I got the following error.
this.el.up("form") has no properties
The radio buttons are in tbar of a panel.
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|