PDA

View Full Version : How-To : _doClick $Refresh


becomcs
06-21-2007, 03:27 PM
I put a combobox with refresh in a form and I add the following code:

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

then the refresh option did'nt work.

When I look into the source code I found the following js :
onchange="_doClick('$Refresh', this, '_self', '#_RefreshKW_ACP');"

How do I launch the refresh event?

galdaka
06-21-2007, 03:54 PM
combo.store.reload();

becomcs
06-22-2007, 03:40 AM
This is not sens to reload only the combo datasource?

What I'm trying to do is to refresh the form...

RWaters
06-22-2007, 02:21 PM
This gets a little tricky. You could probably attach domino's _doClick function somewhere and I would expect it to still post back to the server and refresh the whole page. The downfall is that it will redraw the entire page which could really be a bummer if you have a ton of Ext layout and form elements. I would probably look to changing the ComboBox to use an actual data store/reader/proxy and have it pull from a view or agent that gets the values. This way you can refresh it's values from the server with a reload() call...

Forms is still the next large piece we're working on and there's certainly issues trying to make Domino play nicely.

becomcs
06-24-2007, 06:09 PM
The issue is refresh recalc all hide formulas and refresh all computed values....

becomcs
06-25-2007, 03:55 AM
I found!

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

ACP.on ( 'select', function()
{
_doClick('$Refresh', this, '_self', '#_RefreshKW_ACP');
}
);

However, there is another issue. If refresh hide some fields and js try to access to this fields, then error is generated.

Post open at :
How-To : Check if field is hidden (http://extjs.com/forum/showthread.php?t=8183)

galdaka
06-25-2007, 11:51 AM
I found!

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

ACP.on ( 'select', function()
{
_doClick('$Refresh', this, '_self', '#_RefreshKW_ACP');
}
);

However, there is another issue. If refresh hide some fields and js try to access to this fields, then error is generated.

Post open at :
How-To : Check if field is hidden (http://extjs.com/forum/showthread.php?t=8183)


The idea of EXT is not use "_doClick('$Refresh', this, '_self', '#_RefreshKW_ACP');" expressions. Use ajax calls for refresh the form elements.

So, various ways:

1) print a function in your form and use @IsDocBeinEdited for print or not the script

2) Use Ext.get(FieldName): if (Ext.get('field1')){your code}