You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by lxw_first <lx...@hotmail.com> on 2012/07/26 11:15:35 UTC
how to get dropdownlist selected value
http://apache-wicket.1842946.n4.nabble.com/file/n4650788/aaa.bmp
html:
<select wicket:id="attrvalue"></select>
code
final ListView trView=new ListView("tritems", new PropertyModel(this,
"attrBizRoles")) {
private IBizRole attrvalueBizRole=new BizRole();
@Override
protected void populateItem(ListItem item) {
attrBizRole = (IBizRole) item.getModelObject();
item.add(new Label("lblattr", attrBizRole.getName()));
// this list can get from attr
attrvalueBizRoles = (List<IBizRole>) attrBizRole.getChildBizRole();
if (attrvalueBizRoles.size()>0) {
attrvalueBizRole=attrvalueBizRoles.get(0);
}
DropDownChoice attrvalueChoice = new DropDownChoice("attrvalue",new
PropertyModel<IBizRole>(this, "attrvalueBizRole"), attrvalueBizRoles,new
IChoiceRenderer() {
@Override
public Object getDisplayValue(Object object) {
attrvalueBizRole = (IBizRole) object;
return attrvalueBizRole.getName();
}
@Override
public String getIdValue(Object object, int index) {
attrvalueBizRole = (IBizRole) object;
return String.valueOf(attrvalueBizRole.getId());
}
});
item.add(attrvalueChoice);
}
};
i want to get the dropdownlist selected value.how to get value?
Can anyone tell me how to achieve this.
Thanks
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-get-dropdownlist-selected-value-tp4650788.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: how to get dropdownlist selected value
Posted by Fergal Keating <fe...@directski.com>.
attrvalueChoice.getModelObject();
On 26 July 2012 10:15, lxw_first <lx...@hotmail.com> wrote:
> http://apache-wicket.1842946.n4.nabble.com/file/n4650788/aaa.bmp
>
> html:
>
>
> <select wicket:id="attrvalue"></select>
>
>
> code
> final ListView trView=new ListView("tritems", new PropertyModel(this,
> "attrBizRoles")) {
> private IBizRole attrvalueBizRole=new BizRole();
>
> @Override
> protected void populateItem(ListItem item) {
> attrBizRole = (IBizRole) item.getModelObject();
> item.add(new Label("lblattr", attrBizRole.getName()));
> // this list can get from attr
> attrvalueBizRoles = (List<IBizRole>)
> attrBizRole.getChildBizRole();
> if (attrvalueBizRoles.size()>0) {
> attrvalueBizRole=attrvalueBizRoles.get(0);
> }
> DropDownChoice attrvalueChoice = new
> DropDownChoice("attrvalue",new
> PropertyModel<IBizRole>(this, "attrvalueBizRole"), attrvalueBizRoles,new
> IChoiceRenderer() {
>
> @Override
> public Object getDisplayValue(Object object) {
> attrvalueBizRole = (IBizRole) object;
> return attrvalueBizRole.getName();
> }
>
> @Override
> public String getIdValue(Object object, int index)
> {
> attrvalueBizRole = (IBizRole) object;
> return
> String.valueOf(attrvalueBizRole.getId());
> }
> });
> item.add(attrvalueChoice);
> }
> };
>
> i want to get the dropdownlist selected value.how to get value?
> Can anyone tell me how to achieve this.
> Thanks
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/how-to-get-dropdownlist-selected-value-tp4650788.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Fergal Keating
IT Senior Engineer
-----------------------------------------------
e. fergal.keating@directski.com
p. NA
w. www.directski.com