to greg, thank you for your insight on the matter. it's not that i
want to force using a utility class, its just that, well, its a
requirement for me (to use a utility class, since other fellow devs
here in my team will use it) and i thought its more convenient. and on
the matter of where to place
When you call any "async" method in GWT, you can think of it as starting in
another Thread. This is the plain Java equivalent to your XmlParserUtil class:
public class XmlParserUtil {
String url;
Document doc;
public RequestBuilder requestBuilder;
String xmlStr;
Hi Mives29,
Jason's solution is correct. If you have TreeX implement his Callback
interface, then XmlParserUtil will call TreeX.callback() when it has
retrieved and parsed the XML document, so you move the tree building
code (getTreeitem()) to start from TreeX.callback(String XML). This
will sol
Hi! I've just re-read your reply, but I cant understand how the
interface would affect the program, and how would I use that new
getDocument() method of the XmlUtilParser class. Could you provide
another example (a working one, if possible)?
This whole AsyncCallback/asynchronous stuff of GWT is d
yes. you got my problem right. now probably tommorow or the day after
that, I'll have the chance to re-do my code. For now, back to reading
some company documents. Will get back here as soon as I've redone the
code.
Thanks Jason,
mives29
On Nov 10, 5:58 pm, Jason Morris <[EMAIL PROTECTED]> wrote
Heya,
Your basic problem here is that you can't have your XmlParserUtil return a
Document object. The doc field will only be filled in when the async
RequestBuilder request returns and the parser is finished with the XML string.
By that time, your method has already returned.
The only way to
okay, let me be clear on this, again, my code. (now posting full
reworked source code)
// A composite w/c contains a tree.
public class TreeX extends Composite {
Document doc;
Tree t = new Tree();
int imgUris;
XmlParserUtil xmlParser;
public TreePol() {
You have to accept the asynchronous nature of RPC-Requests in GWT and
stop trying to build smth. synchronous around them. This code:
---
doc = getDoc(); //(where doc is a Document object)
String subject =
doc.getElementsByTagName("Image").item(0).getChildNodes().ite
hi all. ive re-done my code just a while ago(been a busy week) and my
code kinda bothers me. here's the code re-done:
Entrypoint onModuleLoad() method:
doc = getDoc(); //(where doc is a Document object)
String subject =
doc.getElementsByTagName("Image").item(0).getChildNodes().item(1).toString(
Oh. I didnt know that! Thanks a lot! Will try to modify it. Thanks
again.
mives29
On Nov 5, 3:31 pm, Lothar Kimmeringer <[EMAIL PROTECTED]> wrote:
> mives29 schrieb:
>
> > requestBuilder = new RequestBuilder(RequestBuilder.GET,url);
> > requestBuilder.sendRequest(null,xmlRcb);
> > doc = xmlRcb.g
mives29 schrieb:
> requestBuilder = new RequestBuilder(RequestBuilder.GET,url);
> requestBuilder.sendRequest(null,xmlRcb);
> doc = xmlRcb.getDoc();//calls xmlRcb's getDoc method, w/c
> returns
sendRequest happens asynchronously, so the callback-
method is not called at this time
Hi. Im having a problem using RequestBuilder. Instead of using an
inner class of type RequestCallBack, I created a class that implements
it. Here's what I've done,
1)Created a utility class named XmlParserUtil. This will return a
parsed XML document. (Document object)
2)Inside, there's 1 method,g
sammi,
thanks for the reply. will try that asap.
On Nov 5, 12:34 pm, Sammi <[EMAIL PROTECTED]> wrote:
> Hi mives29,
> I just solve the problem. It's quite direct and easy.
>
> 1. upload your xml file to any webserver, e.g.http://a.b.c/test.xml
>
> 2. use RequestBuilder to get it. your url.
>
Hi mives29,
I just solve the problem. It's quite direct and easy.
1. upload your xml file to any webserver, e.g. http://a.b.c/test.xml
2. use RequestBuilder to get it. your url.
3. String xmlStr = response.getText();
4. use XMlParser to parse the xmlStr. that's it. Sample snippet code
here:
Hi mives29,
I just solve the problem. It's quite direct and easy.
1. upload your xml file to any webserver, e.g. http://a.b.c/test.xml
2. use RequestBuilder to get it. your url.
3. String xmlStr = response.getText();
4. use XMlParser to parse the xmlStr. that's it. Sample snippet code here:
Hi. I'm a newbie in GWT, and I've been tasked to create a utility
class to parse xml files that the contents would be used in layouting
the widgets in its container panel (along with other UI
configurations).
I've accomplished this by using a service, which uses Java's DOM style
of parsing. This
16 matches
Mail list logo