blank screen while calling event

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
su2
Reply | Threaded
Open this post in threaded view
|

blank screen while calling event

su2
This post was updated on .
Hello All,

I am trying to create a screen "CheckAccess" with the event. But, when I fire the request I get blank screen. and if I remove <event> from the controller.xml screen,it works. I have jar class-path in ofbiz-component.xml

My event is

------------------------------------------------------------------------------------------------------
public static String CheckAccess(HttpServletRequest request,HttpServletResponse response){
            Security security = (Security)request.getAttribute("security");
            String key = "_EVENT_MESSAGE_";
            if (security.hasPermission("LEARN_VIEW", request.getSession()))
            {
            request.setAttribute(key, "You have access!");
            }
            else {
            request.setAttribute(key, "You DO NOT have access! You are denied!");
            }
            return "success";
            }

------------------------------------------------------------------------------------------------------

Controller.xml
------------------------------------------------------------------------------------------------------
<request-map uri="CheckAccess">
        <security auth="true"/>
            <event type="java" path="org.ofbiz.learning.learning.LearningEvents" invoke="CheckAccess"/>
            <response name="success" type="view" value="CheckAccess"/>
    </request-map>

<view-map name="CheckAccess" type="screen" page="component://learning/widget/learning/LearningScreens.xml#CheckAccess"/>

------------------------------------------------------------------------------------------------------

Screen is
------------------------------------------------------------------------------------------------------
<screen name="CheckAccess">
        <section>
            <widgets>
                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="title">
                        <label text="Checking Access via Event BeanShell"/>
                    </decorator-section>
                    <decorator-section name="body">
                        <label text="This is the good screen."/> 
                        <label text="${eventMessageList[0]}"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
------------------------------------------------------------------------------------------------------

I would really appreciate the help.

Thank you in advance.
Reply | Threaded
Open this post in threaded view
|

RE: blank screen while calling event

Charles Tjandra

Hi Shuchi,

I saw there is a blank space at your - request-map when it was 'invoke' to
your Event.

see below
<event type="java"path="org.ofbiz.learning.learning.LearningEvents"
invoke="CheckAccess "/>

"CheckAccess_" (_ a blank space)

I think it is the problem you're facing. Check it out.

- Charles TJ

==================


-----Original Message-----
From: su2 [mailto:[hidden email]]
Sent: 19 Agustus 2009 23:13
To: [hidden email]
Subject: blank screen while calling event



Hello All,

I am trying to create a screen "CheckAccess" with the event. But, when I
fire the request I get blank screen. and if I remove <event> from the
controller.xml screen,it works. I have jar class-path in ofbiz-component.xml

My event is

----------------------------------------------------------------------------
--------------------------
public static String CheckAccess(HttpServletRequest
request,HttpServletResponse response){
            Security security = (Security)request.getAttribute("security");
            String key = "_EVENT_MESSAGE_";
            if (security.hasPermission("LEARN_VIEW", request.getSession()))
            {
            request.setAttribute(key, "You have access!");
            }
            else {
            request.setAttribute(key, "You DO NOT have access! You are
denied!");
            }
            return "success";
            }

----------------------------------------------------------------------------
--------------------------

Controller.xml
----------------------------------------------------------------------------
--------------------------
<request-map uri="CheckAccess">
        <security auth="true"/>
            <event type="java"
path="org.ofbiz.learning.learning.LearningEvents" invoke="CheckAccess "/>
            <response name="success" type="view" value="CheckAccess"/>
    </request-map>

<view-map name="CheckAccess" type="screen"
page="component://learning/widget/learning/LearningScreens.xml#CheckAccess"/
>

----------------------------------------------------------------------------
--------------------------

Screen is
----------------------------------------------------------------------------
--------------------------
<screen name="CheckAccess">
        <section>
            <widgets>
                <decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="title">
                        <label text="Checking Access via Event BeanShell"/>
                    </decorator-section>
                    <decorator-section name="body">
                        <label text="This is the good screen."/> <!-- text
for testing without event in controller.xml-->
                        <label text="${eventMessageList[0]}"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
----------------------------------------------------------------------------
--------------------------

I would really appreciate the help.

Thank you in advance.
--
View this message in context:
http://www.nabble.com/blank-screen-while-calling-event-tp25047243p25047243.h
tml
Sent from the OFBiz - User mailing list archive at Nabble.com.

su2
Reply | Threaded
Open this post in threaded view
|

RE: blank screen while calling event

su2
Sorry Thats the typo at my end but in my code there is no such blank.
Charles TJ wrote
Hi Shuchi,

I saw there is a blank space at your - request-map when it was 'invoke' to
your Event.

see below
<event type="java"path="org.ofbiz.learning.learning.LearningEvents"
invoke="CheckAccess "/>

"CheckAccess_" (_ a blank space)

I think it is the problem you're facing. Check it out.

- Charles TJ

==================


-----Original Message-----
From: su2 [mailto:shuchi@pexsupply.com]
Sent: 19 Agustus 2009 23:13
To: user@ofbiz.apache.org
Subject: blank screen while calling event



Hello All,

I am trying to create a screen "CheckAccess" with the event. But, when I
fire the request I get blank screen. and if I remove <event> from the
controller.xml screen,it works. I have jar class-path in ofbiz-component.xml

My event is

----------------------------------------------------------------------------
--------------------------
public static String CheckAccess(HttpServletRequest
request,HttpServletResponse response){
            Security security = (Security)request.getAttribute("security");
            String key = "_EVENT_MESSAGE_";
            if (security.hasPermission("LEARN_VIEW", request.getSession()))
            {
            request.setAttribute(key, "You have access!");
            }
            else {
            request.setAttribute(key, "You DO NOT have access! You are
denied!");
            }
            return "success";
            }

----------------------------------------------------------------------------
--------------------------

Controller.xml
----------------------------------------------------------------------------
--------------------------
<request-map uri="CheckAccess">
        <security auth="true"/>
            <event type="java"
path="org.ofbiz.learning.learning.LearningEvents" invoke="CheckAccess "/>
            <response name="success" type="view" value="CheckAccess"/>
    </request-map>

<view-map name="CheckAccess" type="screen"
page="component://learning/widget/learning/LearningScreens.xml#CheckAccess"/
>

----------------------------------------------------------------------------
--------------------------

Screen is
----------------------------------------------------------------------------
--------------------------
<screen name="CheckAccess">
        <section>
            <widgets>
                <decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="title">
                        <label text="Checking Access via Event BeanShell"/>
                    </decorator-section>
                    <decorator-section name="body">
                        <label text="This is the good screen."/> 
                        <label text="${eventMessageList[0]}"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
----------------------------------------------------------------------------
--------------------------

I would really appreciate the help.

Thank you in advance.
--
View this message in context:
http://www.nabble.com/blank-screen-while-calling-event-tp25047243p25047243.h
tml
Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

RE: blank screen while calling event

Charles Tjandra

Hi Shuchi,

Sorry, it is not in the request-map, but in your <event>
....invoke="CheckAccess "/>
"CheckAccess_" (_ a blank space)

Did you see that?


- Charles TJ


=============


-----Original Message-----
From: su2 [mailto:[hidden email]]
Sent: 19 Agustus 2009 23:46
To: [hidden email]
Subject: RE: blank screen while calling event



Sorry Thats the typo at my end but in my code there is no such blank.

Sent from the OFBiz - User mailing list archive at Nabble.com.

su2
Reply | Threaded
Open this post in threaded view
|

RE: blank screen while calling event

su2
Hi Charles,

Yeah, thats typo in my post, but in my actual code there is no such blank space in the  <event>

Thanks.
Shuchi-
Charles TJ wrote
Hi Shuchi,

Sorry, it is not in the request-map, but in your <event>
....invoke="CheckAccess "/>
"CheckAccess_" (_ a blank space)

Did you see that?


- Charles TJ


=============


-----Original Message-----
From: su2 [mailto:shuchi@pexsupply.com]
Sent: 19 Agustus 2009 23:46
To: user@ofbiz.apache.org
Subject: RE: blank screen while calling event



Sorry Thats the typo at my end but in my code there is no such blank.

Sent from the OFBiz - User mailing list archive at Nabble.com.