Re: [Catalyst] forward not working correctly ?

2015-02-01 Thread Luca Ferrari
CIao,

On Thu, Jan 29, 2015 at 6:28 PM, QE :: Felix Ostmann ostm...@qe.de wrote:
 Hi,

 i guess you are confused by all the different type of redirects, forwards,
 visits ...

 After your explanation i think you want a HTTP-Redirect
 (http://www.catalystframework.org/calendar/2007/13) / redirect_to_action

 Please read about visit, go, forward and detach in the documentation:
 (
 http://search.cpan.org/~jjnapiork/Catalyst-Runtime-5.90082/lib/Catalyst.pm
 )


Thanks, I was misleaded by a wrong example.

Luca

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] forward not working correctly ?

2015-01-29 Thread Luca Ferrari
Hi all,
I'm surely missing something in my action:


sub edit : Local Form {
my ( $self, $c, $id ) = @_;
my $form = $self-formbuilder();

   ...
if ( $is_form_ok ){
...
$c-forward( 'list' );
   } else {
 ...
   }
}


The result is that the same page (the form for the edit action) is
always rendered, even if all the business logic works fine.
detach is not working as I'm expecting too, and  only visit appears to
render the list action, but without changing the url.

The development server console provides me the call chain:
/workers/edit
 - /workers/list
 /end
- Smickets::View::HTML-process

I'm using TTSite as my view.
What am I missing?

Thanks,
Luca

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] forward not working correctly ?

2015-01-29 Thread QE :: Felix Ostmann
Hi,

i guess you are confused by all the different type of redirects, forwards,
visits ...

After your explanation i think you want a HTTP-Redirect (
http://www.catalystframework.org/calendar/2007/13) / redirect_to_action

Please read about visit, go, forward and detach in the documentation:
​(​
http://search.cpan.org/~jjnapiork/Catalyst-Runtime-5.90082/lib/Catalyst.pm
)​
​



Mit freundlichem Gruß
Felix Ostmann

---
QE GmbH  Co. KG, Martinistraße 3, D-49080 Osnabrück
---
Tel.: +49 (0) 541 / 40666 0, Fax: +49 (0) 541 / 40666 22
Email: i...@qe.de, Web: www.qe.de
---
AG Osnabrück - HRA 200252, Ust-IdNr.: DE814737310
---
Komplementärin: QE24 GmbH, AG Osnabrück - HRB 200359,
Geschäftsführer: Ansas Meyer, Firmensitz: Osnabrück
---

Die in dieser Email enthaltenen Informationen sind vertrau-
lich zu behandeln und ausschließlich für den Adressaten be-
stimmt. Jegliche Veröffentlichung, Verteilung oder sonstige
in diesem Zusammenhang stehende Handlung wird ausdrücklich
untersagt.

2015-01-29 16:17 GMT+01:00 Luca Ferrari fluca1...@infinito.it:

 Hi all,
 I'm surely missing something in my action:


 sub edit : Local Form {
 my ( $self, $c, $id ) = @_;
 my $form = $self-formbuilder();

...
 if ( $is_form_ok ){
 ...
 $c-forward( 'list' );
} else {
  ...
}
 }


 The result is that the same page (the form for the edit action) is
 always rendered, even if all the business logic works fine.
 detach is not working as I'm expecting too, and  only visit appears to
 render the list action, but without changing the url.

 The development server console provides me the call chain:
 /workers/edit
  - /workers/list
  /end
 - Smickets::View::HTML-process

 I'm using TTSite as my view.
 What am I missing?

 Thanks,
 Luca

 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] forward not working correctly ?

2015-01-29 Thread Octavian Rasnita

From: Luca Ferrari fluca1...@infinito.it


Hi all,
I'm surely missing something in my action:


sub edit : Local Form {
   my ( $self, $c, $id ) = @_;
   my $form = $self-formbuilder();

  ...
   if ( $is_form_ok ){
   ...
   $c-forward( 'list' );
  } else {
...
  }
}


The result is that the same page (the form for the edit action) is
always rendered, even if all the business logic works fine.
detach is not working as I'm expecting too, and  only visit appears to
render the list action, but without changing the url.



$c-forward() just calls another method, but in the same request. I think 
you want to use $c-redirect().


$c-redirect( $c-uri_for_action( ... ) );

--Octavian




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/