facebook

Jsf and Adf onclick button open new window. back with value

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #258004 Reply

    I am working on jsf & oracle Adf from one month before.

    I have problem in JSF & ADF. from one page button open new window & that

    window close & return the value.

    New window is close but value is not returning. (means that old page is not

    rendering)

    MY CODE

    lov.jsp

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
    http://www.w3.org/TR/html4/loose.dtd”&gt;
    <%@ page contentType=”text/html;charset=windows-1252″%>
    <%@ taglib uri=”http://java.sun.com/jsf/html&#8221; prefix=”h”%>
    <%@ taglib uri=”http://java.sun.com/jsf/core&#8221; prefix=”f”%>
    <%@ taglib uri=”http://xmlns.oracle.com/adf/faces&#8221; prefix=”af”%>
    <%@ taglib uri=”http://xmlns.oracle.com/adf/faces/html&#8221; prefix=”afh”%>
    <f:view>
    <afh:html>
    <afh:head title=”lov”>
    <meta http-equiv=”Content-Type”
    content=”text/html; charset=windows-1252″/>
    </afh:head>
    <afh:body>
    <af:messages/>
    <af:form>
    <af:inputText label=”User ID” value=”#{user.adumUserId}” />

    <af:inputText label=”User Name”
    value=”#{user.adumUserName}”

    />

    <af:commandLink useWindow=”false” id=”cmdLink” text=”User Name”
    action=”process:show”
    launchListener=”#{user.handleLaunch}”
    returnListener=”#{user.handleReturn}”
    partialSubmit=”true” windowHeight=”200″
    windowWidth=”500″ />
    <br>
    <br>
    <af:commandLink useWindow=”true” id=”cmdLink1″ text=”New user?”
    onclick=”openWindow(window,’popup.jsp’,’popupWindow’,{width:450,height:400},true,’dialog’,null);”

    launchListener=”#{user.handleLaunch}”
    returnListener=”#{user.handleReturn}”
    partialSubmit=”true” windowHeight=”200″
    windowWidth=”500″/>

    </af:form>
    </afh:body>
    </afh:html>
    </f:view>

    popup.jsp

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
    http://www.w3.org/TR/html4/loose.dtd”&gt;
    <%@ page contentType=”text/html;charset=windows-1252″%>
    <%@ taglib uri=”http://java.sun.com/jsf/html&#8221; prefix=”h”%>
    <%@ taglib uri=”http://java.sun.com/jsf/core&#8221; prefix=”f”%>
    <%@ taglib uri=”http://xmlns.oracle.com/adf/faces&#8221; prefix=”af”%>
    <%@ taglib uri=”http://xmlns.oracle.com/adf/faces/html&#8221; prefix=”afh”%>
    <f:view>
    <afh:html>
    <afh:head title=”popup”>
    <meta http-equiv=”Content-Type”
    content=”text/html; charset=windows-1252″/>
    </afh:head>
    <afh:body>
    <af:messages/>
    <h:form>
    <af:inputText label=”User Name :” value=”#{user.adumUserName}” simple=”true”/>
    <af:commandButton id=”cmdBtn” text=”Close” useWindow=”false”

    action=”#{user.commandButton_action}” >
    </af:commandButton>
    </h:form>
    </afh:body>
    </afh:html>
    </f:view>

    user.java

    package view;

    import java.util.HashMap;
    import java.util.Map;

    import oracle.adf.view.faces.context.AdfFacesContext;
    import oracle.adf.view.faces.event.LaunchEvent;
    import oracle.adf.view.faces.event.ReturnEvent;

    public class user
    {
    private String adumUserId ;
    private String adumUserName ;
    public user()
    {
    }

    public void setAdumUserId(String adumUserId)
    {
    this.adumUserId = adumUserId;
    }

    public String getAdumUserId()
    {
    return adumUserId;
    }

    public void setAdumUserName(String adumUserName)
    {
    this.adumUserName = adumUserName;
    }

    public String getAdumUserName()
    {
    return adumUserName;
    }

    public void handleReturn(ReturnEvent event)
    {
    user cst = new user();
    if (event.getReturnValue() != null)
    {
    cst = (user)event.getReturnValue();
    }
    AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
    Map maou = new HashMap();
    maou.put(“user”, cst);
    afContext.returnFromDialog(“maou”,maou);
    afContext.getProcessScope().clear();
    }

    public void handleLaunch(LaunchEvent event)
    {
    Object usr = adumUserName;
    // event.get getProcessParameters().put(“adumUserName”, usr);
    event.getDialogParameters().put(“adumUserName”, usr);
    }

    public String commandButton_action()
    {
    String retValue;
    retValue = “process:lov”;
    return retValue;
    }
    }

    give me solutions.

    SANDESH KOTANGALE
    sandesh_kotangale@gmail.com[/b]

    #258029 Reply

    Riyad Kalla
    Member

    Sandesh,
    Be sure to post your question to the MyFaces/ADF forums as well as some folks here might have a better idea what you are asking.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Jsf and Adf onclick button open new window. back with value

You must be logged in to post in the forum log in