listShuttle: Validation Error
azur666 Mar 30, 2011 10:51 AMHello!
First of all: I'm sorry for my English!!!!
I have a problem with the component listShuttle I hope someone can solve.
My source code is:
xhtml:
<rich:listShuttle sourceValue="#{fichasExport.availableProperties}"
targetValue="#{fichasExport.selectedProperties}"
sourceListWidth="150"
targetListWidth="150"
id="listas"
var="properties"
sourceCaptionLabel="${messages.listAvailableProperties}"
targetCaptionLabel="${messages.listCurrentlyProperties}"
copyControlLabel="${messages.listCopy}"
copyAllControlLabel="${messages.listCopyAll}"
removeControlLabel="${messages.listDelete}"
removeAllControlLabel="${messages.listDeleteAll}"
topControlLabel="${messages.listFirst}"
bottomControlLabel="${messages.listLast}"
upControlLabel="${messages.listUp}"
downControlLabel="${messages.listDown}">
<rich:column>
<h:outputText value="#{properties}"></h:outputText>
</rich:column>
<a4j:support action="#{fichasExport.formPreliminarFile(0)}"
event="onlistchanged"
reRender="preliminarFile, listas"
status="status"
queue="exportCardsQueue"
ignoreDupResponses="true"/>
</rich:listShuttle>
Lists are defined as String
privateList<String> availableProperties;
private List<String> selectedProperties;
public voidsetAvailableProperties(List<String> l)
{
availableProperties = l;
}
publicList<String> getAvailableProperties()
{
//Se ponen lascabeceras correctas
this.returnHead();
if (availableProperties == null)
{
availableProperties = new ArrayList<String>();
availableProperties.add(category1);
availableProperties.add(category2);
availableProperties.add(user1);
availableProperties.add(user2);
}
return availableProperties;
}
public voidsetSelectedProperties(List<String> l)
{
selectedProperties = l;
}
publicList<String> getSelectedProperties()
{
if (selectedProperties == null)
{
selectedProperties = new ArrayList<String>();
selectedProperties.add(mnemonic);
selectedProperties.add(deviceAddress);
selectedProperties.add(deviceType);
}
formPreliminarFile(0);
return selectedProperties;
}
mnemonic, deviceAddress, deviceType are constants of type String and category1, category2, user1 and user2 are user-defined of type String.
The problem occurs when setting, for example, Category2=”Cat 2 “(Cat+ two spaces+ 2). When there are two spaces or more in any field I have the following error when I select any data from the list for a second time.
After this, the listShutlle is not working well.
Plese, help me
Thank you very much.