| 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!
|
 |
 |
|
|
subject: managing select tags in struts-2...
|
|
|