You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Wechselberg, Jan Niklaas" <Ja...@hdi.de> on 2003/04/16 11:55:20 UTC

"Extensible" combobox in struts?

Hello,

I need the functionality of an "Access-like" combobox which supports some basic <html:option> elements, but is extensible. So, if the user does not find the entry he needs, he can just type it in.

-- cut here --

<html:select property="job" styleClass="Pulldown" tabindex="1">
	<html:options collection="jobs" property="job"/>
</html:select>

-- cut here --

This coding only allows to select one of the pre-defined entries..

Any idea how to extend this?


	Thanks in advance,


     Jan Niklaas Wechselberg
_______________________________________________
HDI V.a.G.
Informationsverarbeitung / Anwendungsentwicklung
Podbielskistraße 396
30659 Hannover
Tel.: +49 (511) 645 3451
Fax.: +49 (511) 645 4400
E-Mail: jan-niklaas.wechselberg(at)hdi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: "Extensible" combobox in struts?

Posted by Nicolas De Loof <ni...@cgey.com>.
This sort of widget doesn't exist on HTML forms. You should add a text input to your page, and a "new" option.

Using javascript you can set this option on "onchange" event from text input and reset text if value selected in select
list differs from "new".

Nico.


Hello,

I need the functionality of an "Access-like" combobox which supports some basic <html:option> elements, but is
extensible. So, if the user does not find the entry he needs, he can just type it in.

-- cut here --

<html:select property="job" styleClass="Pulldown" tabindex="1">
<html:options collection="jobs" property="job"/>
</html:select>

-- cut here --

This coding only allows to select one of the pre-defined entries..

Any idea how to extend this?


Thanks in advance,


     Jan Niklaas Wechselberg
_______________________________________________
HDI V.a.G.
Informationsverarbeitung / Anwendungsentwicklung
Podbielskistraße 396
30659 Hannover
Tel.: +49 (511) 645 3451
Fax.: +49 (511) 645 4400
E-Mail: jan-niklaas.wechselberg(at)hdi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: "Extensible" combobox in struts?

Posted by Alexandre Jaquet <al...@freesurf.ch>.
Hi you can have a page where the user can select existing option
and add a link to a page where the user can add a new option
item.

You got an ActionForm where you have a getOptions () and you
can make an helper call to populate a Collection of options.

Collection getOptions () {

options = helperGetOption.getOptions )
return options
}

--
Alexandre Jaquet
Lead Engineer
Noumenaut Software
http://dev.noumenaut.com/


----- Original Message -----
From: "Wechselberg, Jan Niklaas" <Ja...@hdi.de>
To: "Struts Users Mailing List (E-Mail)" <st...@jakarta.apache.org>
Sent: Wednesday, April 16, 2003 11:55 AM
Subject: "Extensible" combobox in struts?


Hello,

I need the functionality of an "Access-like" combobox which supports some
basic <html:option> elements, but is extensible. So, if the user does not
find the entry he needs, he can just type it in.

-- cut here --

<html:select property="job" styleClass="Pulldown" tabindex="1">
<html:options collection="jobs" property="job"/>
</html:select>

-- cut here --

This coding only allows to select one of the pre-defined entries..

Any idea how to extend this?


Thanks in advance,


     Jan Niklaas Wechselberg
_______________________________________________
HDI V.a.G.
Informationsverarbeitung / Anwendungsentwicklung
Podbielskistraße 396
30659 Hannover
Tel.: +49 (511) 645 3451
Fax.: +49 (511) 645 4400
E-Mail: jan-niklaas.wechselberg(at)hdi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Validate() method returns blank form

Posted by Richard Mixon <rn...@custco.biz>.
For some reason a validate that returns a non-empty ActionErrors object is
not re-displaying the form with the errors.

We have a simple validate method in our actionform. When the validate finds
an error it returns the ActionErrors object with 1 ActionError (debug
statements show that) just fine.

When we set log4j to trace Struts it seems to say the "failed" validation is
working and we should see the original form displayed with the errors:

  11:26:06,712 DEBUG ClassGridForm:297 - adding error
org.apache.struts.action.ActionError@19bc716
  11:26:06,712 DEBUG ClassGridForm:354 - return with errors 1
  11:26:06,712 DEBUG RequestProcessor:967 -  Validation sailed, returning to
'/WEB-INF/pages/classGrid.jsp'
  11:26:06,712 DEBUG ActionFilter:211 - Return from chain.doFilter(request,
response).

Thanks in advance for any suggestions or ideas.

 - Richard

PS: Here is the action mapping:

    <action path="/operations/classGridAction"
      type="com.ltoj.webapp.action.ClassGridAction"
      name="classGridForm"
      scope="session"
      input="/WEB-INF/pages/classGrid.jsp"
      parameter="method"
      unknown="false"
      validate="true">
      <forward name="success"
        path="/WEB-INF/pages/classGrid.jsp"
        redirect="false"/>
      <forward name="error"
        path="/WEB-INF/pages/classGrid.jsp"
        redirect="false"/>
    </action>




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: "Extensible" combobox in struts?

Posted by Thomas Cornet <th...@cornet.name>.

   Html langugage does not allow users to type in the combo-boxes (to add 
an item or to reduce the list by typing the first letters). Struts is 
rendering pure HTML so Struts can't render what you need.

   Only solution I can think of is an HTML input, with DHTML and layers. If 
the field has the focus, a layer is displayed (its content can be generated 
by an action), if the user types some letters, the layer is refreshed to 
reduce the list and if the user leaves the field with a content not present 
in the list, argument(s) are passed to the next action via hidden fields to 
add it to the list for the next users. So I think you'd better search in 
websites about DHTML and JavaScript...

                           Thomas


At 11:55 16/04/2003, you wrote:
>Hello,
>
>I need the functionality of an "Access-like" combobox which supports some 
>basic <html:option> elements, but is extensible. So, if the user does not 
>find the entry he needs, he can just type it in.
>
>-- cut here --
>
>-- cut here -- This coding only allows to select one of the pre-defined 
>entries.. Any idea how to extend this? Thanks in advance, Jan Niklaas 
>Wechselberg _______________________________________________ HDI V.a.G. 
>Informationsverarbeitung / Anwendungsentwicklung Podbielskistraße 396 
>30659 Hannover Tel.: +49 (511) 645 3451 Fax.: +49 (511) 645 4400 E-Mail: 
>jan-niklaas.wechselberg(at)hdi.de 
>--------------------------------------------------------------------- To 
>unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For 
>additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org