Topic
  • 2 replies
  • Latest Post - ‏2013-03-23T04:42:20Z by SystemAdmin
SystemAdmin
SystemAdmin
1192 Posts

Pinned topic submit button not working in signon screen

‏2013-03-20T14:35:37Z |
Hi,

I have attached a new JPEG for sign onscreen i want to display the username and password in that JPEG .i have created username and passwordfor that screen,but the problem is when i press enter button the action is not triggering, can any one give me some suggestions on this please it is urgent requirement for me...
thankyou
Updated on 2013-03-23T04:42:20Z at 2013-03-23T04:42:20Z by SystemAdmin
  • tmparker
    tmparker
    518 Posts

    Re: submit button not working in signon screen

    ‏2013-03-20T19:22:26Z  
    I'm sorry, there really isn't much here to go on. You are trying to display a username and password in a jpg? Then you are pressing enter and expecting HATS to pick this up? I'm just not sure what exactly you are doing so I can't really understand how HATS is involved. If this is not in a HATSForm tag on the page or its not in an input field then it won't get picked up is my guess.

    Thanks
    Tim
  • SystemAdmin
    SystemAdmin
    1192 Posts

    Re: submit button not working in signon screen

    ‏2013-03-23T04:42:20Z  
    • tmparker
    • ‏2013-03-20T19:22:26Z
    I'm sorry, there really isn't much here to go on. You are trying to display a username and password in a jpg? Then you are pressing enter and expecting HATS to pick this up? I'm just not sure what exactly you are doing so I can't really understand how HATS is involved. If this is not in a HATSForm tag on the page or its not in an input field then it won't get picked up is my guess.

    Thanks
    Tim
    Thanks Tim for u reply

    Actually my requirement is to create a new sign-on screen on a JPEG.In that i have attached username and password in the <HATS:Component> tag and i have
    attached a template in the sigon.evnt file in actions by using apply transformation, i have applied signon.jsp using new.jsp
    newly created jpeg, now i have a new.jsp and signon.jsp
    actually the problem comes here is the screen is repaeting when i remove the signon .jsp the action is not working the action is not triggreing
    i am sending the code snippet pls check and let me know
    Signon.evnt:

    <?xml version="1.0" encoding="UTF-8"?><event defaultHostKey="enter" description="For Expire date Purpose" type="screenRecognize">
    <actions>
    <extract ecol="80" enabled="true" erow="24" index="" indexed="false" name="ErrorMessage" overwrite="true" scol="1" shared="false" srow="24"/>
    <apply applyGlobalRules="false" enabled="true" immediateKeyset="" template="New.jsp" transformation="SignOn.jsp"/>
    </actions>
    <associatedScreens>
    <screen name="SignOn"/>
    </associatedScreens>
    <globalRules/>
    <textReplacement/>
    <description>
    <oia invertmatch="false" optional="false" status="NOTINHIBITED"/>
    <string casesense="false" col="17" invertmatch="false" optional="false" row="6" value="User " wrap="false"/>
    <string casesense="true" col="48" invertmatch="false" optional="false" row="2" value="System . . . . . :" wrap="false"/>
    <string casesense="true" col="48" invertmatch="false" optional="false" row="3" value="Subsystem . . . . :" wrap="false"/>
    <string casesense="true" col="17" invertmatch="false" optional="false" row="6" value="User " wrap="false"/>
    <string casesense="false" col="17" invertmatch="false" optional="false" row="7" value="Password " wrap="false"/>
    </description>
    <nextEvents defaultEvent=""/>
    </event>
    New.jsp:(which is mapped in sigon.evnt file apply transformation to new.jsp)


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@page import="com.ibm.hats.common.*"%><HTML LANG="en">
    <%@ page language="java" contentType="text/html; charset=UTF-8"%>
    <%@ taglib uri="hats.tld" prefix="HATS"%>

    <HEAD>
    <title><HATS:Util type="applicationName" /></title>
    <HATS:Util type="baseHref" />
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <LINK rel="stylesheet" href="../common/stylesheets/graytheme.css"
    type="text/css">
    <LINK rel="stylesheet" href="../common/stylesheets/style.css"
    type="text/css">
    <LINK rel="stylesheet"
    href="../common/stylesheets/reverseVideoWhite.css" type="text/css">
    <script language="javascript">

    function cursorWait()
    {
    //window.onbeforeunload=ChangeToHourGlass();
    document.getElementById("topcontent").style.display ='none';
    document.getElementById("loadingimgtop").style.display ='block';
    document.getElementById("loadingimg").style.display ='block';

    }
    function ChangeToHourGlass()
    {
    document.body.style.cursor ="wait";
    }

    function ChangeToNormal()
    {
    document.body.style.cursor ="default";
    }
    </script>
    <SCRIPT type="text/javascript" language="JavaScript">
    //alert('prasad');
    window.history.forward();
    function noBack() { window.history.forward(); }
    </SCRIPT>
    </HEAD>
    <BODY onbeforeunload="cursorWait();" onload="noBack();"
    onpageshow="if (event.persisted) noBack();" onunload="">
    <script type="text/javascript">
    function highlight(e) {
    //get event from browser
    if (!e) var e = window.event;
    var element = e.srcElement || e.target;
    if(element != null){
    //focus event occurs when input gains focus
    if(e.type == 'focus'){
    //store previous border color
    element.style.oldBorderColor = element.style.borderColor;
    //set new border color to specified value
    element.style.borderColor = "#ff9600";
    }
    //blur event occurs when input loses focus
    else if(e.type == 'blur'){
    //set the border color back to the original value
    element.style.borderColor = element.style.oldBorderColor;
    }
    }
    }
    function initInputs() {
    //get array with all input elements on HATS Form
    var inputs = document.HATSForm.getElementsByTagName("input");

    for (i=0; i<inputs.length; i++) {
    var attr = inputs[i].getAttribute("type");
    //assign events to inputs that are visible, text and password
    if ((attr == "text"|| attr == "password") && (attr != "hidden")) {
    //this syntax appends events instead of overwriting the current event list
    //Mozilla uses addEventListener to append events
    if(window.addEventListener) {
    inputs[i].addEventListener("focus",highlight,false);
    inputs[i].addEventListener("blur", highlight,false);
    }
    //IE uses attachEvent to append events
    else if (window.attachEvent) {
    inputs[i].attachEvent('onfocus', highlight);
    inputs[i].attachEvent('onblur', highlight);
    }
    }
    }
    }

    //use window.onload event to run function once page is loaded
    if(document.createElement) window.onload = function(){
    initInputs();
    };
    </script>
    <table width="980" height="100%" align="center" border="0"
    cellpadding="0" cellspacing="0" display="none">
    <TBODY>
    <tr>
    <td height="55">
    <table width="100%" cellspacing="0" cellpadding="0"
    background="../common/ISGNImages/LSAMS_V2.jpg" border="0">
    <tr>
    <td width="10" height="600"></td>
    <td align="right">

    </td>
    <td align="right" width="">
    <table border="0">
    <tbody>
    <tr>
    <td><HATS:Component col="17" alternate=""
    widget="com.ibm.hats.transform.widgets.FieldWidget"
    alternateRenderingSet="" erow="6"
    textReplacement="User :=,matchCase,matchLTR"
    widgetSettings=""
    type="com.ibm.hats.transform.components.FieldComponent"
    ecol="21" componentSettings="" row="6" /></td>
    <td><HATS:Component col="53" alternate="" widget="com.ibm.hats.transform.widgets.FieldWidget" alternateRenderingSet="" erow="6" textReplacement="" widgetSettings="" type="com.ibm.hats.transform.components.FieldComponent" ecol="62" componentSettings="" row="6" /></td>
    </tr>
    <tr>
    <td><HATS:Component col="17" alternate=""
    widget="com.ibm.hats.transform.widgets.FieldWidget"
    alternateRenderingSet="" erow="7"
    textReplacement="Password :=,matchCase,matchLTR"
    widgetSettings=""
    type="com.ibm.hats.transform.components.FieldComponent"
    ecol="25" componentSettings="" row="7" /></td>
    <td><HATS:Component col="53" alternate="" widget="com.ibm.hats.transform.widgets.FieldWidget" alternateRenderingSet="" erow="7" textReplacement="" widgetSettings="" type="com.ibm.hats.transform.components.FieldComponent" ecol="62" componentSettings="" row="7" /></td>
    </tr>
    </tbody>
    </table>
    <table border="0" height="56" width="270">
    <!-- flm:table -->
    <tbody>
    <tr>
    <!-- flm:cell -->
    <td height="52" width="266" align="left"><input
    type="button" name="enter" class="HATSBUTTONSignOn"
    accesskey="HATSForm" value="Sign In "
    onclick="ms('enter','HATSForm')"> <input
    type="button" name="reset" class="HATSBUTTONSignOn"
    accesskey="HATSForm" value="Reset "
    onclick="ms('reset','HATSForm')"></td>
    </tr>

    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    <tr>
    <td align="center"><HATS:Component col="1" alternate=""
    widget="com.ibm.hats.transform.widgets.ButtonWidget"
    alternateRenderingSet="" erow="23" textReplacement=""
    widgetSettings="style:|captionType:DESCRIPTION|tableRowStyleClass:|preserveColors:false|tableStyleClass:|buttonStyleClass:HATSBUTTON|separator:|layout:TABLE|trimCaptions:true|tableCellStyleClass:|columnsPerRow:6|"
    type="com.ibm.hats.transform.components.FunctionKeyComponent"
    ecol="80"
    componentSettings="delimiter:=| - |-| = |:|searchType:allDelimitersFirst|reqValueAfterDescription: |startDelimiter:PF#|F#| #=|Enter|ENTER|reqValueBeforeLeadingToken: |"
    row="23" /></td>
    </tr>
    </tbody>
    </table>

    <td class="UserText" >
    </td>
    <td class="UserText" >
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <!-- <tr>
    document.onkeydown=document.onkeypress=disableRefresh;
    <script type="text/javascript">
    document.onmousedown=disableclick;
    status="Right Click Disabled";
    Function disableclick(e)
    {
    if(event.button==2)
    {
    alert(status);
    return false;
    }
    }
    </script>
    <td Height="1"></td>
    </tr>
    <tr>
    <td Height="4" bgcolor="#DDDDDD"></td>
    </tr>
    <tr>
    <td Height="1"></td>
    </tr> -->
    <TR>
    <TD align="center">
    <table width = "100%" height = "100%" border="0" cellpadding = "0" cellspacing = "0" align="center">
    <tbody>
    <tr>
    <%
    int subLength = ((TransformInfo) request
    .getAttribute(CommonConstants.REQ_TRANSFORMINFO))
    .getGlobalVariable("test_Repeat", true).size();
    String temp = "";
    int count = 0;
    String subCheck = "false";
    //System.out.println("The length of the subfile gv is = "+subLength);
    for (int i = 0; i < subLength; i++) {
    temp = ((TransformInfo) request
    .getAttribute(CommonConstants.REQ_TRANSFORMINFO))
    .getGlobalVariable("test_Repeat", true)
    .getString(i);
    //System.out.println( ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("test_Repeat", true).getString(i));
    //if(java.util.regex.Pattern.matches("\\d*", (temp==null)?"":temp.trim())){
    if (temp.contains("=")) {
    for (int y = 0; y < temp.length(); y++) {
    if (Character.isDigit(temp.charAt(y))) {
    //System.out.println("match!!");
    count++;
    }
    }

    }
    }
    //System.out.println("Count is = "+count);
    if (count > 0) {
    subCheck = "true";
    }
    //System.out.println( ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("test_Repeat", true).getString(0));
    %>

    <td valign="top">
    <HATS:Transform skipBody="true"></HATS:Transform><script
    language="JavaScript">
    //alert("Start ");
    var count = parseInt("<%=count%>");
    //if(count > 0){

    //var str = document.HATSForm.innerHTML;
    //var patt2=/\d=a-z*/i;
    //var patt = /F\d=(A-Za-z*/i;
    //var str = "F3=Exit";
    //alert(str);
    var patt = /[F]\d*\=a-z*/ig;
    //alert(str.replace(patt,'Hahaha'));
    //document.HATSForm.innerHTML =document.HATSForm.innerHTML.replace('Opt', ' ');
    //for (var x=0; x<count; x++){
    document.HATSForm.innerHTML =document.HATSForm.innerHTML.replace(patt, ' ');
    //}

    //alert("x is "+x);
    //lert("ds22fs");
    // }

    </script>

    </td>
    </tr>
    </tbody>
    </table>
    </TD>
    </TR>
    </TBODY>
    </table>

    </BODY>
    </HTML>
    Signon.jsp:


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ page contentType="text/html; charset=utf-8"%>
    <%@ page language="java"%>
    <%@ taglib uri="hats.tld" prefix="HATS"%>
    <%@page import="com.ibm.hats.common.*"%>
    <%@page import="com.ibm.hats.transform.TransformationConstants"%>
    <%@page import="com.ibm.hats.transform.TransformationFunctions"%>
    <%@page import="javax.naming.Context" %>
    <%@page import="javax.sql.DataSource" %>
    <%@page import="javax.naming.InitialContext"%>
    <%@page import="java.sql.Connection" %>
    <%@page import="java.sql.PreparedStatement" %>
    <%@page import="java.sql.ResultSet" %>
    <%@ page import="java.util.,java.text.;" %>
    <% Connection connection = null;
    Context context = new InitialContext();

    DataSource dataSource = (DataSource) context.lookup("jdbc/lsams");
    connection = dataSource.getConnection();

    String sql = "SELECT current date FROM sysibm.sysdummy1";

    PreparedStatement statement = connection.prepareStatement(sql);
    ResultSet rs = statement.executeQuery();
    String date=null;
    // while ( rs.next() )
    // {
    rs.next();
    date=rs.getString(1);
    System.out.println(" >> DATE << " + date);
    // }

    DateFormat formatter = new SimpleDateFormat("MM/dd/yy");
    Date current_date = (Date)formatter.parse(date);
    Date expiryDate = formatter.parse("03/01/18");
    if(current_date.compareTo(expiryDate) < 0){

    %>

    <html>
    <head>
    <SCRIPT type="text/javascript" language="JavaScript">
    //alert('prasad');
    window.history.forward();
    function noBack() { window.history.forward(); }
    </SCRIPT>
    <meta name="GENERATOR" content="IBM WebSphere Studio">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript">
    function TrapEscapeKey()
    {
    if (window.event.keyCode == 27)
    {
    window.event.cancelBubble = true;
    return false;
    }
    }
    </script>
    <HATS:VCTStylesLink />
    </head>
    <body onkeydown="TrapEscapeKey()" onload="noBack();"
    onpageshow="if (event.persisted) noBack();" onunload="">
    <script type="text/javascript" src="../common/env.js">
    </script>

    <script type="text/javascript" src="../common/lxgwfunctions.js">
    portletID="hatsportletid";activeID="default";formID="HATSForm";
    </script>

    <script type="text/javascript" src="../common/KBS.js">
    PortletKBInited=false;
    </script>

    <script type="text/javascript" src="../common/HatsJS.js">
    </script>

    <!-- Start of the HATS form. -->
    <%
    String row01 = ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getHostScreen().GetString(1,80);
    String row5 = ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getHostScreen().GetString(4*80,80);

    if(request.getSession().getAttribute("refreshed1") == null){
    request.getSession().setAttribute("refreshed1","0");
    }
    if(row01.contains("SRV553E-04") && row5.contains("Select User") && request.getSession().getAttribute("refreshed1").toString().equals("0"))
    {
    request.getSession().setAttribute("refreshed1","1");
    %>
    <script type="text/javascript" >
    setTimeout("ms('pf5','hatsportletid');",500);
    </script>
    <%
    }
    else if(row01.contains("SRV553E-04") && !row5.contains("Select User")){
    request.getSession().setAttribute("refreshed1","0");

    }
    %>
    <HATS:Form>
    <table width="980" height="100%" align="center" border="0"
    cellpadding="0" cellspacing="0">
    <TBODY>
    <tr>
    <td height="55">
    <table width="100%" cellspacing="0" cellpadding="0"
    background="../common/ISGNImages/LSAMS_V2.jpg" border="0">
    <tr>
    <td width="10" height="600"></td>
    <td align="right">

    </td>
    <td align="right" width="">
    <table border="0">
    <tbody>
    <tr>
    <td><HATS:Component col="17" alternate=""
    widget="com.ibm.hats.transform.widgets.FieldWidget"
    alternateRenderingSet="" erow="6"
    textReplacement="User :=,matchCase,matchLTR"
    widgetSettings=""
    type="com.ibm.hats.transform.components.FieldComponent"
    ecol="21" componentSettings="" row="6" /></td>
    <td><HATS:Component col="53" alternate="" widget="com.ibm.hats.transform.widgets.FieldWidget" alternateRenderingSet="" erow="6" textReplacement="" widgetSettings="" type="com.ibm.hats.transform.components.FieldComponent" ecol="62" componentSettings="" row="6" /></td>
    </tr>
    <tr>
    <td><HATS:Component col="17" alternate=""
    widget="com.ibm.hats.transform.widgets.FieldWidget"
    alternateRenderingSet="" erow="7"
    textReplacement="Password :=,matchCase,matchLTR"
    widgetSettings=""
    type="com.ibm.hats.transform.components.FieldComponent"
    ecol="25" componentSettings="" row="7" /></td>
    <td><HATS:Component col="53" alternate="" widget="com.ibm.hats.transform.widgets.FieldWidget" alternateRenderingSet="" erow="7" textReplacement="" widgetSettings="" type="com.ibm.hats.transform.components.FieldComponent" ecol="62" componentSettings="" row="7" /></td>
    </tr>
    </tbody>
    </table>

    <table border="0" height="56" width="268"><!-- flm:table -->
    <tbody>
    <tr><!-- flm:cell --><td height="52" width="264" align="left"><input type="button" name="enter"
    class="HATSBUTTONSignOn" accesskey="HATSForm" value="Sign In "
    onclick="ms('enter','HATSForm')">

    <input type="button" name="reset" class="HATSBUTTONSignOn"
    accesskey="HATSForm" value="Reset "
    onclick="ms('reset','HATSForm')">

    </td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    <tr><td align="center"><%= ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("ErrorMessage", true).getString(0) %></td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    <tr>
    <td align="center"><HATS:Component col="1" alternate=""
    widget="com.ibm.hats.transform.widgets.ButtonWidget"
    alternateRenderingSet="" erow="23" textReplacement=""
    widgetSettings="style:|captionType:DESCRIPTION|tableRowStyleClass:|preserveColors:false|tableStyleClass:|buttonStyleClass:HATSBUTTON|separator:|layout:TABLE|trimCaptions:true|tableCellStyleClass:|columnsPerRow:6|"
    type="com.ibm.hats.transform.components.FunctionKeyComponent"
    ecol="80"
    componentSettings="delimiter:=| - |-| = |:|searchType:allDelimitersFirst|reqValueAfterDescription: |startDelimiter:PF#|F#| #=|Enter|ENTER|reqValueBeforeLeadingToken: |"
    row="23" /></td>
    </tr>

    </tbody>
    </table>
    <%
    int subLength = ((TransformInfo) request
    .getAttribute(CommonConstants.REQ_TRANSFORMINFO))
    .getGlobalVariable("test_Repeat", true).size();
    String temp = "";
    int count = 0;
    String subCheck = "false";
    //System.out.println("The length of the subfile gv is = "+subLength);
    for (int i = 0; i < subLength; i++) {
    temp = ((TransformInfo) request
    .getAttribute(CommonConstants.REQ_TRANSFORMINFO))
    .getGlobalVariable("test_Repeat", true)
    .getString(i);
    //System.out.println( ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("test_Repeat", true).getString(i));
    //if(java.util.regex.Pattern.matches("\\d*", (temp==null)?"":temp.trim())){
    if (temp.contains("=")) {
    for (int y = 0; y < temp.length(); y++) {
    if (Character.isDigit(temp.charAt(y))) {
    //System.out.println("match!!");
    count++;
    }
    }

    }
    }
    //System.out.println("Count is = "+count);
    if (count > 0) {
    subCheck = "true";
    }
    //System.out.println( ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("test_Repeat", true).getString(0));
    %>
    <%
    int size = ((TransformInfo) request
    .getAttribute(CommonConstants.REQ_TRANSFORMINFO))
    .getGlobalVariable("checkFunctionKeysPopUp", true)
    .size();
    System.out.println("The size of checkFunctionKeysPopUp is = "
    + size);
    %>

    <script language="JavaScript">
    //alert("Start ");
    var count = parseInt("<%=count%>");
    //if(count > 0){

    //var str = document.HATSForm.innerHTML;
    //var patt2=/\d=a-z*/i;
    //var patt = /F\d=(A-Za-z*/i;
    //var str = "F3=Exit";
    //alert(str);
    var patt = /[F]\d*\=a-z*/ig;
    //alert(str.replace(patt,'Hahaha'));
    //document.HATSForm.innerHTML =document.HATSForm.innerHTML.replace('Opt', ' ');
    //for (var x=0; x<count; x++){
    document.HATSForm.innerHTML =document.HATSForm.innerHTML.replace(patt, ' ');
    //}

    //alert("x is "+x);
    //lert("ds22fs");
    // }

    </script>

    </HATS:Form>

    </body>
    </html>
    <% } else {
    System.out.println("current_date " + date + " is after expiryDate 10/29/12");
    System.out.println(" ============ License Expired ============ ");
    %>
    <html>
    <head></head>
    <script language=javascript>
    function disableRefresh(netscape){
    var F5=(netscape||event).keyCode;
    if(F5==116 || F5==82){
    if(!netscape){event.keyCode=0}
    return false;
    }
    }
    document.onkeydown=document.onkeypress=disableRefresh;
    </script>
    <script type="text/javascript">
    document.onmousedown=disableclick;
    status="Right Click Disabled";
    Function disableclick(e)
    {
    if(event.button==2)
    {
    alert(status);
    return false;
    }
    }
    </script>

    <body oncontextmenu="return false">
    <table border="1" style="background-color:#0191C8;border:1px dotted black;width:100%;border-collapse:collapse;">
    <tr style="background-color:orange;color:white;">
    <td>
    </td>
    </tr>
    <tr align="center">
    <td style="width:100%;">


    ============ License Expired ============



    Please contact ISGN

    </td>
    </tr>
    </table>

    </body>
    </html>
    <%
    }
    %>