RE: CheckGroup Model

2011-08-10 Thread Wilhelmsen Tor Iver
 How can I do this in a elegant way? 

Are you sure your Campo class implements equals() properly? Also remember it is 
better to pass the IModelListCampo (that you will be using later to pick up 
the values) to the CheckGroup, e.g. in your case a PropertyModel based on where 
you read out the values now.

- Tor Iver

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread armandoxxx
Hey guys ... 

With wicket 1.5 we got events. So far so good but I got a case where i'm
missing after on initialize method call. 

I have lot's of panels on my page, and I create them in onInitialize() code.
But I need to send a 1 time event after all components are initialized. 
- problem #1: If I send an event from onInitialize():  not sure that all
components are initialized !
- problem #2: If is send an event from onConfigure() or onBeforeRender(),
the event get send everytime component is rendered ... 

So current solution is to create a flag in my panels that sendEventOnInit()
method was allready called .. 

but it would be better  to have a method onInitialized() |
afterInitialized() (pick your favorite name). 

If someone has better approach, please let me know about it ! 

Kind regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Pedro Santos
Hi Armando, the problem #1 is rather about not have the entire
component tree connected already. onInitialize is called when the
component is aware of its path to page, at this moment, a triggered
even will not reach new nodes addition in the component tree.

On Wed, Aug 10, 2011 at 7:23 AM, armandoxxx armando@dropchop.com wrote:
 Hey guys ...

 With wicket 1.5 we got events. So far so good but I got a case where i'm
 missing after on initialize method call.

 I have lot's of panels on my page, and I create them in onInitialize() code.
 But I need to send a 1 time event after all components are initialized.
 - problem #1: If I send an event from onInitialize():  not sure that all
 components are initialized !
 - problem #2: If is send an event from onConfigure() or onBeforeRender(),
 the event get send everytime component is rendered ...

 So current solution is to create a flag in my panels that sendEventOnInit()
 method was allready called ..

 but it would be better  to have a method onInitialized() |
 afterInitialized() (pick your favorite name).

 If someone has better approach, please let me know about it !

 Kind regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Pedro Henrique Oliveira dos Santos

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
You almost found it yourself.
Use onBeforeRender() + hasBeenRendered() instead of your custom flag.


On Wed, Aug 10, 2011 at 1:23 PM, armandoxxx armando@dropchop.com wrote:
 Hey guys ...

 With wicket 1.5 we got events. So far so good but I got a case where i'm
 missing after on initialize method call.

 I have lot's of panels on my page, and I create them in onInitialize() code.
 But I need to send a 1 time event after all components are initialized.
 - problem #1: If I send an event from onInitialize():  not sure that all
 components are initialized !
 - problem #2: If is send an event from onConfigure() or onBeforeRender(),
 the event get send everytime component is rendered ...

 So current solution is to create a flag in my panels that sendEventOnInit()
 method was allready called ..

 but it would be better  to have a method onInitialized() |
 afterInitialized() (pick your favorite name).

 If someone has better approach, please let me know about it !

 Kind regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: how to implement a Form with Ajax Paginated List of Checkboxes?

2011-08-10 Thread Martin Grigorov
Add AjaxFormChoiceComponentUpdatingBehavior to the CheckGroup

On Wed, Aug 10, 2011 at 4:38 AM, bad boy badmas...@yahoo.com wrote:
 On my Wicket page, I have a form with a couple of TextFields and a paginated 
 List of Checkboxes implemented with Dataview and and a sortable data 
 provider.  The ajax pagination of the dataview works fine.

 The problem is that when I select a few items on Page 1 and then go to Page 2 
 and then return to Page 1 using the AjaxPagingNavigator, the selection is 
 lost : the items that were checked on Page 1 initially do no have the check 
 mark anymore.

 What should I do so that the items that were selected on a page of Dataview 
 do not get lost when the AjaxPagnigaion is used to traverse the pages of the 
 Dataview ?



 public final class AjaxFormWithPaginatedCheckBoxPage extends BasePage {

 static Logger logger = 
 Logger.getLogger(AjaxFormWithPaginatedCheckBoxPage.class);
 private Person person = new Person();
 int counter = 0;

 WebMarkupContainer webMC;
 static ListPerson pList=Person.getPersons(100);
 int maxListCount=5;
 DataView dv;
 CheckGroup group;
 public AjaxFormWithPaginatedCheckBoxPage() {
     super();
     final Form form = new Form(form, new CompoundPropertyModel(person)) {

         protected void onSubmit() {
             logger.info(form recived);
             logger.info( person name  + person.getName());

             setResponsePage(new AjaxTogglePanelTestPage());
         }
     };
     final TextField name = new TextField(name);
     final TextField age = new TextField(age);
     form.add(name);
     form.add(age);


     group=new CheckGroup(group, new ArrayList());
     form.add(group);

     webMC= new WebMarkupContainer(webMC);
     webMC.setOutputMarkupId(true);


     SortablePersonDataProvider personDataProvider=new 
 SortablePersonDataProvider(pList);
     dv = new DataViewPerson(persons, personDataProvider) {

         @Override
         protected void populateItem(ItemPerson item) {
             item.add(new Check(check, item.getModel()));

             item.add(new Label(id, new PropertyModel(item.getModel(), 
 id)));
             item.add(new Label(name, new PropertyModel(item.getModel(), 
 name)));
             item.add(new Label(age, new PropertyModel(item.getModel(), 
 age)));
         }


     };
     dv.setItemsPerPage(maxListCount);


     webMC.add(new AjaxFallbackOrderByBorder(orderByID, id, 
 personDataProvider)
     {
         @Override
         protected void onSortChanged()
         {
             dv.setCurrentPage(0);
         }

         @Override
         protected void onAjaxClick(AjaxRequestTarget target) {
             target.addComponent(webMC);
         }
     });

     webMC.add(new AjaxFallbackOrderByBorder(orderByName, name, 
 personDataProvider)
     {
         @Override
         protected void onSortChanged()
         {
             dv.setCurrentPage(0);
         }

         @Override
         protected void onAjaxClick(AjaxRequestTarget target) {
             target.addComponent(webMC);
         }
     });
     webMC.add(new AjaxFallbackOrderByBorder(orderByAge, age, 
 personDataProvider)
     {
         @Override
         protected void onSortChanged()
         {
             dv.setCurrentPage(0);
         }

         @Override
         protected void onAjaxClick(AjaxRequestTarget target) {
             target.addComponent(webMC);
         }
     });


     webMC.add(dv);
     webMC.add(new AjaxPagingNavigator(navigator,dv));
     group.add(webMC);

     AjaxButton ab = new AjaxButton(ajax-button, new 
 PropertyModelString(this,
             counter), form) {

         @Override
         protected void onSubmit(AjaxRequestTarget target, Form? form) {
             counter++;
             logger.info(ajx form recived);
             logger.info(ajx person name  + person.getName());

             target.addComponent(this);

         }
     };
     form.add(ab);
     form.setDefaultButton(ab);

     add(form);
 }
 }

 Thanks
 Badmash

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: [Ann] New Wicket stuff library for simplified ModalWindows: ModalX (1.4.x + 1.5.x)

2011-08-10 Thread Chris Colman
Yes, I get confused by that at times also!

You can switch between the Wicket 1.4.x and Wicket 1.5.x branches in
github using the 'Switch Branches' button.

Ah, sorry, confused jdk-1.5 with W1.5

2011/8/10 Martin Makundi martin.maku...@koodaripalvelut.com

 Hi!

 Is this true:

 Source Code core-1.4.x Branch

 Path is: /jdk-1.5-parent/modalx-
parenthttps://github.com/wicketstuff/core/tree/core-1.4.x/jdk-1.5-
parent/modalx-parent


 2011/8/10 Chris Colman chr...@stepaheadsoftware.com

 ** **

 The open source ModalX modal window extensions framework from Visual
 Classworks has just been added to wicket-stuff.

 ** **

 ModalX now comes in a version for Wicket 1.4.x and for 1.5.x.

 ** **

 Try the live demo here:

 ** **

 http://demo.visualclassworks.com/modalx/

 ** **

 Read more here:

 ** **

 http://www.visualclassworks.com/content/list/o/76914/type/modalx

 ** **

 Here's the wicketstuff wiki page:

 ** **

 https://github.com/wicketstuff/core/wiki/ModalX

 ** **

 ** **

 ** **

 ** **

 Yours sincerely,

 ** **

 Chris Colman

  

 Visual Classworks,

 A Division of Step Ahead Software

 

 ** **

 **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100
 2120 

 Email: chr...@stepahead.com.au //chr...@stepahead.com.au

 Website:

 http://www.visualclassworks.com

 http://develop.stepaheadsoftware.com




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: CheckGroup Model

2011-08-10 Thread delta
Hmmm, I did it. My fault, since I didn't implemented equals. Just that
resolved the case.

Thanks a lot, Tor Iver.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-Model-tp3731606p3732828.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Modal window issue

2011-08-10 Thread Vojtěch Krása
Hi,

ModalWindow from wicket-extensions is broken by design, try to use
visural-wicket or something different and all your problems are gone.

V.

2011/8/9 Archana archanaacharya.adhik...@gmail.com

 Hi All,

 In my current application there is a need to open a Modal window with in a
 Modal window and close the parent Modal window, once the child Modal window
 opens. Currently from one page on click of a icon the Modal window 1 is
 opening. Modal window 1 has few other components along with few buttons. On
 click of a create button another Modal window Modal window 2 opens.

 1. The need is to close the Modal window 1 when the Modal window 2 opens.
 But for Modal window 2, the parent is Modal window 1. So if I close the
 Modal window 1, Modal window 2 does not open. *Is there a way by which I
 can
 close Modal window 1, when Modal window 2 open.*

 2. If I can not close the parent Modal window, I want to hide the Modal
 window 1, when the Modal window 2 open. I tried the setVisible() for Modal
 window 1. but it did not work. *Is there a way by which I can hide the
 Modal
 window 1 or at least deactivate the Modal window 1, when the Modal window 2
 opens.*

 Both the Modal windows uses Panel. I am using wicket 1.4.

 -
 Thanks  Regards,
 Archana
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Modal-window-issue-tp3731060p3731060.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: custom (non wicket) modal dialog. Problem with urls.

2011-08-10 Thread brazz
One step further. My original assumption was wrong. It is a problem with
iframes and the configuration of our firewall. But the situation hasn't
improved.

The url of the link is:

?wicket:interface=:85:border:_body:dialogContainer:contentPanels:infoTextContentPanel:externalLinks:0:externalLink::IResourceListener::

Now i have to prepend my  servlet path e.g. /mybaseurl/mypath to the
relative url of the link, e.g.:

/mybaseurl/mypath/?wicket:interface=:85:border:_body:dialogContainer:contentPanels:infoTextContentPanel:externalLinks:0:externalLink::IResourceListener::

FurtherMore i need an Ajax-ResourceLink (which i think doesn't exist by
now). 

Any suggestions would be greatly appreciated!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/custom-non-wicket-modal-dialog-Problem-with-urls-tp3726196p3733218.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread armandoxxx
@pedro I know. That's why I didn't put the event call in onInitialize()
method ;)

@martin: I if use on before render .. my event would be triggered everytime
my component renders .. so if I want 1 time event after the component is
initialized I have to use somekind of a flag for this event to be called
just once. So that's why I suggested afterInitialized() method ;)

thank you guys for responses 

Regards 

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Igor Vaynberg
we cant keep building these things because eventually someone will ask
for onAfterAfterInitialized() and so on. what we can do is make it
easy for you to build your own. you can create your own
IComponentOnBeforeRenderListener that checks if the component being
rendered is a page and if it is visits all the children and invokes
your callback if it hasnt been already invoked. you can keep track of
whether or not its been invoked by using component metadata.

-igor


On Wed, Aug 10, 2011 at 3:23 AM, armandoxxx armando@dropchop.com wrote:
 Hey guys ...

 With wicket 1.5 we got events. So far so good but I got a case where i'm
 missing after on initialize method call.

 I have lot's of panels on my page, and I create them in onInitialize() code.
 But I need to send a 1 time event after all components are initialized.
 - problem #1: If I send an event from onInitialize():  not sure that all
 components are initialized !
 - problem #2: If is send an event from onConfigure() or onBeforeRender(),
 the event get send everytime component is rendered ...

 So current solution is to create a flag in my panels that sendEventOnInit()
 method was allready called ..

 but it would be better  to have a method onInitialized() |
 afterInitialized() (pick your favorite name).

 If someone has better approach, please let me know about it !

 Kind regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
MyPage.java:
protected void onBeforeRender() {

if (!hasBeenRendered()) {
send(...);
}

super.onBeforeRender();
}

On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx armando@dropchop.com wrote:
 @pedro I know. That's why I didn't put the event call in onInitialize()
 method ;)

 @martin: I if use on before render .. my event would be triggered everytime
 my component renders .. so if I want 1 time event after the component is
 initialized I have to use somekind of a flag for this event to be called
 just once. So that's why I suggested afterInitialized() method ;)

 thank you guys for responses

 Regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Igor Vaynberg
this will get called more than once for a component that starts out
and remains invisible for a while.

-igor


On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov mgrigo...@apache.org wrote:
 MyPage.java:
 protected void onBeforeRender() {

        if (!hasBeenRendered()) {
            send(...);
        }

        super.onBeforeRender();
    }

 On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx armando@dropchop.com wrote:
 @pedro I know. That's why I didn't put the event call in onInitialize()
 method ;)

 @martin: I if use on before render .. my event would be triggered everytime
 my component renders .. so if I want 1 time event after the component is
 initialized I have to use somekind of a flag for this event to be called
 just once. So that's why I suggested afterInitialized() method ;)

 thank you guys for responses

 Regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
That's why I put MyPage.java: above it.
I've never tried to make the page invisible :-)

On Wed, Aug 10, 2011 at 8:32 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 this will get called more than once for a component that starts out
 and remains invisible for a while.

 -igor


 On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 MyPage.java:
 protected void onBeforeRender() {

        if (!hasBeenRendered()) {
            send(...);
        }

        super.onBeforeRender();
    }

 On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx armando@dropchop.com wrote:
 @pedro I know. That's why I didn't put the event call in onInitialize()
 method ;)

 @martin: I if use on before render .. my event would be triggered everytime
 my component renders .. so if I want 1 time event after the component is
 initialized I have to use somekind of a flag for this event to be called
 just once. So that's why I suggested afterInitialized() method ;)

 thank you guys for responses

 Regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Igor Vaynberg
what if a component is added later during a panel swap?

-igor

On Wed, Aug 10, 2011 at 10:34 AM, Martin Grigorov mgrigo...@apache.org wrote:
 That's why I put MyPage.java: above it.
 I've never tried to make the page invisible :-)

 On Wed, Aug 10, 2011 at 8:32 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 this will get called more than once for a component that starts out
 and remains invisible for a while.

 -igor


 On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 MyPage.java:
 protected void onBeforeRender() {

        if (!hasBeenRendered()) {
            send(...);
        }

        super.onBeforeRender();
    }

 On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx armando@dropchop.com 
 wrote:
 @pedro I know. That's why I didn't put the event call in onInitialize()
 method ;)

 @martin: I if use on before render .. my event would be triggered everytime
 my component renders .. so if I want 1 time event after the component is
 initialized I have to use somekind of a flag for this event to be called
 just once. So that's why I suggested afterInitialized() method ;)

 thank you guys for responses

 Regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Martin Grigorov
Now I'm convinced we need onAfterInitialize() :-)

On Wed, Aug 10, 2011 at 8:42 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 what if a component is added later during a panel swap?

 -igor

 On Wed, Aug 10, 2011 at 10:34 AM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 That's why I put MyPage.java: above it.
 I've never tried to make the page invisible :-)

 On Wed, Aug 10, 2011 at 8:32 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 this will get called more than once for a component that starts out
 and remains invisible for a while.

 -igor


 On Wed, Aug 10, 2011 at 10:25 AM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 MyPage.java:
 protected void onBeforeRender() {

        if (!hasBeenRendered()) {
            send(...);
        }

        super.onBeforeRender();
    }

 On Wed, Aug 10, 2011 at 8:18 PM, armandoxxx armando@dropchop.com 
 wrote:
 @pedro I know. That's why I didn't put the event call in onInitialize()
 method ;)

 @martin: I if use on before render .. my event would be triggered 
 everytime
 my component renders .. so if I want 1 time event after the component is
 initialized I have to use somekind of a flag for this event to be called
 just once. So that's why I suggested afterInitialized() method ;)

 thank you guys for responses

 Regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3733649.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Include Tag Resolver

2011-08-10 Thread Christian Huber

Hi all,

maybe someone might find this useful. I created a tag resolver to allow 
include components to be used in the same way as label components with 
the wicket:message tag. With this resolver you can use a tag like e.g. 
wicket:include file=path/to/file/ to include a file into a page. It 
is also able to look up the file name with a property value and to 
interpolate variables in the included file.


The complete source can be found here 
http://sanityresort.blogspot.com/2011/08/creating-custom-wicket-tag-resolver.html. 
Any comments or suggestions would be very welcome.


Cheers, Chris

--
The Sanity Resort http://sanityresort.blogspot.com/


Re: how to implement a Form with Ajax Paginated List of Checkboxes?

2011-08-10 Thread bad boy
AjaxFormChoiceComponentUpdatingBehavior did not work. For some reason ir would 
only ccept the first checkbox.  when I checked  say 5 checkboxe, it would only 
remember the first fone


But changing Check to AjaxCheckBox worked perfectly.


Thanks





- Original Message -
From: Martin Grigorov mgrigo...@apache.org
To: users@wicket.apache.org; bad boy badmas...@yahoo.com
Cc: 
Sent: Wednesday, August 10, 2011 7:35 AM
Subject: Re: how to implement a Form with Ajax Paginated List of Checkboxes?

Add AjaxFormChoiceComponentUpdatingBehavior to the CheckGroup

On Wed, Aug 10, 2011 at 4:38 AM, bad boy badmas...@yahoo.com wrote:
 On my Wicket page, I have a form with a couple of TextFields and a paginated 
 List of Checkboxes implemented with Dataview and and a sortable data 
 provider.  The ajax pagination of the dataview works fine.

 The problem is that when I select a few items on Page 1 and then go to Page 2 
 and then return to Page 1 using the AjaxPagingNavigator, the selection is 
 lost : the items that were checked on Page 1 initially do no have the check 
 mark anymore.

 What should I do so that the items that were selected on a page of Dataview 
 do not get lost when the AjaxPagnigaion is used to traverse the pages of the 
 Dataview ?



 public final class AjaxFormWithPaginatedCheckBoxPage extends BasePage {

 static Logger logger = 
 Logger.getLogger(AjaxFormWithPaginatedCheckBoxPage.class);
 private Person person = new Person();
 int counter = 0;

 WebMarkupContainer webMC;
 static ListPerson pList=Person.getPersons(100);
 int maxListCount=5;
 DataView dv;
 CheckGroup group;
 public AjaxFormWithPaginatedCheckBoxPage() {
     super();
     final Form form = new Form(form, new CompoundPropertyModel(person)) {

         protected void onSubmit() {
             logger.info(form recived);
             logger.info( person name  + person.getName());

             setResponsePage(new AjaxTogglePanelTestPage());
         }
     };
     final TextField name = new TextField(name);
     final TextField age = new TextField(age);
     form.add(name);
     form.add(age);


     group=new CheckGroup(group, new ArrayList());
     form.add(group);

     webMC= new WebMarkupContainer(webMC);
     webMC.setOutputMarkupId(true);


     SortablePersonDataProvider personDataProvider=new 
 SortablePersonDataProvider(pList);
     dv = new DataViewPerson(persons, personDataProvider) {

         @Override
         protected void populateItem(ItemPerson item) {
             item.add(new Check(check, item.getModel()));

             item.add(new Label(id, new PropertyModel(item.getModel(), 
 id)));
             item.add(new Label(name, new PropertyModel(item.getModel(), 
 name)));
             item.add(new Label(age, new PropertyModel(item.getModel(), 
 age)));
         }


     };
     dv.setItemsPerPage(maxListCount);


     webMC.add(new AjaxFallbackOrderByBorder(orderByID, id, 
 personDataProvider)
     {
         @Override
         protected void onSortChanged()
         {
             dv.setCurrentPage(0);
         }

         @Override
         protected void onAjaxClick(AjaxRequestTarget target) {
             target.addComponent(webMC);
         }
     });

     webMC.add(new AjaxFallbackOrderByBorder(orderByName, name, 
 personDataProvider)
     {
         @Override
         protected void onSortChanged()
         {
             dv.setCurrentPage(0);
         }

         @Override
         protected void onAjaxClick(AjaxRequestTarget target) {
             target.addComponent(webMC);
         }
     });
     webMC.add(new AjaxFallbackOrderByBorder(orderByAge, age, 
 personDataProvider)
     {
         @Override
         protected void onSortChanged()
         {
             dv.setCurrentPage(0);
         }

         @Override
         protected void onAjaxClick(AjaxRequestTarget target) {
             target.addComponent(webMC);
         }
     });


     webMC.add(dv);
     webMC.add(new AjaxPagingNavigator(navigator,dv));
     group.add(webMC);

     AjaxButton ab = new AjaxButton(ajax-button, new 
 PropertyModelString(this,
             counter), form) {

         @Override
         protected void onSubmit(AjaxRequestTarget target, Form? form) {
             counter++;
             logger.info(ajx form recived);
             logger.info(ajx person name  + person.getName());

             target.addComponent(this);

         }
     };
     form.add(ab);
     form.setDefaultButton(ab);

     add(form);
 }
 }

 Thanks
 Badmash

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


[announce] Wicket .1.4.18 is released

2011-08-10 Thread Martin Grigorov
The Wicket Team is proud to release the eightteenth release of the
Wicket 1.4.x series.
This is primarily a minor bugfix release.

Release Artifacts:
* Subversion tag: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.4.18
* Changelog: 
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316329
* To use in Maven:
dependency
   groupIdorg.apache.wicket/groupId
   artifactIdwicket/artifactId
   version1.4.18/version
/dependency
* Download the full distribution:
http://www.apache.org/dyn/closer.cgi/wicket/1.4.18 (including source)

The Wicket Team

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org