This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 s:div doubleselect problem ?

 
Rahul Nair
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the rendered HTML look like?
 
Rahul Nair
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Thanks for reply!
It is working now...
The problem is in a javascript function..... it did not get called on onchange event....so 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 selection....here i want to populate the manager select box according to department and so on ....so 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
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(Include.java:153)



So, can you please help me regarding the same ?

You reply is highly appreciated.

Thanks
Rahul
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic