move tck = getModelObject() into the onclick handler.

Martijn

On Mon, Sep 22, 2008 at 4:05 PM, lienok <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> the panel with detachable model is not refreshing after model has changed.
> kindly check the code please.
>
> the panel - ActivityPanel is not refreshing after I press link and status of
> the DetachableTcktModel is changed.
>
> public LoansTabPanel(String id, int ticketId) {
>            super(id);
>            setModel(new CompoundPropertyModel(new
> DetachableTcktModel(ticketId)));
>            getMenu();
>            getFullContent();
> }
>
> public void getFullContent() {
>
>            //when ticket was not authorized "sendToAuth" link is visible
>            add(new ActivityPanel("activityPanel", getModel()));
>        }
>
> ..........
>
> public ActivityPanel(String id, IModel model) {
>        super(id, model);
>        tck = (Ticket) getModelObject();
>
>        lnkSendToAuth = new Link("sendToAuth") {
>
>            public void onClick() {
>           /**
>             *after ticket is authorized link "sendToAuth" is disabled
>             * BUT THIS IS NOT WORKING AUTOMATICALLY,
>             * I have to reopen the page. NOT EVEN REFRESH IS HELPING */
>
>                tck.sendToAuthorization(true);
>                info("Ticket was sent to authorization.");
>            }
>        };
>        add(lnkSendToAuth);
>
> }
> ....
> public DetachableTcktModel(int ticketID) {
>    this.ticketId = ticketID;
> }
>
> protected Object load() {
>        tck = findTicket(ticketId);
>        return tck;
> }
>
> public void detach() {
>        tck = null;
>    }
>
> .....
>
>
> Any advice what I am doing wrong I would appreciate.
>
> Thanks, Lenka
>
> --
> View this message in context: 
> http://www.nabble.com/refresh-page-with-detachable-model---not-working-tp19608631p19608631.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to