This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Struts and the fly likes managing select tags in struts-2... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "managing select tags in struts-2..." Watch "managing select tags in struts-2..." New topic
Author

managing select tags in struts-2...

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I have 2 select tags one below the other in my UI.

In the first select ,I have objects called 'concepts' which are like c1,c2,c3...

and each concept has a set of attributes like a1,a2,a3... concept and attribute are two beans!

Ex: if c1 has attributes a1,a2,a3 and you say concept.getAttributeList() one would get all the attributes for that concept...

Initially the concept-select is enabled and attribute-select is disabled!

I am populating concepts using s:iterator...

So,when a user selects a concept,the concept-select is disabled and attribute-select should be enabled with the attributes of that concept populated in the select tag!

Now,when i select a concept,how to get and populate attribute values?

I need to communicate with action class,isn't it? (I feel Ajax is not recommended to send the selected value to action class and set then back )

what should be the right approach?? By the way,I am using (html select+s:iterator)

Arun Ak
Greenhorn

Joined: Jun 21, 2009
Posts: 21

<s:select list="listofconcept"
listKey="xx"
listValue="yy"
name="conceptId"
onchange="onChange()"
key="gb.admin.document.manager.permission.documentrepositorylabel"
labelposition="top"
/>
<s:select list="attributeList"
listKey="attId"
listValue="attName"
name="attribute"
onchange="onChange()"
key="gb.admin.document.manager.documentgroup.label"
labelposition="top"
/>

<script>
function onChange(){
document.myform.submit();
}
</script>

on selecting the concept submit the form and get attribute of concept and create attribute select.

Regards,
Arun
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
on selecting the concept submit the form and get attribute of concept and create attribute select.


I didn't get this... can you please elaborate ,if possible in coding terms?

yes I submit the form but I want clarity in flow.i don't want to adjust the functionality and do something there!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: managing select tags in struts-2...