xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Vasilik" <eric...@bea.com>
Subject RE: Event listeners.. -> Nearly but not quite..
Date Sat, 10 Jul 2004 16:14:25 GMT
Unfortunately, there is no good eventing model in XmlBeans.  The
extension feature is designed to only allow extension of the generated
interfaces.  The pre/post feature allows one to capture changes only
when setters are called from these generated interface.  It does not
allow one to capture changes to the builtin (boxed) data types.

- Eric

-----Original Message-----
From: Damon Rand [mailto:damon@cybermagic.co.nz] 
Sent: Saturday, July 10, 2004 3:55 AM
To: xmlbeans-user@xml.apache.org
Subject: Re: Event listeners.. -> Nearly but not quite..

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/


- ---------------------------------------------------------------------
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