You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joe Latty <jo...@tias.com.au> on 2004/04/23 02:03:06 UTC
Removing a selectionList
I am using the on-value-changed event for a field to do some validation
. If the value has a direct code match I leave the value if, however,
there is more than one match I return a selectionlist and have the user
choose from the list.
This is all working well, however, when the user selects the correct
value I no longer want the selectionlist. Is there a way to remove the
selectionlist.
Scenario:
<wd:on-value-change>
<javascript>
// Use a component to find suppliers
if (suppliersLength == 1) {
event.source.value =
element.getFirstChild().getAttribute("code");
// And remove any selection list that may have been set
previously
} else if (suppliersLength > 1) {
supplier = new Array(supplierLength);
// Fill array
event.source.setSelectionList(supplier, "value", "label");
} else {
// Serve up an error
}
</javascript>
</wd:on-value-changed>
Thanks
Joe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Removing a selectionList
Posted by Joerg Heinicke <jo...@gmx.de>.
On 23.04.2004 02:03, Joe Latty wrote:
> I am using the on-value-changed event for a field to do some validation
> . If the value has a direct code match I leave the value if, however,
> there is more than one match I return a selectionlist and have the user
> choose from the list.
>
> This is all working well, however, when the user selects the correct
> value I no longer want the selectionlist. Is there a way to remove the
> selectionlist.
> event.source.setSelectionList(supplier, "value", "label");
setSelectionList(null) might work as temporary workaround.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Removing a selectionList
Posted by Marc Portier <mp...@outerthought.org>.
Joe,
this is a clear feature-request (and a very sensible one)
pls add it to bugzilla
-marc=
Joe Latty wrote:
> I am using the on-value-changed event for a field to do some validation
> . If the value has a direct code match I leave the value if, however,
> there is more than one match I return a selectionlist and have the user
> choose from the list.
>
> This is all working well, however, when the user selects the correct
> value I no longer want the selectionlist. Is there a way to remove the
> selectionlist.
>
> Scenario:
> <wd:on-value-change>
> <javascript>
> // Use a component to find suppliers
> if (suppliersLength == 1) {
> event.source.value =
> element.getFirstChild().getAttribute("code");
> // And remove any selection list that may have been set
> previously
> } else if (suppliersLength > 1) {
> supplier = new Array(supplierLength); //
> Fill array
> event.source.setSelectionList(supplier, "value", "label");
> } else {
> // Serve up an error
> }
> </javascript>
> </wd:on-value-changed>
>
> Thanks
> Joe
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
--
Marc Portier http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/mpo/
mpo@outerthought.org mpo@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org