Hi there
I did implement it according to your LocaleList example in the workbench
application (well, I guess you smelled where it came from anyways ;))
The real trouble was the usage of HashSet. The contains, add and remove
functionality depends on the equals implementation of the containing
objects, which was, of course, wrong :/
Using HashMap now, and everything works as designed.
Thx for the answer
cs.
Mind Bridge schrieb:
Hi,
How do you define 'selectedMessages'? Is this a persistent property?
If it is not defined as a persistent property, it needs to be initialized
properly. If it that is not done, an issue very similar to what you describe
could occur, especially when multiple people use the application.
-mb
----- Original Message -----
From: "Christian" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Saturday, July 09, 2005 9:51 AM
Subject: Checkbox within Table
Hi all
I got a strange problem:
I have a FormTable with a checkbox column:
(template)
<table jwcid="[EMAIL PROTECTED]:FormTable"
source="ognl:messagesFromCurrentFolder"
columns="SentDate, From, Subject, !Check"
class="messages"
row="ognl:currentMessage"
rowsClass="ognl:beans.evenOdd.next">
... (some values for SentDate, From, Subject) ...
<span jwcid="[EMAIL PROTECTED]" >
* <input type="checkbox" jwcid="@Checkbox"
selected="ognl:messageSelected"/>
* </span>
</table>
(jwc)
<property-specification name="messageSelected" type="boolean"/>
<property-specification name="currentMessage"
type="ch.bluepenguin.email.client.MailMessage"/>
this method handles the messageSelected state:
public void setMessageSelected(boolean selected) {
if(getCurrentMessage()!=null) {
if(selected &! selectedMessages.contains(getCurrentMessage()))
{
//1
logger.info("Setting the message as selected " +
getCurrentMessage().getSubject());
selectedMessages.add(getCurrentMessage());
} else if(!selected &&
selectedMessages.contains(getCurrentMessage())){
//2
logger.info("Setting the message *NOT* as selected " +
getCurrentMessage().getSubject());
selectedMessages.remove(getCurrentMessage());
}
}
}
What happens now, in chronological order is that
* first all changes are correctly applied, e.g. when I select a message
//1 is reached, when I deselect a previously selected //2 is reached
* sometimes //2 is reached, which means that a previously selected
message is deselected again
--> sometimes means that I have to find a certain constellation, but
then it is reproducable
Does that ring a bell to someone? Am I caught in a rewind-phase conflict?
Thx for any kind of hints...
Cheers
cs.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]