xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damon Rand" <da...@cybermagic.co.nz>
Subject Re: Event listeners.. -> Nearly but not quite..
Date Sat, 10 Jul 2004 10:55:24 GMT
Hi,
    I have used the PrePost feature a bit more now.. It seems that it only
works in certain cases though.. For simpletypes it doesn't appear to work.
eg.

I have this xml..

<title xml:lang="en">My english title</title>

and this code..

SimpleLiteral t = dc.getTitle();
t.setStringValue("My arabic title");
t.setLang("ar");

The results are

t.setStringValue -> XmlObjectBase.setStringValue ->   No event handler
called!!
t.setLang -> TitleImpl.setLang  -> Event handler called successfully..

In other words simpletypes aren't notifying because the base objects don't
have the pre and post code..

Would a solution be to generate TitleImpl.setStringValue() methods that call
pre and post and then pass on to XmlObjectBase ancestor? Or maybe to add pre
and post calls to XmlObjectBase?

What I am trying to do it bind some controls on a form (using the Eclipse
RCP forms package) to an xml document. I need to have certain fields redraw
depending on the values in other fields. I know xmlbeans is quite widely
used, how do other people normally handle this situation? Or is xmlbeans not
really common in this type of use case?

I need to get something working quite soon though.. My short term options
seems to be..

1. Call the preSet and postSet handlers myself manually before and after
calling setStringValue
2. Poll getDocChangeStamp and refresh the whole form each time a change
happens. Yuck. :-(
3. Other options?


Regards,
Damon.



----- Original Message ----- 
From: "Cezar Andrei" <cezar@bea.com>
To: <xmlbeans-user@xml.apache.org>
Sent: Friday, July 09, 2004 9:29 PM
Subject: RE: Event listeners..


Maybe this might be what you're looking for:
http://wiki.apache.org/xmlbeans/PrePostSetFeature

Cezar

> -----Original Message-----
> From: Damon Rand [mailto:damon@cybermagic.co.nz]
> Sent: Friday, July 09, 2004 2:32 PM
> To: xmlbeans-user@xml.apache.org
> Subject: Event listeners..
>
>
> Hi all,
>     I need to be able to recieve notifications of changes to
> xmlbeans.. Is
> this not possible or am I missing something?
>
> There is a monitor() method but there is no info on this..
> Ideally there
> would be something like AddEventListener dom event..
>
> Damon.
>
>
> -
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
>
>

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/



- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message