Iterator, set, if-else tags of Struts2(Getting the value of s:radio and applying if-else ) -


I have a jsp page in which I have two radio buttons and a selection tag. Now, if the first radio button is clicked, then I want to disable that selection tag but I failed to do this , I tried to use the "disabled" property under the following code JSP page

  & lt; Table row = "center" & gt; & Lt; S: Iterator value = "first object list" status = "writer type status" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; S: radio name = "radio_slectedValue" list = "{objectName}" list = "object key" value = "object name" value = "default object" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / S: iterator & gt; & Lt; S: If test = "% {# radio_SelectedValue == 'ObjectName1'}" & gt; & Lt; S: Set name = "hatch option disabled" value = "wrong" /> & Lt; / S: If & gt; & Lt; S: and & gt; & Lt; S: Set name = "isSelectDisabled" value = "True" /> & Lt; / S: and & gt; & Lt; Tr & gt; & Lt; Td colspan = "2" & gt; Select Parent Search Lab & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; S: Select name = "select_SelectedValue" headerKey = "DefaultObject" headerValue = "ParentObject" list = "ObjectList" list = "ObjectListKey" listValue = "ObjectListValue" disabled = "% {isSelectDiabled}" & gt; & Lt; S: Iterator value = "objectitist" & gt; & Lt; / S: iterator & gt; & Lt; / S: Select & gt; & Lt; S: Submit Value = "Continue" & gt; & Lt; / S: Presentation & gt; & Lt; / TD & gt; & Lt; / TR & gt;   

All recipients and setter methods are fixed .. Is this possible without javascript?

I'm a bit confused with your code block, but I think I understand what you target for are doing. Do something like this

  & lt; Tr & gt; & Lt; TD & gt; & Lt; S: radio name = "radio_slectedValue" list = "% {radioList}" list = "object key" list value = "object name" value = "default object" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; S: If test = "% {radio_electedValue.equals ('myChosenValueFromTheList')}" & gt; & Lt; S: Select Name = "select_SelectedValue" headerKey = "- 1" headerValue = "" list = "ObjectList" list = "ObjectList.Key" listValue = "ObjectList.Value" /> & Lt; / S: If & gt; Of & lt: and & gt; & Lt; S: Select name = "select_SelectedValue" headerKey = "- 1" headerValue = "" list = "ObjectList" list = "ObjectList.Key" listValue = "ObjectList.Value" disabled = "disabled" /> & lt; / S: and & gt;   

I'm not sure what you're doing with the televised with these tags, they handle inventory spread themselves. Simply tell the tag which list to use, and the stream will populate the tags appropriately, you can then condition it on the basis of the value of the raiders of the page and spell it on the selected tag as shown above.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -