This content has been marked as final.
Show 4 replies
-
1. Re: How to build rich:HtmlSuggestionBox dynamically
mores Oct 25, 2007 5:38 PM (in response to mores)This is now working !
org.apache.myfaces.component.html.ext.HtmlInputText searchBox = new org.apache.myfaces.component.html.ext.HtmlInputText(); searchBox.setId( "inputQuery" ); bar.getChildren().add( searchBox ); org.richfaces.component.html.HtmlSuggestionBox suggestions = new org.richfaces.component.html.HtmlSuggestionBox(); suggestions.setId( "sugg" ); suggestions.setFor( "inputQuery" ); suggestions.setTokens( ",[" ); suggestions.setRules( "none" ); javax.faces.el.MethodBinding mb = app.createMethodBinding( "#{suggestionBox.autocomplete}", new Class[] { Object.class } ); suggestions.setSuggestionAction( mb ); suggestions.setVar( "result" ); suggestions.setRows( 0 ); suggestions.setFirst( 0 ); suggestions.setMinChars( "#{suggestionBox.minchars}" ); suggestions.setShadowOpacity( "4" ); suggestions.setBorder( "1" ); suggestions.setWidth( "200" ); suggestions.setHeight( "150" ); suggestions.setShadowDepth( "4" ); suggestions.setCellpadding( "2" ); org.apache.myfaces.custom.column.HtmlSimpleColumn column = new org.apache.myfaces.custom.column.HtmlSimpleColumn(); column.setId( "col1" ); org.apache.myfaces.component.html.ext.HtmlOutputText text = new org.apache.myfaces.component.html.ext.HtmlOutputText(); text.setId( "text1" ); javax.faces.el.ValueBinding vb = app.createValueBinding( "#{result.text}" ); text.setValueBinding( "value", vb ); column.getChildren().add( text ); suggestions.getChildren().add( column ); bar.getChildren().add( suggestions );
-
2. Re: How to build rich:HtmlSuggestionBox dynamically
sergeysmirnov Oct 25, 2007 5:41 PM (in response to mores)It looks like you was really close :-)
P.S. I will add this code to the cookbook -
3. Re: How to build rich:HtmlSuggestionBox dynamically
pmariappan Apr 1, 2008 1:13 AM (in response to mores)Can you post entire source code for this componet?
-
4. Re: How to build rich:HtmlSuggestionBox dynamically
dreuzel Aug 19, 2008 6:12 AM (in response to mores)code is old and uses obsolete createMethodBinding
Does someone has improved code