From: Dylan E. <dyl...@gm...> - 2006-09-20 21:56:46
|
Why not add something like DWR, http://getahead.ltd.uk/dwr/ to your coefficient deployment. DWR deploys as a servlet and it allows you to write simple java beans that are exposed via javascript objects. This would allow you to get server-side where you can then access coefficient progamatically to find the information you are after. You can return your new html from the bean call and use javascript to update you html (client side). I am pretty sure that should work. Dylan On 9/21/06, Miguel Perez <mr_...@ho...> wrote: > > I'll see if I can do it via the page.process > > Thanks > > -----Original Message----- > From: coe...@li... > [mailto:coe...@li...] On Behalf Of > pieter > van zyl > Sent: Wednesday, September 20, 2006 11:46 AM > To: Miguel Perez > Cc: coe...@li... > Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX > > My vote goes to Page.process( > > On Wed, 2006-09-20 at 11:37 -0400, Miguel Perez wrote: > > Pieter, > > > > Thanks for pointing me in the right direction. The objective is to be > able > > to do a response.getWriter().write("some text") so the web browser can > read > > the response "some text". > > > > I was not sure if I should modify CoefficientServlet or > > CoefficientWebContext. > > > > > > If you (or anyone on the forum) has any other idea, I would appreciate > it. > > > > Regards > > > > > > -----Original Message----- > > From: pieter van zyl [mailto:pv...@cs...] > > Sent: Wednesday, September 20, 2006 11:17 AM > > To: Miguel Perez > > Cc: coe...@li... > > Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX > > > > I don't know AJAX. > > > > And now I am going to guess...... > > > > I would suggestion modifying CoefficientServlet. > > > > Or > > CoefficientServlet.execute() {.......... > > CoefficientWebContext ctx = new CoefficientWebContext(request, > > response); > > interceptor.invoke(ctx); > > // synchronize with CoefficientContext (reset session > > variables, > > // update cookies, forward if needed, etc...) > > ctx.synchronize(request, response); > > > > // Write out the page content > > ctx.getPage().process(response.getWriter()); > > .......... > > } > > > > one could modify the response in page.process method, where we are > > building and adding the page layouts. > > > > > > Hope this helps a bit..... > > > > On Tue, 2006-09-19 at 17:18 -0400, Miguel Perez wrote: > > > I'm trying to write a javascript using AJAX to return some values from > > > the server. > > > > > > > > > > > > For example > > > > > > var req; > > > > > > > > > > > > function validate() { > > > > > > var idField = document.getElementById("userid"); > > > > > > var url = "validate?id=" + escape(idField.value); > > > > > > if (window.XMLHttpRequest) { > > > > > > req = new XMLHttpRequest(); > > > > > > } else if (window.ActiveXObject) { > > > > > > req = new ActiveXObject("Microsoft.XMLHTTP"); > > > > > > } > > > > > > req.open("GET", url, true); > > > > > > req.onreadystatechange = callback; > > > > > > req.send(null); > > > > > > } > > > > > > > > > > > > My question is how do I get the values back from coefficient. I can > > > execute the methods and a module but I don't have access to > > > response.getWriter from ctx. > > > > > > > > > > > > Do I need to write a next class, modify CoefficientServlet, or is > > > there a way to do this via ctx (coefficientcontext)? > > > > > > > > > > > > Any help would be deeply appreciated. > > > > > > > > > > > > regards > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the chance to > share > > your > > > opinions on IT & business topics through brief surveys -- and earn > cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > _______________________________________________ Coefficient-devel > mailing > > list Coe...@li... > > https://lists.sourceforge.net/lists/listinfo/coefficient-devel > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys -- and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Coefficient-devel mailing list > > Coe...@li... > > https://lists.sourceforge.net/lists/listinfo/coefficient-devel > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Coefficient-devel mailing list > Coe...@li... > https://lists.sourceforge.net/lists/listinfo/coefficient-devel > |