Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes dynamic ajax behaviour Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dynamic ajax behaviour" Watch "dynamic ajax behaviour" New topic
Author

dynamic ajax behaviour

Jabi Vulla
Greenhorn

Joined: Jan 20, 2013
Posts: 7
Hai ..any body can help me please ... im creating primefaces components dynamically here the code is ...

ValueExpression valueExp1 = elFactory.createValueExpression(elContext, "#{transactionSearchBean.selectedDataType1}",Object.class);

ValueExpression valueExp3 = elFactory.createValueExpression(elContext, "#{transactionSearchBean.textBoxValue1}",String.class);

MethodExpression criteriaAjaxEventListener = elFactory.createMethodExpression(
context.getELContext(), "#{transactionSearchBean.fieldChangedForPanel1}", null, new Class[] { AjaxBehaviorEvent.class });

AjaxBehavior criteriaAjax = new AjaxBehavior();
criteriaAjax.setListener(criteriaAjaxEventListener);

UISelectItems selectItems1 = new UISelectItems();
selectItems1.setValue(modelFieldStaticDataFilterList);

SelectOneMenu criteriaMenu = new SelectOneMenu();
criteriaMenu.setId("criteriaID");
criteriaMenu.setStyle("width:145px");
criteriaMenu.setValueExpression("value",valueExp1);
criteriaMenu.getChildren().add(selectItems1);
criteriaMenu.getChildren().add(criteriaAjax);//66
panelGrid1.getChildren().add(criteriaMenu);


InputText inputText1 = new InputText();
inputText1.setId("textFieldID");
inputText1.setValueExpression("rendered", valueExp5);
inputText1.setValueExpression("value",valueExp3);
panelGrid1.getChildren().add(inputText1);

in combo box i added selectitem1 list see in the code, i want to display text box when selection of item in the combo box for that
i need add child ajax element to combo box , here the problem is i am not getting how ajax element add to combo box please any one tell
how i need to put ajax to combo box and how display text box when selecting combo box item..please any experts can explain Ajax behaviours in this scenario?

 
Don't get me started about those stupid light bulbs.
 
subject: dynamic ajax behaviour