[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Thin Client: blocking screen when htjscall component is used  XML
Forum Index -> Development
Author Message
kretzler

Power User

Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline

Hello,

I am using the htjscall component to generate a key pair. It takes ~1s before the callback method is called. Is it possible to block during this time the screen. The user should not have the possibility to click somewhere.

Or is it possible to block the screen 'manually'. So that the programmer can decide how long the screen is blocked?


Thanks,
Ralph
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

We can open up the API on client side - will be in the docuemntation of next week.
Björn

Björn Müller, CaptainCasa GmbH
kretzler

Power User

Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline

Hello,

I used the following code to darken the page and to dark the page works fine.

JSP:
<t:htjscall id="g_18" jscode="#{wp.VerifyUserBean.jscodeDarken}" />


Bean:
protected void darken(final boolean isDark) {
m_jscodeDarken = "ccDarken(" + isDark + ")";
PhaseManager.runAfterRenderResponsePhase(new Runnable() {
public void run() {
m_jscodeDarken = null;
}
});
}

private String m_jscodeDarken;
public String getJscodeDarken() { return m_jscodeDarken; }


The problem is that my screen and my program seems to be frozen. I do not get any answer from my jscall after darkening the screen manually.


Any ideas?

Thanks,
Ralph
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

Hi Ralph,

as I understand... you send some JavaScript to the frontend, e.g:

Code:
 ccDarken(true);
 


Well, this is executed in the frontende - the screen is darkened, i.e. the dark-transparent-foreground-DIV is put on top of the screen. Result: the screen is darkened and all mouse events are caught by this DIV. ==> the screen is frozen. So, from my perspective the system behaves right...! (?)

What do you want to do? Darken the screen.... and then?

Björn

Björn Müller, CaptainCasa GmbH
kretzler

Power User

Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline

sorry for that inaccurate description.

What I want to do is.
-block the screen, call ccDarken(true)
-read information from card, call readCard() (is a JavaScript call too)
-unblock screen in the callback method from the second JavaScript function readCard()

The problem is that the callback method from readCard() is never called when the darken function is called first. It has nothing to do if the screen is darken or not.


JSP:
Code:
 <t:htjscall id="g_17" actionListener="#{wp.VerifyUserBean.onJsCallBack}" jscode="#{wp.VerifyUserBean.jscode}" resulttext="#{wp.VerifyUserBean.jsResult}" />
 <t:htjscall id="g_18" jscode="#{wp.VerifyUserBean.jscodeDarken}" />
 


Bean:
Code:
     // user clicks on Button
     public void onVerifyUser(final ActionEvent event) {
         darken(true);  // javascript to darken the screen
         readCard();  // another javascript function
     }
 
 
     protected void darken(final boolean isDark) {
         m_jscodeDarken = "ccDarken(" + isDark + ")"; 
         PhaseManager.runAfterRenderResponsePhase(new Runnable() {
             public void run() {
                 m_jscodeDarken = null;
             }
         });
     }
     private String m_jscodeDarken;
     public String getJscodeDarken() { return m_jscodeDarken; }
 
 
 
     private void readCard() {
         m_jscode = "parent.ccGetLogonString('" + m_pin + "')";
         PhaseManager.runAfterRenderResponsePhase(new Runnable() {
             public void run() {
                 m_jscode = null;
             }
         });
     }
     private String m_jscode;
     public String getJscode() { return m_jscode; }
     private String m_jsResult;
     public String getJsResult() { return m_jsResult; }
     public void setJsResult(final String value) { m_jsResult = value; }
     public void onJsCallBack(final ActionEvent event) {
         // if javascript function darken is called first I never come into this callback method
     }
 
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

...well, now ugly JavaScript "debugging" starts...
User alert("dfsdfds") in order to check how far your program is coming on fron ent side...

Björn

Björn Müller, CaptainCasa GmbH
kretzler

Power User

Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline

hmm, my JavaScript function is never called when darken is called first

function ccGetLogonString(pin) {
window.alert("aa");
var result = new Object();
document.SCardApplet.addParameter(pin);
var logonString = document.SCardApplet.callMethod('getLogonString');
result.callback = true;
result.returnvalue = logonString;
window.alert("bb");
return result;
}
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

...problem is solved in the meantime: the component HTJSCALL was used twice within the corresponding page. The component MUST only be used once: otherwise two JavaScript methods will be generated with the same name.

Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team