This content has been marked as final.
Show 2 replies
-
1. Re: How Can I Create HtmlAjaxCommandButton (JSF 1.2)
nbelaevski Mar 19, 2009 7:06 AM (in response to repkin)Hello,
Action method does not have any arguments.
Create and add this action listener: com.sun.faces.taglib.jsf_core.SetPropertyActionListenerImpl. Note: this would make your code incompatible with MyFaces! -
2. Re: How Can I Create HtmlAjaxCommandButton (JSF 1.2)
repkin Mar 19, 2009 8:51 AM (in response to repkin)Nbelaevski thanks so much, I solve the problem.
HtmlAjaxCommandButton deleteButton = new HtmlAjaxCommandButton(); deleteButton.setId("deleteButton"); deleteButton.setReRender("dataTable"); deleteButton.setOnclick("if(!confirm('"+WebUtils.getMessage("areYouSure")+"')){return false;}else{this.disabled=true;Richfaces.showModalPanel('busyPanel')}"); deleteButton.setOncomplete("this.disabled=false;Richfaces.hideModalPanel('busyPanel')"); deleteButton.setIgnoreDupResponses(true); deleteButton.setValue(WebUtils.getMessage("delete")); MethodExpression deleteMethodExpression = expressionFactory.createMethodExpression( elContext, "#{controller.delete}", String.class, new Class<?>[0] ); deleteButton.setActionExpression(deleteMethodExpression); ValueExpression target = expressionFactory.createValueExpression(elContext, "#{controller.selectedItem}", Long.class); ValueExpression propertyValue = expressionFactory.createValueExpression(elContext,"#{dataTableVar}", MyWrapper.class); SetPropertyActionListenerImpl listener = new SetPropertyActionListenerImpl(target,propertyValue); deleteButton.addActionListener(listener); editDelValueColumn.getChildren().add(deleteButton);