|
|
| Re: XWT ValidationRule question [message #987547 is a reply to message #987009] |
Tue, 27 November 2012 01:12   |
Jürgen Weinberger Messages: 26 Registered: August 2012 |
Junior Member |
|
|
Hey! Thanks for the tip.
I built the "converter" now the way you suggested. The only difference i made is that i pluged the statuses of the bindingcontexts into that converter. By the way in my case its not a converter, it is a custom widget inherited from a composite. (But it doesn't matter)
My only thought was that the ValidationRules do the validation and that the Widget only shows the status. Now my widget is a little more inteligence
and links the two bindingcontext statuses with a logical or (So that only one rule must be valid). I thought it would be nicer if a rule would do this but for now i can live with that solution:
<StatusLabel>
<StatusLabel.status>
<Binding source="{StaticResource context1}" path="status"/>
</StatusLabel.status>
<StatusLabel.secondStatus>
<Binding source="{StaticResource context2}" path="status"/>
</StatusLabel.secondStatus>
</StatusLabel>
public class StatusLabel extends Composite {
..
public void setStatus(IStatus) {
..
}
public IStatus getStatus() {
..
}
public void setSecondStatus(IStatus) {
..
}
public IStatus getSecondStatus() {
..
}
}
And there comes another question 
I think it would be nicer if it was possible to plug an array or List<> of IStatus into that Composite/Converter something like that:
<StatusLabel>
<StatusLabel.statuses>
<Binding source="{StaticResource context1}" path="status"/>
<Binding source="{StaticResource context2}" path="status"/>
<Binding source="{StaticResource context3}" path="status"/>
...
</StatusLabel.statuses>
</StatusLabel>
public class StatusLabel extends Composite {
..
public void setStatuses(IStatus[] statuses) {
..
}
public IStatus[] getStatuses() {
..
}
}
Is something like that possible how would i have to declare this in the xml and java code?
Thanks a lot for the hint again!
best regards weinma
[Updated on: Tue, 27 November 2012 01:13] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03521 seconds