That was all with my problem. Thanks Taha for all the help.
If somebody wants the code:
*Class:*
Object onSuccess(){
...
if (request.isXHR()) {
ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
@Override
public void run(JavaScriptSupport arg0) {
arg0.addScript(String.forma
In that case you can use ajaxResponseRenderer for closing the colorbox on form
submission and then redirect the main window in the close event of
colorbox(using js or ajax).
On May 18, 2012, at 12:27 AM, Juan Alba wrote:
> I *need* to redirect.
>
> The idea is the following:
> My page has a b
I *need* to redirect.
The idea is the following:
My page has a button to add xxx. Whe I click this, it opens the modal with
the form.
When I fill in the form and submit, it is redirecting to the page but in
the modal, I need to close the modal and redirect the "main" page.
I am clear or is really
If you redirecting , no JavaScript will run.
If you want colorbox to close and you stay on the same page don't redirect. If
you want to redirect then why to close the colorbox.
Sent from my iPhone
On May 18, 2012, at 12:09 AM, Juan Alba wrote:
> Taha, thanks Again but still can't make it wo
Taha, thanks Again but still can't make it work.
I have this now:
*tml:*
${message:name}
in the *class*
Object onSuccess(){
if (request.isXHR()) {
ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
@Override
public void run(JavaScriptSupport arg0) {
It has to be an ajax request for ajaxResponseRenderer to work.
Also, for an ajax request if you want to redirect return an instance of Link
from the event handler.
return pageRenderLinkSource.createPageRenderLink(ShowRoutePlan.class);
regards
Taha
On May 17, 2012, at 11:25 PM, Juan Alba wrote
Taha, thanks a lot for your help but I am not sure if I am doing it right.
I added this as you told me:
@Inject
private AjaxResponseRenderer ajaxResponseRenderer;
Object onSuccess(){
...
ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
@Override
public void run(JavaScriptSu
Hi
You can't use JavaScriptSupport directly from environment in action phase but
you can do this
@Inject
private AjaxResponseRenderer ajaxResponseRenderer;
Object onSuccess(){
...
ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
@Override
public void run(Ja
Hi,
I am working with modals in my application, for this I have done my own
mixin that uses *colorbox* for the modal.
My problem, right now is that I have a form in one of those modals that has
to redirect when is submited.
I have two methods in the class:
@Inject
private JavaScriptSupport