| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
package org.apache.tapestry5.internal.services; |
| 16 | |
|
| 17 | |
import org.apache.tapestry5.Link; |
| 18 | |
import org.apache.tapestry5.json.JSONObject; |
| 19 | |
import org.apache.tapestry5.services.Ajax; |
| 20 | |
import org.apache.tapestry5.services.ComponentEventResultProcessor; |
| 21 | |
|
| 22 | |
import java.io.IOException; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | 2 | public class AjaxLinkComponentEventResultProcessor implements ComponentEventResultProcessor<Link> |
| 28 | |
{ |
| 29 | |
private final ComponentEventResultProcessor masterProcessor; |
| 30 | |
|
| 31 | |
public AjaxLinkComponentEventResultProcessor(@Ajax ComponentEventResultProcessor masterProcessor) |
| 32 | 2 | { |
| 33 | 2 | this.masterProcessor = masterProcessor; |
| 34 | 2 | } |
| 35 | |
|
| 36 | |
public void processResultValue(Link value) throws IOException |
| 37 | |
{ |
| 38 | 2 | JSONObject response = new JSONObject(); |
| 39 | |
|
| 40 | 2 | response.put("redirectURL", value.toRedirectURI()); |
| 41 | |
|
| 42 | 2 | masterProcessor.processResultValue(response); |
| 43 | 2 | } |
| 44 | |
} |