select-box with concatenate listValue ?

81 views
Skip to first unread message

skydiablo

unread,
Apr 4, 2011, 8:43:31 AM4/4/11
to struts2-jquery
hiho...

i have a fine working js:select. now i want to concatenate some values
for the listValue. i have this two attributes:

- name
- cartag

now i want it concatenate to: "name + ' - ' + cartag" but it dosnt
work ? it just printed out "undefined" ?

some tips ?

greez & thx !

skydiablo

unread,
Apr 6, 2011, 4:59:02 AM4/6/11
to struts2-jquery
okay, this problem is still without an answer but i have a additional
challenge. i need a sub value from the json-object, like:

liste
- localitys
-- name

so i have to do like > listValue="locality.name". so i get allways the
output "undefined"... how can i fix it or some work-arounds ?

greez & thx,
sky...

jogep

unread,
Apr 6, 2011, 6:49:09 AM4/6/11
to struts2-jquery
You can create a getter inside of your Java Object.

public String getConcatValue(){
getValue1()+" - "+getValue2();
}


<sj:select ... listValue="concatValue" />

Johannes
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep
> > greez & thx !- Hide quoted text -
>
> - Show quoted text -

skydiablo

unread,
Apr 7, 2011, 8:43:09 AM4/7/11
to struts2-jquery
for any list item ?

sky...

jogep

unread,
Apr 7, 2011, 9:36:56 AM4/7/11
to struts2-jquery
for all items you like to concat.
> > > - Show quoted text -- Hide quoted text -

skydiablo

unread,
Apr 8, 2011, 4:50:32 AM4/8/11
to struts2-jquery
ahhh... i see... okay, but no way it is to managed @ client side ?

sky
Reply all
Reply to author
Forward
0 new messages