i want to make a SelectionField in my application.
but it doesn't work correctly. Have anyone an idea, what i did worg?
@ViewField(render=ViewConstants.RENDER_SELECT, label="Status", selectionField="status" )
public LIst<String> status = new ArrayList<String>();
……………………………………………………….
public List<String> getStatus()
{
if (status ==null)
{
status = new ArrayList<String>();
status.add("yes")
status.add("no")
}
return status;
}
…………………………………………………………………….
public void setStatus(List<String> status){
this.status = status
}
…………………………………………………………………..
thanks very much.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
the selectionField must indicate a field (or just getter/setter) that keep the selection. When you use Arrays and Collections the selection is the entry inside of it. In your example the user choose a status and the selected status will be available inside the property indicated in the selectionField.
@ViewField(render=ViewConstants.RENDER_SELECT, label="Status", selectionField="status" )
public LIst<String> statuses = new ArrayList<String>();
@ViewField(visible=AnnotationConstants.FALSE)
public String status;
................................................................
public List<String> getStatuses()
{
if (statuses ==null){
statuses = new ArrayList<String>();
statuses.add("yes")
statuses.add("no")
}
return statuses;
}
...............................................................................
public String getStatus(){ return status; }
public void setStatus( String status){ this.status = status }
It's the same for all the components rendered with multivalues such as Tab, List, Table, etc.
Enjoy with Roma!
bye,
Luca Garulli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hallo everyone,
i want to make a SelectionField in my application.
but it doesn't work correctly. Have anyone an idea, what i did worg?
@ViewField(render=ViewConstants.RENDER_SELECT, label="Status", selectionField="status" )
public LIst<String> status = new ArrayList<String>();
……………………………………………………….
public List<String> getStatus()
{
if (status ==null)
{
status = new ArrayList<String>();
status.add("yes")
status.add("no")
}
return status;
}
…………………………………………………………………….
public void setStatus(List<String> status){
this.status = status
}
…………………………………………………………………..
thanks very much.
Hi,
the selectionField must indicate a field (or just getter/setter) that keep the selection. When you use Arrays and Collections the selection is the entry inside of it. In your example the user choose a status and the selected status will be available inside the property indicated in the selectionField.
It's the same for all the components rendered with multivalues such as Tab, List, Table, etc.
Enjoy with Roma!
bye,
Luca Garulli