Hi Sven,

Thanks a Lot for you help...

One last question.. For me only works if the ActionButton was part of the Form. Is really necessary or I did some mistake ??

----- Original Message ----- From: "Sven Pfeiffer" <[email protected]>
To: <[email protected]>
Sent: Thursday, August 12, 2010 1:21 PM
Subject: Re: Doubt in using ActionButton


Hi Andre,

when you click the button a POST request is sendet to the server.
The id is not part of the POST-requests url, all parameter of the
GET-request are removed in the forms action attribute.

You could add a HiddenField to your Form, in onGet() you populate the
HiddenField with the ID, in onButtonClick you read the id from your
HiddenField.

hth
SVen

Andre Gustavo Lomonaco wrote:
Hi Stephan, thanks for your reply

You are correct about redirecting from a page with a table to the page with the button... I did what you send me and in onInit() method I got the id value with no problem...

But how can I get this value in the onButtonClick method ???
for example, the result of System.out.println(getContext().getRequest().getParameter("id")); in onButtonClick method is null
I think all I want is keep the parameter id when I click the Action Button

Thanks for your help
Regards.
Andre Gustavo Lomonaco

----- Original Message ----- From: "Kennedy, Stephan" <[email protected]>
To: <[email protected]>
Sent: Thursday, August 12, 2010 12:10 PM
Subject: AW: Doubt in using ActionButton


Hi Andre

If I understand correctly you are redirecting from a page with a table to the page with the button? Have you tried reading the id from the request in your onInit() method in EditRoteadorSnmp?
E.g.
@Override
public void onInit() {
super.onInit();
           id = getContext().getRequest().getParameter("id");
     }

Regards
Stephan

-----Ursprüngliche Nachricht-----
Von: user-return-1480-stephan.kennedy=siemens-enterprise....@click.apache.org [mailto:user-return-1480-stephan.kennedy=siemens-enterprise....@click.apache.org] Im Auftrag von Andre Gustavo Lomonaco
Gesendet: Donnerstag, 12. August 2010 16:47
An: [email protected]
Betreff: Doubt in using ActionButton

Hi,

Using the Click Examples, I'm trying to put a ActionButton in a Edit Page
but I cannot make work.. Here my doubt

After the user choose the correct row in the table, the user is redirect to
the EditRoteadorSNMP Page

http://192.168.80.110:8080/NetworkAdvisor/edit/edit-roteador-snmp.htm?id=200&referrer=%2Ftable%2Froteador-table.htm

You can see the id is equal 200

The form in this page works nice and permit the user edit the row with id =
200

I add in this same page, one ActionButton, not inside the Form...

My doubt is why I cannot get the id value after the user click this Action
Button

Here the code

public class EditRoteadorSnmp extends BorderPage {

  private Form form = new Form("form");
  protected ActionButton button = new ActionButton("action");
 @Bindable protected Integer id;
.....

public EditRoteadorSnmp() {

       addControl(form);
       addControl(button);
       button.setListener(this, "onButtonClick");
........

public boolean onButtonClick() {

       System.out.println(id);                ---- why I receive the NULL
value here ------------------
}

Thanks in Advanced

My Best Regards

Andre Gustavo Lomonaco
















Reply via email to