how pass data to other page textfield from main page textfield

View: New views
4 Messages — Rating Filter:   Alert me  

how pass data to other page textfield from main page textfield

by mfa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi master
sir i use netbean 6.1 with vwp i create two jsp page both have one textfield
sir how i pass page1 textfield1 data to  page2 textfield1

please give me idea how i pass textfiled data to next page textfield


thank you

aamir

Re: how pass data to other page textfield from main page textfield

by Futaleufu_John :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The easiest way is to add a String property to SessionBean1 and data bind the two textfields to that property.

In SessionBean1:

private String myProperty;

public String getMyProperty() {
    return this.myProperty;
}

public void setMyProperty(String myProperty) {
    this.myProperty = myProperty;
}

On JSP page 1

Drop a textfield onto the page. Right-click the textfield and select Property Bindings.

In the Select bindable properties panel, make sure 'text' is selected.

In the Select binding target panel, find SessionBean1 and select myProperty. Click Apply.

Repeat this procedure on JSP page 2.

mfa wrote:
sir i use netbean 6.1 with vwp i create two jsp page both have one textfield
sir how i pass page1 textfield1 data to  page2 textfield1

please give me idea how i pass textfiled data to next page textfield

Re: how pass data to other page textfield from main page textfield

by mfa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thank you for your reply

sir in netbean 5.5 vwp we use outline window for this work that was short process

but outline window not work in netbean 6.1 vwp why

no any other way for add property process without code write in class


please give me idea

thank  you

aamir








The easiest way is to add a String property to SessionBean1 and data bind the two textfields to that property.

In SessionBean1:

private String myProperty;

public String getMyProperty() {
    return this.myProperty;
}

public void setMyProperty(String myProperty) {
    this.myProperty = myProperty;
}

On JSP page 1

Drop a textfield onto the page. Right-click the textfield and select Property Bindings.

In the Select bindable properties panel, make sure 'text' is selected.

In the Select binding target panel, find SessionBean1 and select myProperty. Click Apply.

Repeat this procedure on JSP page 2.

mfa wrote:
sir i use netbean 6.1 with vwp i create two jsp page both have one textfield
sir how i pass page1 textfield1 data to  page2 textfield1

please give me idea how i pass textfiled data to next page textfield


Re: how pass data to other page textfield from main page textfield

by Rick Fincher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Aamir,

Put the following in "RequestBean1.java"
-----
private String page1Text;

    public String getPage1Text() {
        return page1Text;
    }

    public void setPage1Text(String page1Text) {
        this.page1Text = page1Text;
    }
-----

Put a button in page1.jsp and put this in page1.java for the button's
action method:
-----
public String button1_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        getRequestBean1().setPage1Text(
textFieldPage1.getText().toString());
        return "page2";
    }

-----

Right click in the visual editor and add a navigation path from page 1
to page 2 called "page2".  The "return "page2" above will cause page 1
to go to page 2 when you click the button.

In page2.java, put the following under the "prerender" method

-----

public void prerender() {
        textFieldPage2.setText(getRequestBean1().getPage1Text());
    }

-----

Now when you click the button on page1 the contents of textFieldPage1
get stored in the request bean.  When page2 loads, the prerender method
pull that stored value out of the request bean and puts it in
textFieldPage2.

After the page draws, the request bean goes away.

You can do the same thing with the session bean to store stuff while a
user is logged in.

You can use the application bean to store stuff for the entire time the
application is running.

Rick

mfa wrote:

> hi master
> sir i use netbean 6.1 with vwp i create two jsp page both have one textfield
> sir how i pass page1 textfield1 data to  page2 textfield1
>
> please give me idea how i pass textfiled data to next page textfield
>
>
> thank you
>
> aamir
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...