Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
Paul Schmidt
Duplicate Request on community change
25 maggio 2012 7.00
Risposta

Paul Schmidt

Punteggio: Junior Member

Messaggi: 30

Data di Iscrizione: 28 luglio 2010

Messaggi recenti

Hello community,

I've got a very annoying problem and no solution for it.
Liferay 6.0.6 CE


I added an entry to the left side of the control panel.
On the right side, I have a jsp with a button which does an action.

1<a href="javascript:void(0);" onclick="window.location='
2    <portlet:actionURL>
3        <portlet:param name='action' value='deleteAllSearchUseCasesForCurrentCommunity'/>
4    </portlet:actionURL>';">CLICK ME</a>


On click, the action is done and everything is fine.

Now I change the community by using the dropdown on the top left side.

My jsp is displayed BUT the action becomes triggered again for the selected community.

If I null the action value from response and request in our backend, it is filled again after switching the community.
Who stores the action value and triggers the request again??

Any ideas?
Paul Schmidt
RE: Duplicate Request on community change
29 maggio 2012 0.54
Risposta

Paul Schmidt

Punteggio: Junior Member

Messaggi: 30

Data di Iscrizione: 28 luglio 2010

Messaggi recenti

Does nobody have a solution for this problem?
Nagendra Kumar Busam
RE: Duplicate Request on community change
29 maggio 2012 0.58
Risposta

Nagendra Kumar Busam

Punteggio: Liferay Master

Messaggi: 638

Data di Iscrizione: 7 luglio 2009

Messaggi recenti

Can you post your processAction method Implementation if you can
Paul Schmidt
RE: Duplicate Request on community change
29 maggio 2012 6.31
Risposta

Paul Schmidt

Punteggio: Junior Member

Messaggi: 30

Data di Iscrizione: 28 luglio 2010

Messaggi recenti

 1
 2...
 3
 4public class MyClass extends AbstractController {
 5
 6  @Override
 7  public void handleActionRequest(ActionRequest request, ActionResponse response)
 8        throws Exception {
 9
10        String action = request.getParameter("action");
11
12        if (action != null) {
13            
14            // do some amazing magic
15
16            request.getParameterValues("action")[0] = null;
17            response.getRenderParameterMap().get("action")[0] = null;
18
19        }
20  }
21
22...
23
24}
Paul Schmidt
RE: Duplicate Request on community change
31 maggio 2012 1.33
Risposta

Paul Schmidt

Punteggio: Junior Member

Messaggi: 30

Data di Iscrizione: 28 luglio 2010

Messaggi recenti

I resolved this problem by comparing the scopeIds from actual and last actionRequest.
But this is a dirty workaround and I think, that there is a problem inside Liferay.