• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Components made with basic HTML tags are not working correctly with Struts 2

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I am new to Struts and trying to make UI with Struts with Jquery. but didnot get success over it.
so I plan to remove jquery component and use basic HTML elements with Struts 2 to see whether it is working correctly or not... but surprisingly, it is my bad luck

Here is the details of my problem:
I have a combobox with label Geo Locations: which is suppose to be appear below Company Office dropdown, but it is not working as expected.
please find below code snippet and Image of my UI.




Here the output UI is:


Thanks in advance
Sharad
Struts2-issue.jpg
[Thumbnail for Struts2-issue.jpg]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is "as expected", and how does that differ from what is actually happening?
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heading - "Here is the component with basic HTML Tags. This should go below Company Office"
and
Combobox with label Geo Locations is EXPECTED to appear below Company Office dropdown,
but in ACTUAL both the components made with raw HTML tags are appearing on TOP. ie. before all UI components made with struts tag.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see. Probably because the Struts tags are doing their own thing. Why are you not using a Struts tag for that menu, like you're doing for the other input elements?
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ulf,
As mentioned in my initial thread, my aim is to use Juery DDCL plugin to create DropdownCheckboxList. but I was facing the issue.
so I thought to add some UI components using raw html tag and then I will write my jquery to do the needful.
But while adding UI component with raw HTML tag, I faced this issue and left with NO CLUE about why this is happening.

hope this clarifies my need.

thanks.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is probably not such a good idea -or a problematic ideas to say the least- to have some components rendered by Struts, and some by jQuery.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:It is probably not such a good idea -or a problematic ideas to say the least- to have some components rendered by Struts, and some by jQuery.



I think Sharad is using the Struts 2 jQuery Plugin, so he should be OK. The first thing you (Sharad) should do is look at the HTML source in the browser and see if you can see why the page is being rendered in that fashion. I suspect what is happening has something to do with this FAQ entry.
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Joe,
Thanks for directing me to the right link/location.
I View the html source in browser and as per the source.. UI is generated.
My learning is - All basic HTML elements are placed together and then all Struts specific elements are presented in <table> which is created dynamically by struts API internally.
to get rid of this - I myself created table inside <form> and put all Struts + HTML tags under different <td> and it works correctly.
In this scenario, as the <table> is already in place, struts is not adding any new <table> dynamically. So every thing is inplace correctly.

Now my work is to have DDCL plugin correctly inplace with my other UI components.

Thanks.
Below is the new UI with all elements ordered correctly
correct-UI.jpg
[Thumbnail for correct-UI.jpg]
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic