PDA

View Full Version : How-To : _doClick $Refresh



becomcs
21 Jun 2007, 11:27 AM
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
21 Jun 2007, 11:54 AM
combo.store.reload();

becomcs
21 Jun 2007, 11:40 PM
This is not sens to reload only the combo datasource?

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

RWaters
22 Jun 2007, 10:21 AM
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
24 Jun 2007, 2:09 PM
The issue is refresh recalc all hide formulas and refresh all computed values....

becomcs
24 Jun 2007, 11:55 PM
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
25 Jun 2007, 7: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}