Hi Sascha, As I am a newbie on OFBiz and ajax, do you know of an example in OFBiz .js files that doesn't look for a JSON object?
Regards, Pierre 2010/9/3 Sascha Rodekamp <[email protected]> > Hi Pierre, > you're Ajax request looks for a JSON Object in you're return parameters and > you try to render a screen. Try to start you're Ajax request without asking > for an JSON Object. > That should work. If not let me now. > > Cheers > Sascha > > > > > 2010/9/2 Pierre Smits <[email protected]> > > > Hi all, > > > > In a .ftl form I build a list of projects available. The list contains > per > > row a selection box to generate a query-string. > > > > I then pass the request (with the query-string) to following javascript > > function: > > > > function getAssociatedTaskList(request) {; > > new Ajax.Request( request, { > > onSuccess: function(transport) { > > var data = transport.responseText.evalJSON(true); > > var serverError = getServerError(data); > > if (serverError != "") { > > alert("het gaat fout"); > > Effect.Appear('createListError',{duration:0.0}); > > $('createListError').update(serverError); > > } else { > > Effect.Fade('createListError', {duration: 0.0}); > > new Ajax.Updater($('TaskOverview'), 'ListTasks' , > > {evalScripts: true}); > > } > > }, > > asynchronous: true, > > requestHeaders: {Accept: 'application/json'} > > }); > > } > > > > the request is like: > > /application/control/getAssociatedTaskList?projectsSelected=10050 > > > > The request-map in controller.xml is: > > <request-map uri="getAssociatedTaskList"> > > <security https="true" auth="true"/> > > <response name="success" type="view" > value="getAssociatedTaskList"/> > > </request-map> > > > > With the corresponding view-map: > > <view-map name="getAssociatedTaskList" type="screen" > > page="component://application/widget/applicationScreens.xml#ListTasks"/> > > > > ListTasks in applicationScreens.xml contains: > > <screen name="ListTasks"> > > <section> > > <actions> > > <property-map resource="casUiLabels" map-name="uiLabelMap" > > global="true"/> > > <set field="parameters.partyId" > > from-field="parameters.userLogin.partyId"/> > > <script > > > > > location="component://application/webapp/application/WEB-INF/actions/projects/ListTasks.groovy"/> > > </actions> > > <widgets> > > <platform-specific> > > <html><html-template > > location="component://cas/webapp/cas/cas/listTasks.ftl"/></html> > > </platform-specific> > > </widgets> > > </section> > > </screen> > > > > When the js function is executed I see that the groovy file gets the > > correct > > parameters (from the query string passed). > > > > But I don't see the ajax result appearing in the div > (div="TaskOverview"). > > > > Can you help with some pointers? > > > > Regards, > > > > Pierre > > > > > > -- > Sascha Rodekamp > Lynx-Consulting GmbH > Johanniskirchplatz 6 > D-33615 Bielefeld > http://www.lynx.de >
