Javascript and JSF

I am using javascript to try and populate a page with data from a row that is double-clicked.
I am using the following javascript to output the contents of the row but i want the contents of the row to populate another page when it is double clicked. Can anyone help with this? Or suggest what i change in the javascript i am using?
Thanks.
<script>
function myhandler(){
alert(value="#{RouteHandler.carrierCode}");
alert(value="#{RouteHandler.departureAirport}");
alert(value="#{RouteHandler.arrivalAirport}");
this.style.backgroundColor='#ffffff';
</script>
I am calling the javascript function in the following dataTable:
t:dataTable id="routeList" value="#{RouteHandler.routeList}" var="rowElement" cellspacing="0" cellpadding="3"
ondblclick="javascript:myhandler()" border="0" headerClass="listhead" columnClasses="listresults" bgcolor="#FFFFFF">
<t:column width="104">
<h:outputText value="#{rowElement.carrierCode}" />
</t:column>
<t:column width="165">
<h:outputText value="#{rowElement.departureAirport}" />
</t:column>
<t:column width="920">
<h:outputText value="#{rowElement.arrivalAirport}" />
</t:column>
</t:dataTable>

If you want javascript itself, then how about this:
     function testDblClick() {
          var evt = window.event;
          var destElement = evt.srcElement;
          if(destElement.tagName == 'BODY') return;
          var parentEle = destElement.parentNode;
          while(parentEle.tagName != "TR") {
               parentEle = parentEle.parentNode;
               if(parentEle == null) break;
          var msg = '';
          var childNode = null;
          for(var i=0;i<parentEle.childNodes.length;++i) {
               childNode = parentEle.childNodes;
               msg += parentEle.childNodes[i].innerHTML + " | ";
          if(msg != '') alert(msg);
code}
At the end of you JSP page inculde this code:
document.ondblclick = testDblClick;

Similar Messages

  • JAVASCRIPT AND JSF PROBLEM REFRESHING PAGE PROBLEM

    Hello everyone, I am currently using visual JSF and javascript to to disable a fileupload component when a radio button is clicked. I don't have any problems getting it to work if I need to disable a button, a textfield or other visual JSF components. For some reason, i can't disable the fileupload component and I get this error when the JAVASCRIPT is called:
    Error: document.getElementById("form1:fileUpload1").refresh is not a function
    Source File: http://localhost:8080/TestSingleEvent/theme/com/sun/webui/jsf/suntheme4_2-080320/javascript/webui.js
    Line: 22
    My javascript code is the following:
    document.getElementById("form1:fileUpload1").refresh("form1:radioButton1");return false;
    I would appreciate some help here. Why is it that when I replace the fileUpload with i.e a textfield i don't get errors..
    Is it something to do with the webui.js ?
    Many thanks.

    There is no such thing as refresh() in the [DOM element|http://developer.mozilla.org/en/DOM/element]. How did you come to this? Did you a wild guess in the around without reading the docs? Don't do that.
    What exactly do you want to achieve? Reset its value? Then set the 'value' property to null. Disable the element? Then set the 'disabled' property to true.
    I've been helpful enough with this offtopic question. If you still stucks, please continue at a Javascript oriented forum. There's one at under each webdeveloper.com.

  • Facelets and jsf-extensions problem.

    I'm fairly certain I've run into a problem between facelets and jsf-extensions. I'm working with JSF 1.2 RI, Woodstock, Facelets 1.1.13, on Tomcat 6.
    When trying to get Woodstock autoValidation to work I get a javascript error the "I has no properties". The error occurs in the com_sun_faces_ajax.js file in the jsf-extensions-dynamic-faces-0.1.jar (I've used both the RC4 and a build today ,10/18/07 from source with the same results). Here is the code snippet where it happens (with my comment).
    var I = G.getElementsByTagName("components")[0];
    var C = I.getElementsByTagName("render");
    for(var F = 0; F < C.length; F++) {
    In the second line there it looks like the variable I is null, but based on the post response below I don't know why.
    The response from the post looks like this:
    <partial-response><components><render id="PayableForm:vendorGci"><markup><![CDATA[{"valid":true,"id":"PayableForm:vendorGci"}]]></markup></render></components>
    However the server side code (validation method) never gets executed. I'm willing to do some digging and debug work, but I'd need to be pointed in the right direction.
    The following is more potentially useful code snippets.
    Here is the textField code:
    <w:form id="PayableForm">
    <w:textField style="display:none;" />
    <w:message for="vendorGci" />
    <w:label id="vendorGciLabel" for="vendorGci" text="Vendor: " />
    <w:textField id="vendorGci" autoValidate="true"
    text="${vendorBean.searchGci}" maxlength="8" required="true"
    validatorExpression="#{ vendorBean.validateVendor}" />
    Here is the javascript in the page (the init function is called from the body: onLoad="setTimeout('init();', 0);" , this does happen):
    <w:script type="text/javascript">
    function VendorListener(){
    function VendorNotify(props){
    alert("VendorNotify called!"); <--------------- I never see this alert message
    if ( props.id != "PayableForm:vendorGci") { return; }
    var field = document.getElementById("PayableForm:vendorGciLabel");
    field.setProps({
    valid: props.valid
    VendorListener.prototype.notify = VendorNotify;
    function initAccountRows(){
    var table = document.getElementById("PayableForm:vendorAccountTable");
    table.initAllRows();
    function init(){
    initAccountRows();
    var listener = new VendorListener();
    dojo.subscribe(
    webui.suntheme.widget.textField.event.validation.endTopic ,
    listener, listener.notify);
    Here is the validator method. It currently doesn't do anything, just trying to get something to work. I never see the output, and I never hit the breakpoint in the method.
    public void validateVendor(FacesContext context, UIComponent comp, Object value){
    System.out.println("**********************************");
    System.out.println("validateVendor called");
    System.out.println(value);
    System.out.println("**********************************");
    }

    Actually I don't need a global variable. I need to refer in my included template the actual backing bean used in the current page. As all my backing bean extends a abstract class I could bind my component to a property of the current backing bean, no matters which one. Just like a polymorphic call but without the parameter. Let's imagine I could get this object of the facesContext object I would be able to do:
    <rich:datascroller renderIfSinglePage="false" align="right" for="listagem" maxPages="12" fastStep="10"
    pageIndexVar="pageIndex" pagesVar="pages" stepControls="show" fastControls="hide" boundaryControls="show"
    inactiveStyleClass="paginacaoInativa" selectedStyleClass="paginacaoSelecionada"
    styleClass="paginacao" tableStyleClass="paginacaoTabela"
    binding="#{facesContext.currentBackingbean.formDataScroller}" id="paginacao">
    Instead of pass the backing bean to the ui:param of this template... Dou you get the point?

  • Struts and JSF Integration in OPDk-java based portlet

    Hi,
    thanks in advance for your help.
    I'm developing a PDK java based portlet. For some reasons I cannot use the JSF bridge but I would like to integrate Struts and Jsf in my portlet, using Struts to manage actions and navigation and JSF (with ADF Faces components) for the view. I'm using the Strus-Faces library.
    When I try to submit my portlet form, I receive the error "request URL not found on this server". I'm posting some exstracts of my code.
    It's made of three pages: the main one "Integration1ShowPage", "error" and "result". The MainAction.java displays my mainPage, where there's a form. To keep it easy, when the user submits this form, the ActionName returns "success" and the "result" page should be displayed.
    The MainAction works properly: the portlet is displayed but when I tried to submit the form I receive
    The requested URL /provaDeploy/htdocs/integration1/integration1ShowPage.do was not found on this server.Could you please suggest me something?
    Many many thanks,
    B.
    <struts-config>
    <action-mappings>
      <action path = "/mainAction" type = "strutsjsfintegration1.MainAction">
        <forward name = "success" path = "/faces/htdocs/integration1/integration1ShowPage.faces"/>
      </action>
      <action path = "/nameAction" name = "nameForm"
      input = "/faces/htdocs/integration1/integration1ShowPage.faces" scope = "request"
      type = "strutsjsfintegration1.NameAction">
        <forward name = "success" path = "/faces/htdocs/integration1/result.faces"/>
        <forward name = "failure" path = "/faces/htdocs/integration1/error.faces"/>
        <forward name = "again" path = "faces/htdocs/integration1/integration1ShowPage.faces"/>
      </action>
    </action-mappings>
    <controller>
      <set-property property = "processorClass"
       value="org.apache.struts.faces.application.FacesRequestProcessor"/>
       </controller>
    <message-resources parameter="definitiveStrutsPortlet.ApplicationResources"/>
    </struts-config>

    Hi,
    have a look at this whitepaper for how to use JavaScript in ADF.
    http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    This link here (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html --> see sample 71) shows an integration sample between a Java Applet and ADF. Its a similar use case to yours
    Frank

  • Mixing Non JSF and JSF components

    Hi All,
    I wanted to mix non jsf and jsf components and I able to do this
      <f:verbatim>
                                    <input type="radio" name="selectBidder" value="#{currentRow['BID_ID]}"/>
                                </f:verbatim>But the problem is bean value is not getting binded.
    The rendered output is containing same string i.e.
    value="#{currentRow['BID_ID]}"
    How to bind bean value to non jsf component.
    And No Javascript please
    Thanks
    Sudhakar

    Basically I am trying to implement something like below
    <h:dataTable binding="#{consumer$Select_Provider.dataTable1}" headerClass="list-header" id="dataTable1"
                            rowClasses="list-row-even,list-row-odd" style="left: 48px; top: 48px; position: absolute"
                            value="#{consumer$Select_Provider.dataTable1Model}" var="currentRow">
                            <h:column binding="#{consumer$Select_Provider.column6}" id="column6">
                                <h:outputText binding="#{consumer$Select_Provider.outputText11}" id="outputText11" value="#{currentRow['USER_LNAME']} #{currentRow['USER_FNAME']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{consumer$Select_Provider.outputText12}" id="outputText12" value="Bidder"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{consumer$Select_Provider.column1}" id="column1">
                                <h:outputText binding="#{consumer$Select_Provider.outputText1}" id="outputText1" value="#{currentRow['BID_PRICE']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{consumer$Select_Provider.outputText2}" id="outputText2" value="Bid Price"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{consumer$Select_Provider.column3}" id="column3">
                                <f:verbatim>
                                    <input name="selectBidder" type="radio" value="#{currentRow['BID_ID]}"/>
                                </f:verbatim>
                                <f:facet name="header">
                                    <h:outputText binding="#{consumer$Select_Provider.outputText6}" id="outputText6" value="Select Bidder"/>
                                </f:facet>
                            </h:column>
                        </h:dataTable>Thanks
    Sudhakar

  • JavaFx and JSF

    Hello,
    Is it all right to use JavaFX with JSF. Any problems can be experienced getting JavaFx and JSF work together.
    Regards

    My problem is before the client-server communication starts. I have to pass some information to the standalone JavaFX application from a web application. These information is needed to load specific data from the backend. On the startup of the application I could use the jnlp properties, but if the user does another selection in the web application and the JavaFX application is already open, I have to provide the selection to the JavaFX app. This inter process communication could be completely on the client side I think. So I have seen that ActiveMQ provides a javascript api to send JMS messages. Probably this could be a solution if it is possible to set up the JMS queue on client without application server. I do not know if this is possible by now.

  • I am trying to use java  file as Model layer and jsf as presentation layer

    I am trying to use java file as Model layer and jsf as presentation layer and need some help
    I successfully get the value of h:outputText from java file by doing simple binding operation but I am facing problems when I am trying to fill h:dataTable
    I create java file
    package oracle.model;
    import java.sql.;*
    import java.util.;*
    *public class TableBean {*
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    *public List getperInfoAll() {*
    perInfoAll.add(0,new perInfo("name","username","blablabla"));
    return perInfoAll;
    *public class perInfo {*
    String uname;
    String firstName;
    String lastName;
    *public perInfo(String firstName,String lastName,String uname) {*
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    *public String getUname() {*
    return uname;
    *public String getFirstName() {*
    return firstName;
    *public String getLastName() {*
    return lastName;
    right click on the file and choose 'create data control'
    then i wrote the jsf file:
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<f:view>*
    *<h:dataTable id="dt1" value="#{bindings.perInfoAll}"*
    var="item" bgcolor="#F1F1F1" border="10"
    cellpadding="5" cellspacing="3" rows="4" width="50%"
    dir="LTR" frame="hsides" rules="all"
    *>*
    *<f:facet name="header">*
    *<h:outputText value="This is 'dataTable' demo" id="ot6"/>*
    *</f:facet>*
    *<h:column id="c2">*
    *<f:facet name="header">*
    *<h:outputText value="First Name" id="ot1"/>*
    *</f:facet>*
    *<h:outputText style="" value="#{item.firstName}"*
    id="ot2"/>
    *</h:column>*
    *<h:column id="c4">*
    *<f:facet name="header">*
    *<h:outputText value="Last Name" id="ot9"/>*
    *</f:facet>*
    *<h:outputText value="#{item.lastName}" id="ot8"/>*
    *</h:column>*
    *<h:column id="c3">*
    *<f:facet name="header">*
    *<h:outputText value="Username" id="ot7"/>*
    *</f:facet>*
    *<h:outputText value="#{item.uname}" id="ot4"/>*
    *</h:column>*
    *<f:facet name="footer">*
    *<h:outputText value="The End" id="ot3"/>*
    *</f:facet>*
    *</h:dataTable>*
    *</center>*
    *</af:document>*
    *</f:view>*
    but nothing is appear in my table
    I know that there is something wrong in calling the binding object
    I need help pls and where can i find some help to deal with another tag types
    thanks

    i dragged the "perInfoAll" from my "Data Controls" and choosed adf table (even I know that new table with adf tags well be generated and i want table with jsf tags)
    and this code is generated
    *<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"*
    *"http://www.w3.org/TR/html4/loose.dtd">*
    *<%@ page contentType="text/html;charset=UTF-8"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>*
    *<f:view>*
    *<af:document id="d1">*
    *<af:messages id="m1"/>*
    *<af:form id="f1">*
    *<af:table value="#{bindings.perInfoAll1.collectionModel}" var="row"*
    *rows="#{bindings.perInfoAll1.rangeSize}"*
    *emptyText="#{bindings.perInfoAll1.viewable ? 'No data to display.' : 'Access Denied.'}"*
    *fetchSize="#{bindings.perInfoAll1.rangeSize}"*
    *rowBandingInterval="0"*
    *selectionListener="#{bindings.perInfoAll1.collectionModel.makeCurrent}"*
    *rowSelection="multiple" id="t1">*
    *<af:column sortProperty="uname" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.uname.label}"*
    *id="c1">*
    *<af:inputText value="#{row.bindings.uname.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.uname.label}"*
    *required="#{bindings.perInfoAll1.hints.uname.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.uname.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.uname.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.uname.tooltip}"*
    *id="it3">*
    *<f:validator binding="#{row.bindings.uname.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="firstName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.firstName.label}"*
    *id="c2">*
    *<af:inputText value="#{row.bindings.firstName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.firstName.label}"*
    *required="#{bindings.perInfoAll1.hints.firstName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.firstName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.firstName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.firstName.tooltip}"*
    *id="it2">*
    *<f:validator binding="#{row.bindings.firstName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="lastName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.lastName.label}"*
    *id="c3">*
    *<af:inputText value="#{row.bindings.lastName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.lastName.label}"*
    *required="#{bindings.perInfoAll1.hints.lastName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.lastName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.lastName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.lastName.tooltip}"*
    *id="it1">*
    *<f:validator binding="#{row.bindings.lastName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *</af:table>*
    *</af:form>*
    *</af:document>*
    *</f:view>*
    but when run it i see the following errors
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    :(

  • How to integrate Single Sign-On and JSF?

    Hi all,
    We are going to develop a web application using Oracle technologies, including ADF and JSF.
    But we´ll need to secure our website using Oracle Identity Manager (Single Sign-On). I am having difficulties to find any resource explaining how to do that.
    Also, the IM (SSO) will run on a Oracle AS instance and our web app (ADF+JSF) will run on a separete OC4J instance, due to ADF version. Is this a problem?
    Thanks

    We too are in the process of implementing iStore with SSO features.
    And if you believe me it seems to me as nightmare.
    In our scenerio we are intgrating this SSO with Third party access control too (AD and Siteminder). I would request you to please respond me on the following mail id , so we can share our experince which will help us in our implementation
    [email protected]
    regards and thanks in advance
    Vikas Deep

  • COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET: US$20 AWARD FOR SOLUTION!

    COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET PROBLEM (Easy Filter Java Applet) -
    US$20 TO ANYONE WHO CAN RESOLVE THE PROBLEM
    To forum visitors:
    I am prepared to pay a standard shareware fee of US$20 to a user who can resolve this technical problem.
    If your advice resolves the problem, I'll forward the payment to your postal address (include your
    address with your reply, and also your email address)
    I am attempting to enable a HTML button (using Javascript's onClick command) to directly input a number into one of the parameter text boxes in the Easy Filter Java applet (ie, enter a new color value number in the text field of the standard Colors Multiplicator Filter interface).
    The applet is Freeware and can be downloaded at: http://www.javazoom.net/applets/easyfilter10/EasyFilter10.html
    (It is a very effective bitmap display and editing utility)
    To achieve this, I am trying to access the part of the applet that defines and sets the textbox. The text box is defined in the .class file by accessing the parameter details in the genericfilter.txt file (accompanies the .class files). I need to access 'private String appletInitialize()' and then one of the 'textFieldParameters' which sets the textbox.
    I understand the basic syntax for referencing the applet:
    document.appletname.setString("An example"). However, accessing the text fields in this applet is more complex!!
    Please can you recommend the correct Javascript syntax to achieve communication with the applet.
    Thank you for your kind assistance.
    JM Graham
    [email protected]
    The Java source code for the applet: EasyFilter.class
    # Easy Filter - E.B/JavaZOOM 1999 #
    # Contact: [email protected] #
    # http://javazoom.hypermart.net #
    /* Originally compiled from EasyFilter.java */
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.applet.Applet;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.image.MemoryImageSource;
    import java.awt.image.PixelGrabber;
    import java.util.Vector;
    public synchronized class EasyFilter extends Applet implements KeyListener
    private String paramFileName;
    private Color bgColor;
    private Color fgColor;
    private Color parColor;
    private Color sepColor;
    private Color titleColor;
    private Color helpColor;
    private int WinWidth;
    private int WinHeight;
    private String title;
    private String logoFileName;
    private String originalImageFileName;
    private String filteredCaption;
    private String originalCaption;
    private Vector paramsName;
    private Vector paramsValue;
    private Vector paramsComment;
    private Panel panelParameters[];
    private Label labelParameters[];
    private TextField textFieldParameters[];
    private Label labelComments[];
    private int nbParameters;
    private ScrollPane scrollPaneParams;
    private Panel panelParams;
    private Image theLogo;
    private Image theOriginalImage;
    private Image theFilteredImage;
    private int theOriginalPixelArray[];
    private int logoWidth;
    private int logoHeight;
    private int imageWidth;
    private int imageHeight;
    private drawCanvas canvasTitle;
    private Panel panelTitle;
    private Label labelTitle;
    private Panel panelImages;
    private Panel panelOriginalImage;
    private drawCanvas canvasOriginalImage;
    private Label labelOriginalImage;
    private Panel panelFilteredImage;
    private drawCanvas canvasFilteredImage;
    private Label labelFilteredImage;
    private Panel panelHelp;
    private Label labelHelp;
    private int Yspc;
    private FilterImplementation theFilter;
    public void init()
    String string = null;
    string = appletInitialize();
    setBackground(bgColor);
    if (string != null)
    removeAll();
    setBackground(Color.white);
    setForeground(Color.black);
    Label label = new Label(new StringBuffer("Error: ").append(string).toString(), 1);
    Panel panel = new Panel();
    panel.add(label);
    add(panel);
    setLayout(new FlowLayout(1, 5, Yspc));
    public void keyPressed(KeyEvent keyEvent)
    panelHelp.removeAll();
    boolean flag = true;
    if (KeyEvent.getKeyText(keyEvent.getKeyCode()).equals("Enter"))
    for (int i = 0; i < nbParameters; )
    try
    paramsValue.setElementAt(new Double(textFieldParameters.getText()), i);
    i++;
    catch (NumberFormatException e)
    labelHelp.setText(labelParameters[i].getText() + ": Not a Number");
    flag = false;
    break;
    if (flag == 1)
    labelHelp.setText(" .... Running, please wait .... ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    theFilter.updateParameters(paramsValue);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    canvasFilteredImage.repaint();
    panelHelp.removeAll();
    labelHelp.setText("- Done -");
    else
    labelHelp.setText("- Press Enter to run the Filter -");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    public void keyReleased(KeyEvent keyEvent)
    public void keyTyped(KeyEvent keyEvent)
    private String appletInitialize()
    WinWidth = size().width;
    WinHeight = size().height;
    if (getParameter("bgcolor") == null)
    bgColor = new Color(0, 0, 40);
    else
    bgColor = new Color(Integer.parseInt(getParameter("bgcolor"), 16));
    if (getParameter("fgcolor") == null)
    fgColor = new Color(255, 255, 255);
    else
    fgColor = new Color(Integer.parseInt(getParameter("fgcolor"), 16));
    if (getParameter("sepcolor") == null)
    sepColor = new Color(158, 128, 128);
    else
    sepColor = new Color(Integer.parseInt(getParameter("sepcolor"), 16));
    if (getParameter("parcolor") == null)
    parColor = new Color(24, 24, 24);
    else
    parColor = new Color(Integer.parseInt(getParameter("parcolor"), 16));
    if (getParameter("titlecolor") == null)
    titleColor = new Color(255, 255, 0);
    else
    titleColor = new Color(Integer.parseInt(getParameter("titlecolor"), 16));
    if (getParameter("helpcolor") == null)
    helpColor = new Color(0, 255, 255);
    else
    helpColor = new Color(Integer.parseInt(getParameter("helpcolor"), 16));
    paramsName = new Vector();
    paramsValue = new Vector();
    paramsComment = new Vector();
    paramFileName = getParameter("paramfile");
    String string = readParams(paramFileName);
    if (string != null)
    return string;
    MediaTracker mediaTracker = new MediaTracker(this);
    theOriginalImage = getImage(getDocumentBase(), originalImageFileName);
    mediaTracker.addImage(theOriginalImage, 0);
    if (logoFileName != null)
    theLogo = getImage(getDocumentBase(), logoFileName);
    mediaTracker.addImage(theLogo, 1);
    try
    mediaTracker.waitForAll();
    catch (InterruptedException e1)
    return "Error while loading image";
    if (mediaTracker.isErrorAny())
    return "Error while loading image";
    if (logoFileName != null)
    logoWidth = theLogo.getWidth(this);
    logoHeight = theLogo.getHeight(this);
    imageWidth = theOriginalImage.getWidth(this);
    imageHeight = theOriginalImage.getHeight(this);
    theOriginalPixelArray = new int[imageWidth * imageHeight];
    PixelGrabber pixelGrabber = new PixelGrabber(theOriginalImage, 0, 0, imageWidth, imageHeight, theOriginalPixelArray, 0, imageWidth);
    try
    pixelGrabber.grabPixels();
    panelTitle = new Panel();
    canvasTitle = new drawCanvas();
    labelTitle = new Label();
    panelTitle.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelTitle);
    panelTitle.setBackground(bgColor);
    panelTitle.add(canvasTitle);
    canvasTitle.setImage(theLogo);
    canvasTitle.setBounds(0, 0, logoWidth, logoHeight);
    labelTitle.setText(title);
    catch (InterruptedException e2)
    return "Internal Error, Try RELOAD !";
    if (title != null)
    panelTitle.add(labelTitle);
    labelTitle.setForeground(titleColor);
    labelTitle.setFont(new Font("Dialog", 1, 14));
    panelImages = new Panel();
    panelOriginalImage = new Panel();
    canvasOriginalImage = new drawCanvas();
    labelOriginalImage = new Label();
    panelFilteredImage = new Panel();
    canvasFilteredImage = new drawCanvas();
    labelFilteredImage = new Label();
    panelImages.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelImages);
    panelImages.setBackground(bgColor);
    panelOriginalImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelOriginalImage);
    panelOriginalImage.setBackground(Color.black);
    panelOriginalImage.add("Center", canvasOriginalImage);
    canvasOriginalImage.setImage(theOriginalImage);
    canvasOriginalImage.setBounds(0, 0, imageWidth, imageHeight);
    labelOriginalImage.setText(originalCaption);
    labelOriginalImage.setAlignment(1);
    panelOriginalImage.add("South", labelOriginalImage);
    labelOriginalImage.setBackground(Color.lightGray);
    labelOriginalImage.setForeground(Color.black);
    labelOriginalImage.setFont(new Font("SansSerif", 0, 10));
    panelFilteredImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelFilteredImage);
    panelFilteredImage.setBackground(Color.black);
    panelFilteredImage.add("Center", canvasFilteredImage);
    theFilter = new FilterImplementation(paramsValue, theOriginalPixelArray, imageWidth, imageHeight);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    labelFilteredImage.setText(filteredCaption);
    labelFilteredImage.setAlignment(1);
    panelFilteredImage.add("South", labelFilteredImage);
    labelFilteredImage.setBackground(Color.lightGray);
    labelFilteredImage.setFont(new Font("SansSerif", 0, 10));
    scrollPaneParams = new ScrollPane(0);
    panelParams = new Panel();
    nbParameters = paramsName.size();
    int i = WinHeight - (33 + 7 * Yspc + logoHeight + imageHeight + 23);
    if (i < Yspc + 2 + 24)
    i = Yspc + 2 + 24;
    scrollPaneParams.setBounds(0, 0, WinWidth - 10, i);
    panelParams.setLayout(new GridLayout(nbParameters, 1, 5, Yspc / 2));
    scrollPaneParams.add(panelParams);
    panelParams.setBackground(sepColor);
    panelParameters = new Panel[nbParameters];
    labelParameters = new Label[nbParameters];
    textFieldParameters = new TextField[nbParameters];
    labelComments = new Label[nbParameters];
    for (int j = 0; j < nbParameters; j++)
    panelParameters[j] = new Panel();
    panelParameters[j].setLayout(new FlowLayout(0, 5, 1));
    panelParams.add(panelParameters[j]);
    panelParameters[j].setBackground(parColor);
    labelParameters[j] = new Label();
    labelParameters[j].setText((String)paramsName.elementAt(j));
    panelParameters[j].add(labelParameters[j]);
    labelParameters[j].setForeground(fgColor);
    labelParameters[j].setFont(new Font("Dialog", 1, 12));
    textFieldParameters[j] = new TextField(8);
    textFieldParameters[j].setText(paramsValue.elementAt(j).toString());
    panelParameters[j].add(textFieldParameters[j]);
    textFieldParameters[j].setBackground(fgColor);
    textFieldParameters[j].addKeyListener(this);
    labelComments[j] = new Label();
    labelComments[j].setText((String)paramsComment.elementAt(j));
    panelParameters[j].add(labelComments[j]);
    labelComments[j].setForeground(fgColor);
    add(scrollPaneParams);
    panelHelp = new Panel();
    labelHelp = new Label();
    panelHelp.setLayout(new FlowLayout(1, 5, 0));
    add(panelHelp);
    panelHelp.setBackground(bgColor);
    labelHelp.setText(" Change colour values and press enter ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    labelHelp.setForeground(helpColor);
    return null;
    private String readParams(String string1)
    Object object1;
    String string2;
    if (string1 == null)
    return "Filename of filter's parameters needed";
    try
    URL uRL = new URL(getDocumentBase(), string1);
    URLConnection uRLConnection = uRL.openConnection();
    uRLConnection.setDoInput(true);
    uRLConnection.setUseCaches(false);
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream()));
    string2 = null;
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    if (bufferedReader != null)
    Object object2;
    try
    for (object2 = bufferedReader.readLine(); object2 != null && string2 == null; object2 = bufferedReader.readLine())
    string2 = extractFormat(object2);
    catch ()
    string2 = object2.getMessage();
    finally
    bufferedReader.close();
    if (string2 != null)
    return string2;
    else
    return null;
    private String extractFormat(String string1)
    if (string1.length() == 0)
    return null;
    int i = 0;
    int j = string1.indexOf(" ", i);
    if (j == -1)
    return "Bad format error (space missing)";
    String string2 = string1.substring(i, j);
    if (string2.equals("TITLE"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    title = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    originalCaption = string1.substring(i, j);
    return null;
    if (string2.equals("FILTEREDCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    filteredCaption = string1.substring(i, j);
    return null;
    if (string2.equals("LOGO"))
    i = j + 1;
    j = string1.length();
    logoFileName = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALIMAGE"))
    i = j + 1;
    j = string1.length();
    originalImageFileName = string1.substring(i, j);
    return null;
    if (!string2.equals("PARAM"))
    return null;
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    paramsName.addElement(string1.substring(i, j));
    i = j + 2;
    j = string1.indexOf(32, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    try
    paramsValue.addElement(new Double(string1.substring(i, j)));
    j = string1.indexOf(34, i);
    catch (NumberFormatException e)
    return "Bad format in a PARAM line";
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    paramsComment.addElement(string1.substring(i, j));
    return null;
    public EasyFilter()
    logoHeight = 33;
    Yspc = 5;

    Addition to my above submission
    To clarify, I'll offer the US$20 to the FIRST person who offers me a workable solution to the problem, not to everyone!!!
    JMGRAHAM

  • Communication between javascript and Objective-c in iOS.

    We wanted to have a communication between javascript and objective c code. We have already tried the below approach.
    To load fake URLs in JS and append a string which will be used as parameter to the Objective-C code and parse that URL in this delegate method:
    -(BOOL)webView(UIWebView *)webView shouldStartLoadWithRequest(NSURLRequest *)request navigationType(UIWebViewNavigationType)navigationType
    Then send the return value by calling the native method stringByEvaluatingJavaScriptFromString again with parameter callID.
    But we wanted to access Objective class object in Javascript code so that we can call it's methods from javascript code using this object.Android supports this behaviour using addJavaScriptInterface method in webview. Is it possible to have the similar approach in IOS? If not what is the best approach possible to acheive this? If we could achieve similar behaviour then we don't need to change the Jacascript code and will be reused. Please suggest the best possible solution.
    Regards,
    Karthik M.

    https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptu al/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html

  • Using Google GWT to create (Dashcode) widgets for iBook Author  I would like to embed interactive widgets in iBooks using iBookAuthor. The widgets in question started life in Java but GWT has allowed them to be converted to javascript and to run on web pa

    I would like to embed interactive widgets in iBooks using iBookAuthor. The widgets in question started life in Java but GWT has allowed them to be converted to javascript and to run on web pages (for example, http://softoption.us/content/node/437 scroll to the bottom). In theory, iBookAuthor can bring in most html5, and much javascript. The technique is to wrap the html in a folder, with 2 extra files, a plist and a default png and then change the extension of the folder to ‘.wdgt’. This is the technique for making Dashboard widgets for the Mac, and Apple even have the Dashcode software to do it. So what you really do is to make a Dashboard widget, then iBookAuthor can import it.  So far, so good. And some  folk have been doing this, for example http://www.prweb.com/releases/2012/2/prweb9242432.htm http://www.panophoto.org/forums/viewtopic.php?f=64&t=10417&p=158330#p158423 However, if you start with GWT and create a single page with one button and a Hello World, compile it, and get the WAR file (I use Eclipse here)… the Safari browser and others will run it properly (even on an iPad). Then if you wrap it, a proper Dashboard widget is created, which runs properly on a Mac. Then if you go to iBookAuthor and put a custom widget in the Text, then drag it in. It is accepted by the text and shown as being there. However, if you use Preview to look at it on an iPad, it is gone (or was never there in the first place). Anyone any ideas on this? [And iBook Author seems to give no warnings.] The widget is at https://dl.dropbox.com/u/46713473/Test6.wdgt.zip I have bells and whistles that I’d like to get into an iBook!
    Thanks for any insights.
    Martin

    I do have a little to add, which might help someone. Indeed, opening a blank page and dragging the widget straight in seems good in difficult cases. But, actually, I was also able to insert successfully from the Toolbar especially to blank pages. So, it may have been something to do with the columns and stuff like that. Anyway back then the insertion would show in iBooks Author but not in the Preview on the iPad. I moved on to actual Google Web Toolkit output javascript. Basically I had three at hand to try: a Hello World with a button which went straight it, one of moderate complexity, (for example with a built in Lisp interpreter), which also went straight in, and finally a more complex one that initially was rejected by iBook Author. Author complained that there was an unsupported media file (of course, Author does not tell you which one it is, that would be too easy). [Remember, this was a proper working Dashboard widget which could be installed on a Mac]. Among other things I had read remarks about .gif files. When looking through the GWT war directory at the actual javascript etc files, I noticed there were two gifs there one called ‘clear.cache.gif ‘  and a second one called  ‘0F89659FF3F324AE4116F700257E32BD.cache.gif’. (Now, there is obfuscation so the numbers here may be different from case to case.) The clear.cache.gif did not seem to be anything special. But the other one is an animation. It is three little boxes that twinkle (rather like a waiting spinning cursor).  So, I opened that file and saved it to itself (that picks the top frame of the animation and saves only that, leaving you with an unanimated gif). The resulting widget drags and drops into iBooks Author (and seems to work properly at a quick glance). So, if you are having trouble with ‘unsupported media files’ converting animated gifs into unanimated gifs might help in some cases.

  • How to find out the filename of javascript and pathname of javascript?

    I got the filename of javascript and pathname of javascript(not the active document file name) using the below code in illustrator cs3.
    var path = $.fileName;
    But my problem was if i run the javascript through "extendscript toolkit" i got it correctly. But if i run my script through illustrator cs3 application(File->Scripts->test.jsx) i got some integer value only(did not get the javascript filepath and filename). Kindly advice how to get the javascript file name and file path in windows platform through illustrator cs3 javascript. Please help me.

    I already have that extension, but I'm not sure which idx I need to look at. Also, I suppose that the numbers I'm looking for depend on places.history.expiration.transient_current_max_pages and therefore there is no way to get them relative to the installation of Firefox. My point is, I can see my history only up to 1 year, even though I have Firefox installed for 3 years. Correct me if I'm wrong.

  • What's the difference between jsp and jsf?

    who can tell me what's the difference between jsp and jsf?
    I'm puzzled when I found some of the technology in jsp is so similar to the ones in jsp( javaserver page)

    Hi,
    Find the difference between JSP and JSF
    1. A developer has more control with JSP, but (should) get easier development with JSF
    2. Event handling is done differently in JSP (HTTP) and JSF (Java)
    3. The UI is designed differently (or should be at least) with JSP (markup) and JSF (components).
    4. The end product should also be defined differently - JSP page versus a JSF application.
    Is this the only thing that is need to make a decision for either or? Probably not. There are other pieces that need to be taken in account when deciding which technology to use - tools support, enough components, type of application etc.... At this point there are not enough JSF components (although there are some interesting projects underway - Ajaxfaces, Myfaces, ADF Faces, and WebChart 3d) and enterprise tools support is still limited to a few tools vendor. Looking at our ADF Faces components they are currently available as early access (not production) and demands for these components are stacking up, literally, outside my office doorstep. Although I would love to make them production - now! - it is not a viable solution since we are still checking features and fixing critical bugs.
    All this combined - not enough enterprise level components in production, lacking tools support etc... - leave customers in a vacuum where the decision is either to continue with JSP, since it is mature and has a wide developer base, or move forward with JSF not sure if the support, or the developers will be there. This is particularly sensitive to customers that need to get started now and be production by summer.
    If you are in this vacuum here are some key points promoting JSF:
    1. Fundamental unit is the Component
    2. Built in event and state management
    3. Component sets can be provided by any vendor
    4. Closer to ASP.Net or Swing development
    5. Choice of UI technology
    6. Scale up (rich clients)
    7. Scale down (mobile devices)
    8. Built into J2EE containers in J2EE 5.0 (tentative)

  • How to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi?

    I'd like to how to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi.
    Any help would be appreciated.

    NeoChang:
    You can modify the installation package using the Adobe Customization Wizard to toggle the "Display PDF in Browser" but I have not found a setting to disable JavaScript from the Wizard. I have created a script which makes the changes, but it has to be run for every user since that info is stored in the User hive of the Windows registry.
    Disable JavaScript:
    REG ADD "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs" /v bEnableJS /d 0 /t REG_DWORD /f
    Disable Browser Integration:
    REG ADD "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /v bBrowserIntegration /d 0 /t REG_DWORD /f
    Michael
    ~Simplicity of Character is a Natural Result of Profound Thought~

  • Encrypt in javascript and decrypt in java

    hi guys,
    iam in a strange situation, my requirement is to encrypt the user entered details thr javascript and decrypt in those in java.
    i need some ideas
    thanku

    Why don't you just use SSL? Then the entire communication is encrypted.

Maybe you are looking for