You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Dieter Engelhardt <D-...@t-online.de> on 2002/11/09 22:45:45 UTC

Trigger action from Listbox

Hi there,
this question might be simple to you guys.

I have a screen where i provide a listbox to select a certain item where i
have to rebuild this screen after the item is selected.
My question is, what do i have to do in the onchage section of the select
tag.
Here is my velecity-macro:

#macro( Listbox $list $item $actiontemplate)
  #formLabel("Description")
  <td bgcolor="$ui.formLabelColor">
    <SELECT name="Name"
     onchange="javascript:location.replace($link.setPage($actiontemplate)">
    <option value="">$item</option>
    #foreach( $entry in $list )
       <option
value=$entry.getValue("lnd_id")>$entry.getValue("lnd_bezeichnung")</option>
    #end
    </select>
  </td>
#end

Thanks for your help!

Dieter


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Trigger action from Listbox

Posted by David Worms <da...@simpledesign.com>.
That should help. When the user select an item from the select box, he  
will  be redirect to the url present as a value in the select > option  
tag.

David

<script>
function MM_jumpMenu(targ,selObj,restore){
    
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
   if (restore) selObj.selectedIndex=0;
}
<script>

   <select name="select" onChange="MM_jumpMenu('parent',this,0)">

   #set ( $baseLink =  
$link.setAction('modules.ManageModule').addPathInfo('eventSubmit_doChang 
ecurrentmodule', '' ) )
   <option value="$baseLink.addPathInfo('moduleId', '-1')">select  
module</option>

   #foreach ($module in $data.user.modules)
     #set ( $baseLink =  
$link.setAction('modules.ManageModule').addPathInfo('eventSubmit_doChang 
ecurrentmodule', '' ) )
     #if ( $module == $data.user.currentModule )
       #set ( $selected = "selected" )
     #else
       #set ( $selected = "" )
     #end
     <option value="$baseLink.addPathInfo('moduleId',  
$!module.ModuleId)" $selected >$module.Name </option>
       #end
   #end

   </select>


On Saturday, November 9, 2002, at 01:45  PM, Dieter Engelhardt wrote:

> Hi there,
> this question might be simple to you guys.
>
> I have a screen where i provide a listbox to select a certain item  
> where i
> have to rebuild this screen after the item is selected.
> My question is, what do i have to do in the onchage section of the  
> select
> tag.
> Here is my velecity-macro:
>
> #macro( Listbox $list $item $actiontemplate)
>   #formLabel("Description")
>   <td bgcolor="$ui.formLabelColor">
>     <SELECT name="Name"
>       
> onchange="javascript:location.replace($link.setPage($actiontemplate)">
>     <option value="">$item</option>
>     #foreach( $entry in $list )
>        <option
> value=$entry.getValue("lnd_id")>$entry.getValue("lnd_bezeichnung")</ 
> option>
>     #end
>     </select>
>   </td>
> #end
>
> Thanks for your help!
>
> Dieter
>
>
> --
> To unsubscribe, e-mail:    
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:  
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>