Say the iterator to clear is defined in the pageDef as:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iterator id="City1Iterator" RangeSize="-1" | |
Binds="City1" Refresh="always" | |
DataControl="AppModuleDataControl"/> |
Then the code in the backing bean would look like:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javax.faces.context.FacesContext ctx = javax.faces.context.FacesContext.getCurrentInstance(); | |
javax.faces.el.ValueBinding bind = ctx.getApplication().createValueBinding("#{data}"); | |
oracle.adf.model.BindingContext bindingContext = (oracle.adf.model.BindingContext) bind.getValue(ctx); //resolve binding context | |
oracle.adf.model.binding.DCDataControl dataControl = bindingContext.findDataControl("AppModuleDataControl");//find data control by name (defined in DataBindings.cpx) from BindingContext | |
/* | |
* finally get the View Object instance which the iterator is bound to (see the attribute Binds in the iterator definition in the pageDef) | |
* then invoke the magic method executeEmptyRowSet on it | |
*/ | |
((AppModuleImpl) dataControl.getDataProvider()).getCity1().executeEmptyRowSet(); |
That’s it. Hope this helps!
No comments:
Post a Comment