hi,
normally the form generates a service link such as:
"direct/1/FooPage/$Form"
now that you have overriden Form.getLink, it should look like this
(verify the hidden field in the source):
"partial/1/FooPage/FooPage/$Form"
the javascript now doesnt need to do anything fancy, just append the
part IDs as service parameters, like this:
values["service"] += "/" + parts.join("/");
of course I dont really know if that's how the friendly urls patch
works.. but the general objective is: 1) have PartialForm generate the
right service link to the partial service 2) have the javascript
dynamically append the Part IDs as service params before submit
hope this helps,
viktor
On 4/13/05, Jamie <[EMAIL PROTECTED]> wrote:
> Viktor, I'm missing where/how I replace
>
> // crazy replacement
> var s = values["service"].split("/");
> s[0] = "partial";
> if (s.length==4) s.splice(3,0,s[2]);
> s = s.concat(parts);
> values["service"] = s.join("/");
>
> now that I've created getLink() in PartialForm.
>
> Jamie
>
> Viktor Szathmary wrote:
>
> >yes - that's because the response was not served by the appropriate
> >service (it should have been PartialService, but it wasnt)... if you
> >are already using a patched version of Tapestry, and you have some
> >enthusiasm, please try the following:
> >
> >modify tapestry's Form.java, and make private ILink
> >getLink(IRequestCycle cycle, String actionId) a protected method...
> >override in tacos PartialForm.java like this:
> >
> >protected ILink getLink(IRequestCycle cycle, String actionId) {
> > IEngine engine = cycle.getEngine();
> > IEngineService service =
> > engine.getService(PartialService.SERVICE_NAME);
> > return service.getLink(cycle, this, new String[] { actionId });
> >}
> >
> >after these changes, verify that the hidden field "service" in your
> >Forms starts with "partial/..." - i think something like this should
> >to the trick.
> >
> >i found that monitoring the http traffic with something like tcpdump,
> >packetyzer or the charles http proxy is really helpful in diagnosing
> >xmlhttprequest-based apps.
> >
> >viktor
> >
> >On Apr 12, 2005 4:01 PM, Jamie <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Hmm... the javascript error I get is:
> >>
> >>Error: this.transport.responseXML has no properties
> >>Source File:
> >>http://localhost/registrar-student/asset.svc?sp=S%2Fnet%2Fsf%2Ftacos%2Fpartial%2FPartial.js&sp=S8304332074860f58113708089fb60cc3
> >>Line: 112
> >>
> >>
> >>Viktor Szathmary wrote:
> >>
> >>
> >>
> >>>hi,
> >>>
> >>>the PartialForm relies on a nasty, evil hack, because i was lazy :)
> >>>overriding the base tapestry Form component's service link generating
> >>>behavior is not currently possible without copypasting the entire
> >>>sourcecode... so what i ended up doing is a dynamic substitution in
> >>>the javascript:
> >>>
> >>> // crazy replacement
> >>> var s = values["service"].split("/");
> >>> s[0] = "partial";
> >>> if (s.length==4) s.splice(3,0,s[2]);
> >>> s = s.concat(parts);
> >>> values["service"] = s.join("/");
> >>>
> >>>so this turns the value of the "service" hidden param from something like
> >>>
> >>> direct/1/FooPage/$Form
> >>>
> >>>to
> >>>
> >>> partial/1/FooPage/FooPage/$Form (plus the part IDs)
> >>>
> >>>which is what we really needed in the first place. This is ugly, but
> >>>still seemed less gruesome than copypasting the entire Form
> >>>implementation just to override 3 lines...
> >>>
> >>>I'm not familiar with the operation of the "friendly urls" patch, so I
> >>>don't have any immediate suggestions, but I can look into this
> >>>later... in the meantime, I'm open for suggestions as to how to alter
> >>>the service link rendering behavior in Form without serious
> >>>copypasting.. I guess the best would be to submit a patch for
> >>>Tapestry 3.0.4 that makes the offending method in Form.java protected
> >>>instead of private:
> >>>
> >>>private ILink getLink(IRequestCycle cycle, String actionId) { ... }
> >>>
> >>>that's all I would need to override :) commiters?
> >>>
> >>>regards,
> >>> viktor
> >>>
> >>>
> >>>
> >>>
> >>>On Apr 12, 2005 2:42 PM, Jamie <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>Has anyone got these working in a Friendly URLs patch to 3.0.3? I've
> >>>>tried the PartialForm on a couple of my pages and nothing happens at all
> >>>>(no errors, nothing logged, etc). I've got the Parts with IDs, and the
> >>>>PartialForm--but no submission seems to take place and I'm getting no
> >>>>errors. I've run the tacos example war in the same server with no problem.
> >>>>
> >>>>Thanks,
> >>>>Jamie
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]