X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "Aaron Rosenzweig" Received: from mail-qt1-f174.google.com ([209.85.160.174] verified) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 25836800 for webobjects-dev@wocommunity.org; Sat, 08 May 2021 17:40:24 +0200 Received-SPF: none receiver=post.selbstdenker.com; client-ip=209.85.160.174; envelope-from=recurve@cocoanutstech.com Received: by mail-qt1-f174.google.com with SMTP id n22so8835816qtk.9 for ; Sat, 08 May 2021 08:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chatnbike.com; s=chatnbike; h=from:message-id:mime-version:date:subject:in-reply-to:to:references; bh=ARQLySUiO9Z61SwSHqziuKvJ81u2jpkbIYa+rbEXXs4=; b=aF2tfMlABpFk/zrPe/u9X2d4PFCs2maynlUq4wfcetZ41PV68PHwn18pE7x9u1tIQc TagfeXQTIxwaxFygsPWOysyLBblfm/Zd/SEWxZlR623ZMGXi1FMx2hGV96cLniZVKD+e SHRPn0aTVUiSXBCCLfDNaX96MgjZhF8TBtmqE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:date:subject :in-reply-to:to:references; bh=ARQLySUiO9Z61SwSHqziuKvJ81u2jpkbIYa+rbEXXs4=; b=hR5jCTPI/AWJdabLyAAHtmse1GKxsLq4j5ZtLvEm5gucN+jgDmLpKrF3wj6AbVEjET RuVgYuGNf/hht7z5HJcmkIIo9IIAKfSeRvhSiiRnCP8yWSL6Yobw59YAnRjcqiS2e7uQ 3r9N2aYhhRXQ83MaPoAjwGjw4st1CrxXm4iORn4jyQNgRSD/eH5b//UDJSnASbF+J1wv ubkKGIEC7qJknXcJwkEore7j0I2WOQet0wBoTKgl0MFeJrw6WOqO6aohXpEMLoL61+pa qO444dPIsFIFA9Mjr0mmlAedO7cyX5pUysJnXhykdl8bg81xHbyoi8XGVjp/Ju9mYwHl m+CQ== X-Gm-Message-State: AOAM531JWGcl+b9PLeq+1V3J2tegMsGpLRdBYEGJS+yTKqyyjNyLG2ez ToNneRdPiquqRH805W1CPgXqpKBwFcdf+2mE X-Google-Smtp-Source: ABdhPJxhJ/1dbuigKegiOTjI5hAwQAeP/nX1SNdPQpHIMx3XZciKrBRXvv/ODjpQEjNPdI85hf4ylw== X-Received: by 2002:ac8:1309:: with SMTP id e9mr14241381qtj.371.1620488401736; Sat, 08 May 2021 08:40:01 -0700 (PDT) Return-Path: Received: from smtpclient.apple (pool-173-79-35-204.washdc.fios.verizon.net. [173.79.35.204]) by smtp.gmail.com with ESMTPSA id 7sm3005418qkd.20.2021.05.08.08.40.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 May 2021 08:40:01 -0700 (PDT) Message-Id: <42C43268-5995-4E8C-9C16-D29965CDBE74@chatnbike.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_151AA236-D70B-40E4-B6E7-A25A87298496" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Date: Sat, 8 May 2021 11:40:00 -0400 Subject: Re: [WO-DEV] ERXRedirect unknownKeyException??? In-Reply-To: To: WebObjects & WOnder Development References: X-Mailer: Apple Mail (2.3654.80.0.2.43) --Apple-Mail=_151AA236-D70B-40E4-B6E7-A25A87298496 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Maybe you are working too hard - go about it another way.=20 In java make the calculation and instead of going to the =E2=80=9Cpayment=E2= =80=9D page go directly to the =E2=80=9Cthank you=E2=80=9D page. > On May 8, 2021, at 11:30 AM, Ralf Schuchardt = wrote: >=20 > I think you are getting the error because setting a binding also = involves reading the value back, therefore all bindings should also have = a getter method. >=20 > ERXRedirect is supposed to be returned as a component in an action = method. So instead of returning the thank you page, you would return an = ERXRedirect instance. >=20 > But this does probably not solve your problem, as you are already on = the ThankYouPage. As most of the work is done in = ERXResponse.appendToResponse() you may try to manually call this in = ThankYouPage=E2=80=99s appendToResponse: >=20 > public void appendToResponse(WOResponse aResponse, WOContext aContext) = { >=20 > if (noPayment) { > ERXRedirect redirect =3D pageWithName(ERXRedirect.class); > redirect.setComponent( redirectComponent ); > redirect.appendToResponse(aResponse, aContext); > } > super.appendToResponse() > } > This should set a location header and 302 response code and so = redirect to the target page. >=20 > Ralf >=20 > On 8 May 2021, at 16:17, Markus Ruggiero (rucotec) wrote: >=20 > When I transfer to a payment page but this page sees that there is no = payment to be collected I want to directly jump further to the Thank You = page. Everything is component action, everything happens inside a = session. >=20 > In my .wo, inside a WOConditional that triggers when there is no = payment needed >=20 > >

No payment required at the moment

> > >=20 > > > >=20 > with the binding >=20 > automaticallyContinue : ERXRedirect { > component =3D thankYouPage; > } >=20 > In my java: >=20 > public WOComponent thankYouPage() { >=20 > invoiceRemoteRequest.setStatus(E_RemoteRequestStatus.DONE); > EOEditingContext ec =3D invoiceRemoteRequest.editingContext(); > ec.saveChanges(); > =09 > notifyCoordinator(); > =09 > RemoteActionThankYouPage nextPage =3D = pageWithName(RemoteActionThankYouPage.class); > nextPage.setInvoiceRemoteRequest(invoiceRemoteRequest); > return nextPage; > } >=20 > And the result: >=20 > = valueForKey()]: lookup of unknown key: 'component'. > The WOComponent er.extensions.appserver.ERXRedirect does not have an = instance variable of the name component or _component, nor a method of = the name component, _component, getComponent, or _getComponent' object = '' key = 'component'> >=20 > Calling the setter is ok, but why is it trying to call a getter?=20 > What am I missing here? >=20 > Thanks a lot > ---markus--- >=20 >=20 > Markus Ruggiero >=20 > rucotec GmbH web https://rucotec.ch = > Steinenvorstadt 79 email markus.ruggiero@rucotec.ch = > 4051 Basel / Switzerland mobile +41 79 508 4701 --Apple-Mail=_151AA236-D70B-40E4-B6E7-A25A87298496 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Maybe= you are working too hard - go about it another way. 

In java make the = calculation and instead of going to the =E2=80=9Cpayment=E2=80=9D page = go directly to the =E2=80=9Cthank you=E2=80=9D page.

On May 8, 2021, at 11:30 AM, Ralf Schuchardt <webobjects-dev@wocommunity.org> wrote:

I think you are = getting the error because setting a binding also involves reading the = value back, therefore all bindings should also have a getter = method.

ERXRedirect is supposed to be = returned as a component in an action method. So instead of returning the = thank you page, you would return an ERXRedirect instance.

But this does probably not solve your problem, = as you are already on the ThankYouPage. As most of the work is done = in ERXResponse.appendToResponse() you may try to manually = call this in ThankYouPage=E2=80=99s appendToResponse:

public void appendToResponse(WOResponse =
aResponse, =
WOContext aContext) {

    if (noPayment) {
        ERXRedirect redirect =3D pageWithName(ERXRedirect.class);
        redirect.setComponent( redirectComponent );
        redirect.appendToResponse(aResponse, aContext);
    }
    super.appendToResponse()
}

This should set a location = header and 302 response code and so redirect to the target page.

Ralf

On 8 May = 2021, at 16:17, Markus Ruggiero (rucotec) wrote:

When I transfer to a payment page but = this page sees that there is no payment to be collected I want to = directly jump further to the Thank You page. Everything is component = action, everything happens inside a session.

In my .wo, inside a WOConditional that = triggers when there is no payment needed

<webobject name =3D "noPaymentRequested">
    <p>No payment required at the moment<br /></p>
    <webobject name =3D "automaticallyContinue" />
</webobject name =3D "noPaymentRequested=E2= =80=9D>

<webobject name =3D "includePayment">
    <webobject name =3D "paymentPanel" />
</webobject name =3D "includePayment">

with the binding

automaticallyContinue : ERXRedirect {
    component =3D thankYouPage;
}

In = my java:

public WOComponent thankYouPage() {

    invoiceRemoteRequest.setStatus(E_RemoteRequestStatus.DONE);
  =   EOEditingContext ec =3D invoiceRemoteRequest.editingContext();
  =   ec.saveChanges();
=
    notifyCoordinator();
=
    RemoteActionThankYouPage nextPage =3D pageWithName(RemoteActionThankYouPage.class);
    nextPage.setInvoiceRemoteRequest(invoiceRemoteRequest);
  =   return nextPage;
}

And the result:

<com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException message = '[<er.extensions.appserver.ERXRedirect name: = er.extensions.appserver.ERXRedirect subcomponents: null > = valueForKey()]: lookup of unknown key: 'component'.
The = WOComponent er.extensions.appserver.ERXRedirect does not have an = instance variable of the name component or _component, nor a method of = the name component, _component, getComponent, or _getComponent' object = '<er.extensions.appserver.ERXRedirect name: = er.extensions.appserver.ERXRedirect subcomponents: null >' key = 'component'>

Calling the setter is ok, but why is it trying to call a = getter? 
What am I missing here?

Thanks a lot
---markus---


Markus = Ruggiero

rucotec GmbH              =           web https://rucotec.ch
Steinenvorstadt 79      =           email markus.ruggiero@rucotec.ch
4051 Basel / Switzerland    =      mobile +41 79 508 = 4701

= --Apple-Mail=_151AA236-D70B-40E4-B6E7-A25A87298496--