struts2, the drop-down list box, the initial value problem ...... [set value property still did not come out, how is it? ]

Category: Web Develop
 
qbread
2010-01-16 05:08:47

Sponsored Links
I was doing a modification function, the process is to first identify the appropriate record, and then passed through the url value displays these values ​​to go to the next page, the main code below
<s: url id = " modify "value ="% {# request.contextPath} / budgetdetail / modify.jsp ">
<s: param name =" id "value =" % {id} "> </ s: param>
<s:param name="budgetName" value="%{budgetName}"> < ;/ s: param>
<s:param name="incomedate" value="%{formatDate}"> </ s: param>
<s:param name="budgetInfo" value="%{budgetId}"> </ s: param>
</ s: url>
<s:a href="%{modify}"> modify </ s: a>

modify.jsp receiving code:
income Name: <s:textfield name="budgetdetailname" required="true" value="%{#parameters.budgetName}" />
Income Time: <s: datetimepicker name = "incomedate" toggleType = "explode" displayFormat = "yyyy-MM-dd" value = "% {# parameters.incomedate} "/>
<s:bean id="ds" name="commonUtil.tool.DwrCommon" />
payments Type: <s: select list = "# ds.budgetInfoIncome" required = "true" name = "budgetInfo" value = "% {# parameters.budgetInfo}" />
<s: hidden theme = "simple" name = "id" value = "% {# parameters.id}" > </ s: hidden>

The question now is in addition to the drop-down box "type payments" can not display the value passed url, the other can get, google said specified value = " ;% {# parameters.budgetInfo} "can, however, simply
ah, another note: budgetInfoIncome is the map type, please help, thank you

Sponsored Links

s403846459
2010-01-16 05:15:05
I probably estimated In your case the
budgetInfoIncome the key is not of type Integer? If yes, then this can solve your problem:
value = "@ java.lang.Integer @ parseInt (# parameters.budgetInfo)"

this is to use the tags of helpless
sgh6120
2010-01-16 05:33:30
..........
yihua0001
2010-01-16 05:43:27
payments types: <s: select list = "# ds.budgetInfoIncome" required = "true" ; name = "budgetInfo" value = "% {# parameters.budgetInfo}" />

payments to
Type: < ; s: select list = "# ds.budgetInfoIncome" required = "true" name = "budgetInfo"
listKey = "key" listValue = " value "/>
try
meilidejiemao
2010-01-16 05:58:03
zl_bright, tried, not ah ......
custchz
2010-01-16 06:10:12

this is ruled under study
a117332513
2010-01-16 06:20:12
value = "# parameters.budgetInfo" enough, not% {}
In addition, this value corresponds with the map's key
feng1026
2010-01-16 06:28:24
<s: select list = "# ds.budgetInfoIncome" required = "true" name = "budgetInfo" value = "% {# parameters.budgetInfo}" />

changed:

<s: select list = "# ds.budgetInfoIncome" required = "true" name = "budgetInfo" ; value = "% # parameters.budgetInfo" />

value corresponds with the map's key, to form a bond with the values ​​of the corresponding relationship ..
zqp0521
2010-01-16 06:38:17
dada52020 ; tried not, I get to do a test page worth, <s: hidden theme = "simple" name = "ids" value = "% {# parameters.budgetInfo}" ;> </ s: hidden>
this value by viewing the page source, the value is there are 56, and then directly write
<s: select list = " # ds.budgetInfoIncome "required =" true "name =" budgetInfo "value =" 56 "/>, can indeed be the default choice, but how a combination of
to die, one afternoon, and did not check the results online, depressed ing ......
bonnie1682009
2010-01-16 06:55:03
realcbb, you said I have tried, nor ......
Net_jianjun
2010-01-16 07:00:36
expenditure type: Try to change the following form:

<s: select list = "# ds.budgetInfoIncome" required = "true" name = "budgetInfo" />

result screen you can use the javascript alert () what budgetInfo value:

1>. If budgetInfo have a value that is <s:select /> label wording problems.

2>. budgetInfo no value if there is a problem is the transfer process. For example: budgetInfo variables get / set methods exists.
jasper_perfect
2010-01-16 07:16:04
redlotus_lyn, I added the results page the following statement, the result could see the value is there, alas, I do not know what place should also be changed ......
<s: hidden ; theme = "simple" name = "ids" value = "% {# parameters.budgetInfo}"> </ s: hidden>
huangguanfu1437
2010-01-16 07:34:54
Comrades help Mangsha
profilecm2
2010-01-16 07:37:00
to give you a reference ...
<s: select name = "appTravelPR.branchCode" key = "branchCode"
labelposition = "left" list = "# session.appBranchVOs"
listKey = "branchCode" listValue = "branchCode + '' + branchDescription"
value = "appTravelPR.branchCode"> </ s: select>
llh07
2010-01-16 07:54:35
This only look struts2 documents. Usually there are examples.
help you find friends find documents


<s:select
  label="FooBar" name="foo"
  list="#{'username':'trillian',
    'username':'zaphod'}" />


A static Map, as in put (" username "," trillian ").
cai07041401
2010-01-16 08:08:28
realcbb, alas, no wonder level is kulak ah! ! ! ! Thank you, comrade! Access points!
linghtsunny
2010-01-16 08:13:01
learn
shivshan
2010-01-16 08:29:22
111111111111111111111111111111111111111111
cjpook
2010-01-16 08:40:45
Khan. . . Why do not I see the answer
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.