Обработчик ValueChangeListener:
public void changeAipsUser(ValueChangeEvent valueChangeEvent) { BindingContext bindingctx = BindingContext.getCurrent(); BindingContainer bindings = null; bindings = bindingctx.getCurrentBindingsEntry(); DCBindingContainer bindingsImpl = (DCBindingContainer) bindings; DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("LOVVO1Iterator"); Row temp = dciter.getRowAtRangeIndex((Integer.parseInt(valueChangeEvent.getNewValue().toString()))); String id = temp.getAttribute("Id").toString(); }
Перекрываем метод initBean:
@PostConstruct public void initBean() { Boolean p = false; p = (Boolean)JSFUtils.getFromSession("SomeName"); if (p == null || p == false) { p = false; } JSFUtils.putToSession("SomeName", Boolean.valueOf(true)); if (!p) { vo.executeEmptyRowSet(); //vo - элемент класса JS.javaScriptEvaluate("$(document).ready(function() {AdfPage.PAGE.findComponent(\"pt1:pc1:p1\").show();})"); // путь до элемента } }
Решение - во внедрении JavaScript-скрипта, эмулирующего нажатие на кнопку закрытия формы и приложенным листенером
fg
function closeQryId1() { jQuery(document.getElementById('pt1:pc1:qryId1::search')).click(function() {document.getElementById('pt1:pc1:pw1::close').click()}); }
Без принудительного обновления переменная в биндинге будет содержать старое значение связанного визуального компонента. Обновляем:
UIComponent component = event.getComponent(); component.processUpdates(FacesContext.getCurrentInstance());
AppModuleImpl mod = (AppModuleImpl)ADFUtils.getBindingApplicationModule();
MyVO vo = mod.getMyVO1();
ViewCriteria vc = null;
vc = vo.getViewCriteria("MyVOCriteria");
VariableValueManager vvm = vc.ensureVariableManager();
vvm.clearVariables();
for (Variable var : vvm.getVariables()) {
vvm.setVariableValue(var.getName(), null);
} GET-запрос из атрибутов VOpublic String getVOParamsAsURL {
String AMP = "&";
String EQ = "=";
String LOV_SIGN = "LOV";
String NULL_SIGN = "null";
MyVOImpl vo = am.getMyVO1();
MyVORowImpl row = (MyVORowImpl)vo.getCurrentRow();
StringBuffer URL = new StringBuffer();
URL.append("/myapp/get?");
for (int i = 0; i < row.getAttributeCount(); i++)
if (row.getAttributeNames()[i].indexOf(LOV_SIGN) == -1)
if (row.getAttributeValues()[i] != null)
if (row.getAttributeValues()[i].toString().indexOf(NULL_SIGN) == -1)
URL.append(AMP + row.getAttributeNames()[i] + EQ + row.getAttributeValues()[i]);
return URL.toString();
}