This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 s:div doubleselect problem ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 s:div doubleselect problem ?" Watch "Struts 2 s:div doubleselect problem ?" New topic

Struts 2 s:div doubleselect problem ?

Rahul Nair
Ranch Hand

Joined: Dec 01, 2007
Posts: 138

I want to implement doubleselect functionality using the struts s:div tag in my application.

On jsp page there is Department and Employee Select tag, when user selects department i want to populate the employee select tag with the employee in that Department.

The struts2 select tag for Department is as follows:

and the script function is follows:

when i hit the URL it will populate the Employee Select Box with Defalut values which we have assigned to Headerkey in Department Tag....

But it will never display me alert box ? Can you please tell me what is the problem in this code ?

David Newton

Joined: Sep 29, 2008
Posts: 12617

What does the rendered HTML look like?
Rahul Nair
Ranch Hand

Joined: Dec 01, 2007
Posts: 138

Thanks for reply!
It is working now...
The problem is in a javascript function..... it did not get called on onchange i put it in header then it works....

Anyways...i want some another solution for populate select boxes down in the hierarchy.... e.g. Suppose i have departments, managers for that department, supervisors working under that manager in that particular department... and under that super wiser i want to add Employee.....

Obviously...i want to show user the the 3 select Boxes for i want to populate the manager select box according to department and so on i use dojo plugin but it has much complex, deprecated and it will not populate downside box after selection.....

Now, i am using jquery plugin.....for that but it too gives me freemarker template error though i am not using the freemarket template ? i don't know what is wrong...

can you please help me for the clue or any other way to implement above functionality ?
Rahul Nair
Ranch Hand

Joined: Dec 01, 2007
Posts: 138
hi i am using jquery plugin to populate select box in downtree....

After running the application...the very first Department List is also empty... and FreeMarker Template error shows on the screen...
The error is as follows:

FreeMarker template error!

Error reading included file template/simple/css.ftl
The problematic instruction:
==> include "/${parameters.templateDir}/simple/css.ftl" [on line 40, column 1 in template/jquery/select.ftl]

Java backtrace for programmers:
freemarker.template.TemplateException: Error reading included file template/simple/css.ftl
at freemarker.core.Include.accept(

So, can you please help me regarding the same ?

You reply is highly appreciated.

I agree. Here's the link:
subject: Struts 2 s:div doubleselect problem ?
It's not a secret anymore!