Hi Bob,

   Thanks for quick answer.

   I tried to figure out where i could be manually setting the Select
control value without success.
   I'm not playing with select#bindRequestValue.

   Please, take a look at the main methods of the Search Page and its
controls:

    public Form form = new Form();

    public FieldSet fstClientGroup = new FieldSet("fldClientGroup");
    public FNetSelect sltClientGroup =new FNetSelect("sltClientGroup",
getMessage(PageMessages.LABEL_CLIENT_GROUP));

    public FieldSet fstProducts = new FieldSet("fldProducts");
    public Table tblProducts = new Table("tblProducts");
    public AbstractLink alkDelete = new
ActionLink(getMessage(PageMessages.ACTION_LABEL_DELETE));
    public Submit sbtSearch = new
Submit(getMessage(PageMessages.ACTION_LABEL_SEARCH));

    public Submit sbtGenerateReport =
            new Submit("sbtGenerateReport",
getMessage(PageMessages.ACTION_LABEL_GENERATE_REPORT));


    @Override
    public void onInit() {
        clearErrorMessage();
    }

    @Override
    public void onRender() {
        tblProducts.setRowList(getSelectedProductsSessionList());
    }

    /**
     * This method is called when Delete Action Link is clicked
    **/
    private ActionListener getDeleteActionListener() {
        return new ActionListener() {
            @Override
            public boolean onAction(Control source) {
                Integer idSelectedProduct = ((ActionLink)
source).getValueInteger();

                ProductVO productVO = (ProductVO) new
ProductService().load(idSelectedProduct);

                getSelectedProducts().remove(productVO);

                return true;
            }

        };
    }


   It doesn't matter the content of the constructor, as it will be called
just on the first time the Page is requested, isn't?


Regards,

Victor França

On Thu, Jan 29, 2009 at 8:35 AM, Bob Schellink <[email protected]> wrote:

> Hi Victor,
>
>
> Victor França wrote:
>
>
>>   So, how can i keep the state of statefull pages if an ActionLink is
>> clicked?
>>
>
>
> When a stateful page is enabled (#setStateful(true)), Click will place the
> Page in the session and reuse that same page the following request. So the
> state of the Page should be preserved when you follow the ActionLink.
>
> Without seeing your code my guess is that somewhere on the page the Select
> value is reset. Perhaps you manually set the Select value on the Page or use
> select#bindRequestValue?
>
> If you can feel free to post an example.
>
> kind regards
>
> bob
>

Reply via email to