2012-08-06 2 views
0

Liferay 6 및 MVC 포틀릿을 사용하고 있습니다. jsp와 extjs를 사용하여 포틀릿을 렌더링합니다. 최대화/최소화 할 때 포틀릿의 현재 상태가 손실됩니다. 최대화/최소화 한 후에도 포틀릿의 상태를 유지하려고합니다. 이것을 어떻게 할 수 있습니까? 액션 단계 & 단계 렌더링 :최대화/최소화시 포틀릿 상태가 유지되지 않습니다.

감사

답변

1

포틀릿은 두 단계가 있습니다. 액션 상태는 어떤 상태가 변경되어야 할 때 실행됩니다. 양식 제출이 완료되면 렌더링 단계는 최대화/최소화 후에도 항상 실행됩니다. 렌더링 단계에서 일부 상태가 변경되지 않도록하려면이 논리를 작업 단계에 배치하십시오.

다음
public class MyLiferayTestPortlet extends MVCPortlet { 
    @Override 
    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { 
     System.out.println("action"); 
     //here you can change the state 
    } 

    @Override 
    public void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException, PortletException { 
     System.out.println("rendering"); 
     //here you can prepaire the rendering of jsp 

     //print the window state 
     ThemeDisplay td = (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY); 
     System.out.println("isStateMaximized: " + td.isStateMaximized()); 
    } 
} 

당신이 포틀릿에 대한 두 단계를 읽을 수 있습니다 : 도움말 : 대한 http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/understanding-the-two-phases-of-portlet-executi-4

+0

감사

MVC-포틀릿으로

각 단계를 처리하기위한 두 가지 방법이 – user1415459

관련 문제