Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

passing parameter from a HTML page to another HTML/JSF page

3174772Mar 21 2016 — edited Mar 21 2016

Hi,

I have a html page, where i have a button, one input text box and one next button.. like this

pastedImage_0.png..

Now my requirement is, when i pass any parameter.. and click on either next or Genealogy button the passing parameter should appear in my another html page..

pastedImage_1.png

this is my first page html code:

Home.html

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

<!DOCTYPE html>

<html>

\<head>

    \<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    \<title>Main\</title>

\</head>

\<body>

<div class="image">

<button id="open" onClick="location.href='http://127.0.0.1:7101/iotapps/Genealogy & Trace.html'">

\<img src="css/images/Configuration.png" alt="Geneology"/>

<h4>Genealogy</h4>

 \</div>

  \<script type="text/javascript">

        function redirectLink(){

        var userName = document.getElementById("UserName").value;

        var address = document.getElementById("Address").value;

        var usertype = document.getElementById("UserType").value;

        var param = "UserName=" + userName + "&Address=" + address + "&UserType=" + usertype;

        document.getElementById('').src = "[http://127.0.0.1:7101/iotapps/faces/MainPage.jsf](http://127.0.0.1:7101/iotapps/faces/MainPage.jsf)?" + param;

        }

        \</script>

       Param1: \<input type="text" id="UserName" name="UserName"/>

       \<br>

       \<br>

       Param2: \<input type="text" id="Address" name="Address"/>

       \<br>

       \<br>

       Param3: \<input type="text" id="UserType" name="UserType"/>

        \<button type="button" id="b1" value="navigate" onclick="redirectLink()">Next\</button>   

 \</button>

\</body>

</html>

and here i am catching the passed parameters at my jsf page which is embedded in html page::::

<f:facet name="second">

                \<af:panelGroupLayout id="pgl2">

                    \<!--\<af:region value="#{bindings.parenttaskflow1.regionModel}" id="r1"/>-->

                   \<!--//\<af:outputText value="#{param}"  id="cb1"/>-->

                  \<!-- Param1 :-->

                   \<af:outputText value="#{param.UserName}"/>

                   \<br/>

                 \<!--  Param2 :-->

                   \<af:outputText value="#{param.Address}"/>

                   \<br/>

                  \<!-- Param3 :-->

                   \<af:outputText value="#{param.UserType}"/>

                \</af:panelGroupLayout>

            \</f:facet>

how to do, can anyone help me out.

Thanks

Chinmayee

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2016
Added on Mar 21 2016
2 comments
216 views