Re: objectautocomplete with first item selected

2012-02-19 Thread northar
Ok, now i researched some some more:
What i wan't to do: Have an autocompletetextbox with custom layout in the
dropdown. 
The default autocomplete fills the first criteria, but then i would like to
modify the html-output
thats created in the dropdown. The default output is final though and
outputs an list list this.

ulli textvalue=abcabc/lili textvalue=abdabd/li/ul

and default renderer for autocompletetextfield, method renderer is final.

public abstract class AbstractAutoCompleteRendererT implements
IAutoCompleteRendererT
{
private static final long serialVersionUID = 1L;

public final void render(final T object, final Response response, final
String criteria)
{
String textValue = getTextValue(object);
if (textValue == null)
{
throw new IllegalStateException(
A call to textValue(Object) returned an 
illegal value: null for object:
 +
object.toString());
}
textValue = textValue.replaceAll(\\\, quot;);

response.write(li textvalue=\quot;quot; + textValue +
quot;\quot;quot;);
final CharSequence handler = 
getOnSelectJavaScriptExpression(object);
if (handler != null)
{
response.write(quot; onselect=\quot;quot; + handler 
+ 'quot;');
}
response.write(quot;);
renderChoice(object, response, criteria);
response.write(/li);
}

public final void renderHeader(final Response response)
{
response.write(ul);
}

public final void renderFooter(final Response response, int count)
{
response.write(/ul);
}


What i would like to do, kind of:
ul class=a
  liCoffee/li
  liTea/li
  liCoca Cola/li
/ul
p NEXT IN LINE /p
ul class=b
  liCoffee and some other values/li
  liTea and adfd/li
  liCoca Cola/li
/ul


Are there any easy obvious ways to do this, that i'm missing?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/objectautocomplete-with-first-item-selected-tp3031312p4401863.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: objectautocomplete with first item selected

2012-02-17 Thread northar
ObjectautocompleteObjectAutoCompleteTextField sounds like what i need. 

Which artifact is it in, and do i need to add any special repo? Been
searching the mvnrepos  but can't find it.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/objectautocomplete-with-first-item-selected-tp3031312p4398535.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



objectautocomplete with first item selected

2010-11-07 Thread Steve Swinsburg
Hi all,

Using the ObjectAutocompleteTextField from Wicketstuff on a form. When the user 
starts typing they are given a list of choices, and I would like the first item 
in that list to always be selected by default. They can obviously choose a 
different one but the issue is that presently, if they move away from that 
field, the input is lost. I would like the first one to be chosen in that case.

Has anyone does this already?

thanks,
Steve
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: objectautocomplete with first item selected

2010-11-07 Thread Steve Swinsburg
Ok this code allows a preselect:

builder.preselect();

But tabbing away clears the field. I would like the selected option to be 
filled into the text field.

thanks,
Steve



On 08/11/2010, at 10:14 AM, Steve Swinsburg wrote:

 Hi all,
 
 Using the ObjectAutocompleteTextField from Wicketstuff on a form. When the 
 user starts typing they are given a list of choices, and I would like the 
 first item in that list to always be selected by default. They can obviously 
 choose a different one but the issue is that presently, if they move away 
 from that field, the input is lost. I would like the first one to be chosen 
 in that case.
 
 Has anyone does this already?
 
 thanks,
 Steve