Re: Equivalent of newSessionStore() in wicket 1.5.7

2012-08-10 Thread Madasamy Sankarapandian
Thankyou very much martin.

I am create custom MyWebSessionStoreProvider class and this class
implements IProvider interface.
The get() method return a MySessionStore.
Then i am using following setter method to set the
MyWebSessionStoreProvider().
@Override
protected void init()
{
 setSessionStoreProvider(new MyWebSessionStoreProvider())
}

Now my application is running very fine


Re: enabling and disabling the components

2012-08-10 Thread Sebastien
Hi,

Label label = new Label(fName,  myVO.getName()); // (or better use new
PropertyModelString(user, name) )
label.setVisible(myVO.getName()!=null);
add(label );

Also, the fName markup id seems to be missing in your html (also the
message markup id in test)
div wicket:id=test1
div wicket:id=fName

/div
/div

div wicket:id=test1
div wicket:id=message

/div
/div

Hope this helps,
Sebastien.

On Fri, Aug 10, 2012 at 12:49 AM, wicket user samd...@live.com wrote:

 Hi,
  I tried this .

 public class MyContainer extends WebMarkupContainer{
 public MyContainer(String id, MyVO myVO) {
 super(id);
 if(myVO.getName()!=null)
   add( new Label(fName,  myVO.getName()));
 else
  add( new Label(fName,  )).setVisible(false);
 }
 public MyContainer(String id){
 super(id);
  add(new Label(message, Testing Label);
 }

 }


 Calling from my Class

 add( new MyContainer(test));
 add( new MyContainer(test1, VO);


 In html

 div wicket:id=test

 /div

 div wicket:id=test1

 /div




 But the problem is I am getting the first markup which is test and not
 the
 test1 even though the getName is not null.

 PLease advise



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/enabling-and-disabling-the-components-tp4651107p4651112.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: stack traces in serialization caches

2012-08-10 Thread Martin Grigorov
Hi,

Which version of Wicket do you use ?

See 
org.apache.wicket.settings.IDebugSettings#setLinePreciseReportingOnAddComponentEnabled
and 
org.apache.wicket.settings.IDebugSettings#setLinePreciseReportingOnNewComponentEnabled.
When set to true these create an exception and saves its stacktrace as
String in the Component's meta data. This stacktrace is used to find
when and where the problem happened.

These stacktraces are printed only if
org.apache.wicket.settings.IDebugSettings#getComponentUseCheck()
returns true.


On Fri, Aug 10, 2012 at 4:16 AM, Andrew Geery andrew.ge...@gmail.com wrote:
 I have a question about why I am seeing stack traces in my wicket-filestore
 files.  This question has been asked before (
 http://apache-wicket.1842946.n4.nabble.com/Strange-content-serialized-td1933194.html),
 but I don't understand the answer.  When I run the app, I don't get any
 errors -- all of the components render fine.  However, in the files I see
 errors like this:

 The webmarkupcontainer with id 'content' that failed to render was added

 In the previous thread, the answer was that the error was there because
 there was a discrepancy between the Java hierarchy and the HTML file.
  However, if there was an error, wouldn't I get a run-time error (since I
 am running the app in development mode)?  Why, when there isn't
 a discrepancy, is there a stack trace in the cache?

 Thanks
 Andrew



-- 
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: I am also crazy :)

2012-08-10 Thread Martin Grigorov
Bravo! :-)

On Fri, Aug 10, 2012 at 12:08 AM, Dan Simko wicke...@gmail.com wrote:
 Hi,

 I've just upgraded my Wicket - Brix application (http://www.sportave.com) to
 6.0-SNAPSHOT and everything seems to be working great.

 Big thanks to all contributors!

 --
 You received this message because you are subscribed to the Google Groups
 brix-cms-discuss group.
 To post to this group, send email to brix-cms-disc...@googlegroups.com.
 To unsubscribe from this group, send email to
 brix-cms-discuss+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/brix-cms-discuss?hl=en.

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



Re: [Wicketstuff] Google Maps 3 component

2012-08-10 Thread Martin Grigorov
Thank you, Joachim!
For all your contributions to WicketStuff!

On Thu, Aug 9, 2012 at 10:45 PM, Joachim Rohde
mailingl...@joachimrohde.com wrote:
 Hello,

 maybe someone might be interested that I have uploaded a component for
 Google Maps 3 today which can be found at GitHub under
 https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3
 (I'm not sure when the snapshots are build so it might be necessary to build
 the project from source still)

 A (still) very brief overview can be found in the Wiki:
 https://github.com/wicketstuff/core/wiki/Gmap3

 And the examples are under
 https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3-examples

 So, if anyone is in the need of such a component or just want to play a bit
 with it, I would appreciate to hear any feedback.

 Joachim Rohde

 -
 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: Searching for new experience with wicket

2012-08-10 Thread Martin Grigorov
Hi,

Do you want to help us with the new Wicket-Examples ? ;-)
At 
https://github.com/apache/wicket/tree/master/wicket-experimental/wicket-examples-parent
you may see what we have so far.
The goal is to migrate the old wicket-examples to the new style.
The skills you will improve:
- Java 6
- Wicket 6
- jQuery
- Git (GitHub)
- Twitter Bootstrap (basic knowledge of CSS)

I think this task will help you understand most of Wicket.

If you are interested then you can fork the project, ask your
questions at d...@wicket.apache.org (first subscribe to it) and start
sending us Pull Requests :-)

On Fri, Aug 10, 2012 at 12:40 AM, procrastinative.developer
procrastinative.develo...@gmail.com wrote:
 I am intermediate java developer (~2 years of commercial JEE experience). I
 am searching for some open source (maybe commercial) project based on wicket
 where I could improve my skills.

 I work on:
 -java 6
 -wicket 6 (could be earlier)
 -JPA 2.0
 -basic knowledge of jQuery and Js
 -intermediate VCS


 Samples of me code:
 https://github.com/procrastinativedeveloper
 Please look on jcrop integration, syntax highlighter is still in production.

 What I want to achieve
 -increase my wicket and java knowledge
 -improve my English

 What I could offer:
 -fresh look into project :)
 -8h-16h of my time per week

 I need:
 -guidelines and mentor support





 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Searching-for-new-experience-with-wicket-tp465.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



How to update the treetable

2012-08-10 Thread lxw_first
I created a treetable with a treemodel based on database schema. I am trying
to refresh the treetable so that it will change it's data after some db
update.
I update viat the button event.the button event work but treetable doesn't
change.
To create treetable i have this on my page:

treeTable = new TreeTable(treeTable, createTreeModel(), columns);
treeTable.getTreeState().setAllowSelectMultiple(true);
treeTable.setRootLess(true);
treeTable.getTreeState().collapseAll();
creatForm.add(treeTable);

the createTreeModel code:
protected TreeModel createTreeModel() {
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
initTree(roleList, rootNode);
TreeModel treeModel = new DefaultTreeModel(rootNode);
return treeModel;
}

i add the button event like this:
protected void onSubmit(AjaxRequestTarget target, Form? form) {
roleList.clear();
treeTable.updateTree(target);
target.add(getForm(),treeTable);
}

Any idea or reference to documentation that explain this?
thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-update-the-treetable-tp4651122.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:treetable with checkbox column

2012-08-10 Thread lxw_first
the create treetable code like this:
treeTable = new TreeTable(treeTable, createTreeModel(), columns);
treeTable.getTreeState().setAllowSelectMultiple(true);
treeTable.setRootLess(true);
treeTable.getTreeState().collapseAll();
creatForm.add(treeTable);

the columns code:
new PropertyCheckboxColumn(new ColumnLocation(Alignment.RIGHT, size,
Unit.EM), header, type);

how can i get the checkbox selected?




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-treetable-with-checkbox-column-tp4650737p4651123.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: Equivalent of newSessionStore() in wicket 1.5.7

2012-08-10 Thread Madasamy Sankarapandian
i am throw this exception when the session is invalidate

throw new RestartResponseAtInterceptPageException(MyappLoginPage.class)

But is not working in wicket 1.5.7.but it is working fine in wicket 1.4.X


Re: AutoCompleteTextField + AjaxFormComponentUpdatingBehavior onchange problem on wicket 6.0

2012-08-10 Thread Martin Grigorov
Hi,

Jira is down so I cannot comment there.

I've just fixed the bug with the keyboard navigation.

About the two fires when using the mouse - I have no idea how this
worked in 1.5. Here is what happens now: the user enter something in
the input, then goes and clicks on an option in the drop-down. Here
the browser detects 'change' of the input and fires it, then it
executes the 'click' on the option and our callback copies the option
value to the input's value and we fire artificial 'change' event to
notify you.

So far I cannot figure out how the first 'change' is suppressed in 1.5.

@Igor: as an expert in autocompleting business, do you have idea how
to handle this ?

On Thu, Aug 9, 2012 at 8:56 PM, Diego Fincatto diego.finca...@gmail.com wrote:
 I opened a bug report for the issue:
 https://issues.apache.org/jira/browse/WICKET-4705

 On Thu, Aug 9, 2012 at 11:13 AM, Diego Fincatto
 diego.finca...@gmail.com wrote:
 I have an AutoCompleteTextField with one
 AjaxFormComponentUpdatingBehavior added and, on wicket 6.0, it stop
 working. It was working perfectly on wicket 1.5.7.
 When I select on value with keyboard, nothing happens. When I click in
 some option, the event is fired twice.

 I attached a quickstart with the problem. Changing the wicket version
 to 1.5.7, everything works ok.

 Any tips?

 -
 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: stack traces in serialization caches

2012-08-10 Thread Andrew Geery
I'm using Wicket 1.5.7.  I understand how to turn the stacktraces on and
off (in development more I have both those settings turned on).  My
question is more: the files look like they are indicating an error is
happening, but I don't get a stacktrace at run-time.  For example, if I
have a mismatch between the Java class and the HTML I get a stacktrace at
run-time in development mode.  I'm running in development mode and I'm not
getting any stacktraces.  However, when I look at the wicket-filestore
files I am seeing stacktraces.  My questions are:

(1) Do the stacktraces in the wicket-filestore files indicate that there is
an error? The app seems to work fine, but a stacktrace would indicate an
error to me...
(2) If these are indeed errors, why are the errors on the wicket-filestore
files not being thrown at run-time when running in dev mode?

To make this more concrete, one place I'm seeing the errors is around
ModalWindow components.  Is the stacktrace simply saying that the
ModalWindow is not rendered on the page (which would be true, it is not yet
shown), but that it is present in the page's hierarchy?

Thanks
Andrew

On Fri, Aug 10, 2012 at 3:12 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Which version of Wicket do you use ?

 See
 org.apache.wicket.settings.IDebugSettings#setLinePreciseReportingOnAddComponentEnabled
 and
 org.apache.wicket.settings.IDebugSettings#setLinePreciseReportingOnNewComponentEnabled.
 When set to true these create an exception and saves its stacktrace as
 String in the Component's meta data. This stacktrace is used to find
 when and where the problem happened.

 These stacktraces are printed only if
 org.apache.wicket.settings.IDebugSettings#getComponentUseCheck()
 returns true.


 On Fri, Aug 10, 2012 at 4:16 AM, Andrew Geery andrew.ge...@gmail.com
 wrote:
  I have a question about why I am seeing stack traces in my
 wicket-filestore
  files.  This question has been asked before (
 
 http://apache-wicket.1842946.n4.nabble.com/Strange-content-serialized-td1933194.html
 ),
  but I don't understand the answer.  When I run the app, I don't get any
  errors -- all of the components render fine.  However, in the files I see
  errors like this:
 
  The webmarkupcontainer with id 'content' that failed to render was added
 
  In the previous thread, the answer was that the error was there because
  there was a discrepancy between the Java hierarchy and the HTML file.
   However, if there was an error, wouldn't I get a run-time error (since I
  am running the app in development mode)?  Why, when there isn't
  a discrepancy, is there a stack trace in the cache?
 
  Thanks
  Andrew



 --
 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: stack traces in serialization caches

2012-08-10 Thread Martin Grigorov
No, these are no errors.
These are kept only in case of error.
We can improve though by removing them in Component#detach(). I see no
reason to keep them around after the first render of the page.
Please file a ticket.

On Fri, Aug 10, 2012 at 2:45 PM, Andrew Geery andrew.ge...@gmail.com wrote:
 I'm using Wicket 1.5.7.  I understand how to turn the stacktraces on and
 off (in development more I have both those settings turned on).  My
 question is more: the files look like they are indicating an error is
 happening, but I don't get a stacktrace at run-time.  For example, if I
 have a mismatch between the Java class and the HTML I get a stacktrace at
 run-time in development mode.  I'm running in development mode and I'm not
 getting any stacktraces.  However, when I look at the wicket-filestore
 files I am seeing stacktraces.  My questions are:

 (1) Do the stacktraces in the wicket-filestore files indicate that there is
 an error? The app seems to work fine, but a stacktrace would indicate an
 error to me...
 (2) If these are indeed errors, why are the errors on the wicket-filestore
 files not being thrown at run-time when running in dev mode?

 To make this more concrete, one place I'm seeing the errors is around
 ModalWindow components.  Is the stacktrace simply saying that the
 ModalWindow is not rendered on the page (which would be true, it is not yet
 shown), but that it is present in the page's hierarchy?

 Thanks
 Andrew

 On Fri, Aug 10, 2012 at 3:12 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Which version of Wicket do you use ?

 See
 org.apache.wicket.settings.IDebugSettings#setLinePreciseReportingOnAddComponentEnabled
 and
 org.apache.wicket.settings.IDebugSettings#setLinePreciseReportingOnNewComponentEnabled.
 When set to true these create an exception and saves its stacktrace as
 String in the Component's meta data. This stacktrace is used to find
 when and where the problem happened.

 These stacktraces are printed only if
 org.apache.wicket.settings.IDebugSettings#getComponentUseCheck()
 returns true.


 On Fri, Aug 10, 2012 at 4:16 AM, Andrew Geery andrew.ge...@gmail.com
 wrote:
  I have a question about why I am seeing stack traces in my
 wicket-filestore
  files.  This question has been asked before (
 
 http://apache-wicket.1842946.n4.nabble.com/Strange-content-serialized-td1933194.html
 ),
  but I don't understand the answer.  When I run the app, I don't get any
  errors -- all of the components render fine.  However, in the files I see
  errors like this:
 
  The webmarkupcontainer with id 'content' that failed to render was added
 
  In the previous thread, the answer was that the error was there because
  there was a discrepancy between the Java hierarchy and the HTML file.
   However, if there was an error, wouldn't I get a run-time error (since I
  am running the app in development mode)?  Why, when there isn't
  a discrepancy, is there a stack trace in the cache?
 
  Thanks
  Andrew



 --
 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





-- 
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



Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread Bertrand Guay-Paquet

Hi,

(Using Wicket 6.0-SNAPSHOT, or 1.5.7)

I found a strange behavior when calling Page#isPageStateless(). I have a 
simple label in my personal wicket debug bar which displays stateless 
when a page is stateless. It works like so:


new WebMarkupContainer(statelessMarker) {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(getPage().isPageStateless());
}
};

This worked great until I got by chance a page which was stateless 
except for ajax links which were children of a repeater. Here is what 
happens then:
1) onConfigure() is called which calls isPageStateless() and determines 
the page is stateless
2) onBeforeRender() is executed which populates the repeaters and adds 
stateful components to the tree

3) Since the page was determined stateless in 1), it stays that way
4) stateful ajax callback links do not work on the page

Therefore, it seems that isPageStateless() should never be called before 
onBeforeRender() is executed or mayhem may ensue. However, after cursory 
inspection of callers of isPageStateless(), it looks like that is not 
always the case so I'm not certain.


Should this be considered a bug? Should an assertion be made in 
isPageStateless() that onBeforeRender() was executed?


Regards,
Bertrand

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



Re: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread Martin Grigorov
Hi,

The page can become stateful during rendering, as you have noticed.
There is a code in WebPageRenderer that re-renders the page if it
change state during the first rendering because otherwise some
previously rendered links may became broken.

The real problem here is that #isPageStateless() does caching (by
using Page#stateless variable) and once set it doesn't bother asking
the components second time.

I see no reason to add restrictions related to the page's lifecycle.
This wont help.
The only solution that I see is to remove the caching and make this
call more expensive. But even in this case your logic wont work.
It will work only if your label is at the very bottom of the page.

On Fri, Aug 10, 2012 at 4:31 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Hi,

 (Using Wicket 6.0-SNAPSHOT, or 1.5.7)

 I found a strange behavior when calling Page#isPageStateless(). I have a
 simple label in my personal wicket debug bar which displays stateless when
 a page is stateless. It works like so:

 new WebMarkupContainer(statelessMarker) {
 @Override
 protected void onConfigure() {
 super.onConfigure();
 setVisible(getPage().isPageStateless());
 }
 };

 This worked great until I got by chance a page which was stateless except
 for ajax links which were children of a repeater. Here is what happens then:
 1) onConfigure() is called which calls isPageStateless() and determines the
 page is stateless
 2) onBeforeRender() is executed which populates the repeaters and adds
 stateful components to the tree
 3) Since the page was determined stateless in 1), it stays that way
 4) stateful ajax callback links do not work on the page

 Therefore, it seems that isPageStateless() should never be called before
 onBeforeRender() is executed or mayhem may ensue. However, after cursory
 inspection of callers of isPageStateless(), it looks like that is not always
 the case so I'm not certain.

 Should this be considered a bug? Should an assertion be made in
 isPageStateless() that onBeforeRender() was executed?

 Regards,
 Bertrand

 -
 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



Multi row Tabs

2012-08-10 Thread Valery Gorbunov
Hi All,

I am new in Wicket. Is it possible to implement Tabs in multi row manner. I
see in examples or tutorial only singe row tabs.

If not. Which best way to implement it?

Thank you.

Valery Gorbunov


RadioGroup

2012-08-10 Thread Artem001
Hello there, mighty developers. 
I'm quite new in Wicket, so beforehand sorry if my question is stupid.
So what i have is a RadioGroup, with some childs. When page loads for the
first time, 
one of child gets selected by default, and everything is fine. But, when i
change selection and 
press submit button ( non-Ajax ), form validates,re-renders and default
child instead of selected one gets selection. 
What i'm doing wrong or not doing at all?

here is the example of how childs get populated :

SelectItem[] selectOneRadioItems = new SelectItem[]{};
RadioGroup radioGroup = new RadioGroup(radioGroup, new Model());
ListViewSelectItem selectOneRadioListItems = new
ListViewSelectItem(radioGroup, Arrays.asList(selectOneRadioItems)) {
  protected void populateItem(ListItemSelectItem item) {
Label label = new Label(label, new
ModelString(item.getModel().getObject().getLabel()));
item.add(label);
SelectItemModelSerializable itemModel = new
SelectItemModelSerializable(SelectItem)item.getModel().getObject());
RadioSerializable radio = new RadioSerializable(radio, itemModel,
RadioGroupParent);
item.add(radio);
}
};

Any tips will be appreciated. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-tp4651132.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: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread vineet semwal
it might give you wrong result even if you add your component after
adding all the components because  some components foreg. a repeater
like listview/dataview/gridview  add children in onbeforerender so
isPageStateless() can be assumed to work correctly only after
onbeforerender

that caching part is ok imho   for isPageStateless() ,actually that
cached variable is reset in page#onbeforerender which is the another
reason isPageStateless()  should work correctly after onbeforerender


On Fri, Aug 10, 2012 at 7:43 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 The page can become stateful during rendering, as you have noticed.
 There is a code in WebPageRenderer that re-renders the page if it
 change state during the first rendering because otherwise some
 previously rendered links may became broken.

 The real problem here is that #isPageStateless() does caching (by
 using Page#stateless variable) and once set it doesn't bother asking
 the components second time.

 I see no reason to add restrictions related to the page's lifecycle.
 This wont help.
 The only solution that I see is to remove the caching and make this
 call more expensive. But even in this case your logic wont work.
 It will work only if your label is at the very bottom of the page.

 On Fri, Aug 10, 2012 at 4:31 PM, Bertrand Guay-Paquet
 ber...@step.polymtl.ca wrote:
 Hi,

 (Using Wicket 6.0-SNAPSHOT, or 1.5.7)

 I found a strange behavior when calling Page#isPageStateless(). I have a
 simple label in my personal wicket debug bar which displays stateless when
 a page is stateless. It works like so:

 new WebMarkupContainer(statelessMarker) {
 @Override
 protected void onConfigure() {
 super.onConfigure();
 setVisible(getPage().isPageStateless());
 }
 };

 This worked great until I got by chance a page which was stateless except
 for ajax links which were children of a repeater. Here is what happens then:
 1) onConfigure() is called which calls isPageStateless() and determines the
 page is stateless
 2) onBeforeRender() is executed which populates the repeaters and adds
 stateful components to the tree
 3) Since the page was determined stateless in 1), it stays that way
 4) stateful ajax callback links do not work on the page

 Therefore, it seems that isPageStateless() should never be called before
 onBeforeRender() is executed or mayhem may ensue. However, after cursory
 inspection of callers of isPageStateless(), it looks like that is not always
 the case so I'm not certain.

 Should this be considered a bug? Should an assertion be made in
 isPageStateless() that onBeforeRender() was executed?

 Regards,
 Bertrand

 -
 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




-- 
regards,

Vineet Semwal

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



issue refreshing covered panel when modalwindow is open

2012-08-10 Thread Andrew Geery
I've run into this issue a couple of times and worked around it, but I
wanted to see if there is a better way of handling it.

I have a form in a panel in a ModalWindow on top of a datatable in a page.
 When a user clicks the Save ajax button in the modal window, a done event
is bubbled up from the modal window.  The event contains the
AjaxRequestTarget from the button.

There are two components that listen for the done event:

(1) the component that launched the ModalWindow -- this listener closes the
modal window
(2) a component farther up the hierarchy which contains (1) -- this
listener (re) adds the datatable on the page

I have verified that both listeners are being called and that they are
called in the order above.  However, the datatable does not get refreshed
in the browser.

My question is: why didn't my datatable get re-rendered, even though I did
(re) add it to the containing panel?  I think this has something to do with
the datatable not realizing it is visible/active.  Or it may have something
to do with the event system :).  Or perhaps even the AjaxRequestTarget from
the panel in the modal window :).  I'm happy to put in some break points
and walk through the code if you anyone has ideas of where to look.

The workaround is to have (1) listen for the event and stop the event
propagation.  Then, in the ModalWindow.setWindowClosedCallback(), send the
event up to (2).  Doing this, the datatable does get properly refreshed.

My followup question is: is this the pattern that should be followed when
refreshing a panel under a modal window?  Namely, don't try to refresh the
page/panel a ModalWindow is on top of until the covering ModalWindow has
closed?

Thanks
Andrew


Re: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread vineet semwal
currently i think you can do by keeping some boolean variable that you
can populate after page#onbeforerender
and override your desired component's isVisible() {return my_boolean ;}

On Fri, Aug 10, 2012 at 7:01 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Hi,

 (Using Wicket 6.0-SNAPSHOT, or 1.5.7)

 I found a strange behavior when calling Page#isPageStateless(). I have a
 simple label in my personal wicket debug bar which displays stateless when
 a page is stateless. It works like so:

 new WebMarkupContainer(statelessMarker) {
 @Override
 protected void onConfigure() {
 super.onConfigure();
 setVisible(getPage().isPageStateless());
 }
 };

 This worked great until I got by chance a page which was stateless except
 for ajax links which were children of a repeater. Here is what happens then:
 1) onConfigure() is called which calls isPageStateless() and determines the
 page is stateless
 2) onBeforeRender() is executed which populates the repeaters and adds
 stateful components to the tree
 3) Since the page was determined stateless in 1), it stays that way
 4) stateful ajax callback links do not work on the page

 Therefore, it seems that isPageStateless() should never be called before
 onBeforeRender() is executed or mayhem may ensue. However, after cursory
 inspection of callers of isPageStateless(), it looks like that is not always
 the case so I'm not certain.

 Should this be considered a bug? Should an assertion be made in
 isPageStateless() that onBeforeRender() was executed?

 Regards,
 Bertrand

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




-- 
regards,

Vineet Semwal

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



Re: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread Bertrand Guay-Paquet


On 10/08/2012 12:12 PM, vineet semwal wrote:

it might give you wrong result even if you add your component after
adding all the components because  some components foreg. a repeater
like listview/dataview/gridview  add children in onbeforerender so
isPageStateless() can be assumed to work correctly only after
onbeforerender
Yes that's exactly what I wanted to say! The repeaters are only 
populated in their onBeforeRender() which is executed after onConfigure().



that caching part is ok imho   for isPageStateless() ,actually that
cached variable is reset in page#onbeforerender which is the another
reason isPageStateless()  should work correctly after onbeforerender
I hadn't noticed that reset in Page#onBeforeRender() so I had a look 
since it would contradict my observations.


This is the stack trace when my label's onConfigure() is reached :
TmpPage$1.onConfigure() line: 24-- my stateless indicator label; 
calls isPageStateless()

TmpPage$1(Component).configure() line: 1028
TmpPage$1(Component).internalBeforeRender() line: 913
TmpPage$1(Component).beforeRender() line: 990
TmpPage(MarkupContainer).onBeforeRenderChildren() line: 1688
TmpPage(Component).onBeforeRender() line: 3830
TmpPage(Page).onBeforeRender() line: 802--- line 799 already did 
the reset of the cached stateless var

TmpPage(Component).internalBeforeRender() line: 922
TmpPage(Component).beforeRender() line: 990
TmpPage(Component).internalPrepareForRender(boolean) line: 2204
TmpPage(Page).internalPrepareForRender(boolean) line: 247
TmpPage(Component).render() line: 2289
TmpPage(Page).renderPage() line: 1021

This stack trace occurs before the repeating view is populated which 
would render the page stateful and causes the Page to cache that it is 
stateless.


By the way, I did find a workaround to achieve the desired effect so 
that's not why I brought this up here. I'm just concerned that such 
erroneous computations of the page's stateless state might cause other 
bugs down the road.


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



Re: RadioGroup

2012-08-10 Thread Andrea Del Bene

Hi and welcome to this mailing list!

it's not clear to me the purpose of the ListView in your code. Why do 
you need it and what is the relation between this component and RadioGroup?

Hello there, mighty developers.
I'm quite new in Wicket, so beforehand sorry if my question is stupid.
So what i have is a RadioGroup, with some childs. When page loads for the
first time,
one of child gets selected by default, and everything is fine. But, when i
change selection and
press submit button ( non-Ajax ), form validates,re-renders and default
child instead of selected one gets selection.
What i'm doing wrong or not doing at all?

here is the example of how childs get populated :

SelectItem[] selectOneRadioItems = new SelectItem[]{};
RadioGroup radioGroup = new RadioGroup(radioGroup, new Model());
ListViewSelectItem selectOneRadioListItems = new
ListViewSelectItem(radioGroup, Arrays.asList(selectOneRadioItems)) {
   protected void populateItem(ListItemSelectItem item) {
Label label = new Label(label, new
ModelString(item.getModel().getObject().getLabel()));
item.add(label);
SelectItemModelSerializable itemModel = new
SelectItemModelSerializable(SelectItem)item.getModel().getObject());
RadioSerializable radio = new RadioSerializable(radio, itemModel,
RadioGroupParent);
item.add(radio);
}
};

Any tips will be appreciated.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-tp4651132.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: how to map 2 html files to 1 class?

2012-08-10 Thread vinitty
Guys, 
You can always create dynamic class 

Use java assist 

I was also having same problem and i use that and it works fine




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-map-2-html-files-to-1-class-tp1890619p4651138.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: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread vineet semwal
you are right onconfigure is executed once before rendering .

actually isPageStateless() can be broken easily as that variable can
be populated before the page#onbeforerender is completed ie. say if
some component in onbeforerender  uses  ispagestateless() then the
variable will be set prematurely

now i see martin-g is correct the solution is to just remove the
caching but the problem can be that method is used in a lot of places
and can be called many times  foreg. it's used inside urlFor in
Component which means link will at least call this method once in
getUrl and if you have a repeater of 20 links this is 20 X
isPageStateless()  ,it actually depends on how expensive
ispagestateless() itself is and at how many places is it used ..


On Fri, Aug 10, 2012 at 10:53 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

 On 10/08/2012 12:12 PM, vineet semwal wrote:

 it might give you wrong result even if you add your component after
 adding all the components because  some components foreg. a repeater
 like listview/dataview/gridview  add children in onbeforerender so
 isPageStateless() can be assumed to work correctly only after
 onbeforerender

 Yes that's exactly what I wanted to say! The repeaters are only populated in
 their onBeforeRender() which is executed after onConfigure().


 that caching part is ok imho   for isPageStateless() ,actually that
 cached variable is reset in page#onbeforerender which is the another
 reason isPageStateless()  should work correctly after onbeforerender

 I hadn't noticed that reset in Page#onBeforeRender() so I had a look since
 it would contradict my observations.

 This is the stack trace when my label's onConfigure() is reached :
 TmpPage$1.onConfigure() line: 24-- my stateless indicator label; calls
 isPageStateless()
 TmpPage$1(Component).configure() line: 1028
 TmpPage$1(Component).internalBeforeRender() line: 913
 TmpPage$1(Component).beforeRender() line: 990
 TmpPage(MarkupContainer).onBeforeRenderChildren() line: 1688
 TmpPage(Component).onBeforeRender() line: 3830
 TmpPage(Page).onBeforeRender() line: 802--- line 799 already did the
 reset of the cached stateless var
 TmpPage(Component).internalBeforeRender() line: 922
 TmpPage(Component).beforeRender() line: 990
 TmpPage(Component).internalPrepareForRender(boolean) line: 2204
 TmpPage(Page).internalPrepareForRender(boolean) line: 247
 TmpPage(Component).render() line: 2289
 TmpPage(Page).renderPage() line: 1021

 This stack trace occurs before the repeating view is populated which would
 render the page stateful and causes the Page to cache that it is stateless.

 By the way, I did find a workaround to achieve the desired effect so that's
 not why I brought this up here. I'm just concerned that such erroneous
 computations of the page's stateless state might cause other bugs down the
 road.


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




-- 
regards,

Vineet Semwal

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



Wicket / Liferay help

2012-08-10 Thread Doug Leeper
I have followed what I think is necessary to get a wicket portlet in liferay. 
However, I have not been able to add the portlet to a page.

I am by no means a liferay expert so I may be missing something.

Note: liferay 6.1

This is what I have done so far.  Can someone point out what I have done
wrong?
- installed liferay / tomcat
- created a simple wicket (v1.5.7) webapp via the quick start
- created portlet.xml and modified web.xml per 
http://www.paykin.info/java/wicket_liferay_portlets/
http://www.paykin.info/java/wicket_liferay_portlets/ 
- mvn package
- copied war to LH/deploy

Go to the Liferay Control Panel - Update Manager indicates that the portlet
is there

But how do I add it to a page?  I can't seem to find the portlet anywhere.

What have I done wrong?

Any help is greatly appreciated.

Thanks
Doug



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Liferay-help-tp4651140.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: How to update the treetable

2012-08-10 Thread Paul Bors
Since Wicket's TreeTable uses Java's javax.swing.tree.TreeModel, I would
check out Oracle's tutorial on How To Use Trees (JTree).

More precisely the Dynamically Changing a Tree section:
http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html#dynamic

See if that helps you.

~ Thank you,
  Paul Bors

-Original Message-
From: lxw_first [mailto:lxw_fi...@hotmail.com] 
Sent: Friday, August 10, 2012 3:38 AM
To: users@wicket.apache.org
Subject: How to update the treetable

I created a treetable with a treemodel based on database schema. I am trying
to refresh the treetable so that it will change it's data after some db
update.
I update viat the button event.the button event work but treetable doesn't
change.
To create treetable i have this on my page:

treeTable = new TreeTable(treeTable, createTreeModel(), columns);
treeTable.getTreeState().setAllowSelectMultiple(true);
treeTable.setRootLess(true);
treeTable.getTreeState().collapseAll();
creatForm.add(treeTable);

the createTreeModel code:
protected TreeModel createTreeModel() {
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
initTree(roleList, rootNode);
TreeModel treeModel = new DefaultTreeModel(rootNode);
return treeModel;
}

i add the button event like this:
protected void onSubmit(AjaxRequestTarget target, Form? form) {
roleList.clear();
treeTable.updateTree(target);
target.add(getForm(),treeTable);
}

Any idea or reference to documentation that explain this?
thanks.



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/How-to-update-the-treetable-tp465
1122.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: Multi row Tabs

2012-08-10 Thread Paul Bors
You can change the look-n-feel of any Wicket component by simply extending
the Wicket class, and either modify the HTML and/or the CSS.

If you modify the HTML make sure you preserve the wicket component tree
unchanged since the super class will break at runtime if you shift the HTML
code around and break the hierarchy of the wicket component tree.

I extended from AjaxTabbedPanel and have two panels that would either render
the tabs horizontal or vertical and when they reach the end of the page they
will wrap to the second row or column.

The look-n-feel as well as horizontal or vertical orientation is handled by
different CSS classes via the float attribute (and many others) inside my
package. For example:

Horizontal tabs from left to right use this CSS class:
div.horizontalTabpanel div.tab-row li.selected {
float: left;
...
}

Vertical tabs from top to bottom use this:
div.verticalTabpanel div.tab-row li.selected {
float: top;
...
}

One class sets the CSS of the main panel to either horizontalTabpanel or
verticalTabpanel.

~ Thank you,
  Paul Bors

-Original Message-
From: Valery Gorbunov [mailto:valery.gorbu...@hys-enterprise.com] 
Sent: Friday, August 10, 2012 10:34 AM
To: users@wicket.apache.org
Cc: Alex Khalevin
Subject: Multi row Tabs

Hi All,

I am new in Wicket. Is it possible to implement Tabs in multi row manner. I
see in examples or tutorial only singe row tabs.

If not. Which best way to implement it?

Thank you.

Valery Gorbunov


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



Re: Wicket / Liferay help

2012-08-10 Thread Doug Leeper
Got my portlet to show up in the Portal.  Had my liferay-portlet.xml
incorrect.  But there weren't any errors. 

Now I have a weird situation.  I can add the portlet to my page and it
works.  I do a page refresh and now it won't.  I was able to track down at
least why it is not.  But I don't know how to fix it.

The issue is the resulting URL that is generated for calls for the portlet.
This works:  (just added to the page)
http://localhost:/wickettest-portlet/wickettest/ps:d2lja2V0dGVzdF9XQVJfd2lja2V0dGVzdHBvcnRsZXRfTEFZT1VUXzEwNjE3/wicket/resource/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax-ver-1338396584000.js


This does not work: (after a page refresh)
http://localhost:/wickettest-portlet/ps:d2lja2V0dGVzdF9XQVJfd2lja2V0dGVzdHBvcnRsZXRfTEFZT1VUXzEwNjE3/wicket/resource/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax-ver-1338396584000.js


The difference is that the second request does not have wickettest after the
portlet name (wickettest-portlet)

I believe this is now more a liferay question but I thought that if any one
that has liferay/wicket experience could help out in this as the two are
very finicky together.

1) why does this occur?
2) how do I fix it?

Thank
Doug




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Liferay-help-tp4651140p4651143.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: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread Bertrand Guay-Paquet
This is weird, I never received Martin's email! I managed to see it in 
your first reply Vineet... I also lost a few hours' worth of mailing 
list emails.


Removing the caching in isPageStateless() would indeed make sure that 
the code in WebPageRenderer would not get the wrong value. However, all 
the calls made to isPageStateless() before that point could still get 
the wrong value returned, depending on the page. In that case, it seems 
kind of pointless to rely on isPageStateless() for anything at all 
before rendering (or at least onBeforeRender) occurs.


I had a deeper look at callers of isPageStateless() in Wicket's source 
and found two possible causes of concern: 
WebPageRenderer#respond(RequestCycle) and 
ListenerInterfaceRequestHandler#respond(RequestCycle). I'll need to 
examine in them in more details.


To be continued...

On 10/08/2012 6:33 PM, vineet semwal wrote:

you are right onconfigure is executed once before rendering .

actually isPageStateless() can be broken easily as that variable can
be populated before the page#onbeforerender is completed ie. say if
some component in onbeforerender  uses  ispagestateless() then the
variable will be set prematurely

now i see martin-g is correct the solution is to just remove the
caching but the problem can be that method is used in a lot of places
and can be called many times  foreg. it's used inside urlFor in
Component which means link will at least call this method once in
getUrl and if you have a repeater of 20 links this is 20 X
isPageStateless()  ,it actually depends on how expensive
ispagestateless() itself is and at how many places is it used ..


On Fri, Aug 10, 2012 at 10:53 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

On 10/08/2012 12:12 PM, vineet semwal wrote:

it might give you wrong result even if you add your component after
adding all the components because  some components foreg. a repeater
like listview/dataview/gridview  add children in onbeforerender so
isPageStateless() can be assumed to work correctly only after
onbeforerender

Yes that's exactly what I wanted to say! The repeaters are only populated in
their onBeforeRender() which is executed after onConfigure().



that caching part is ok imho   for isPageStateless() ,actually that
cached variable is reset in page#onbeforerender which is the another
reason isPageStateless()  should work correctly after onbeforerender

I hadn't noticed that reset in Page#onBeforeRender() so I had a look since
it would contradict my observations.

This is the stack trace when my label's onConfigure() is reached :
TmpPage$1.onConfigure() line: 24-- my stateless indicator label; calls
isPageStateless()
TmpPage$1(Component).configure() line: 1028
TmpPage$1(Component).internalBeforeRender() line: 913
TmpPage$1(Component).beforeRender() line: 990
TmpPage(MarkupContainer).onBeforeRenderChildren() line: 1688
TmpPage(Component).onBeforeRender() line: 3830
TmpPage(Page).onBeforeRender() line: 802--- line 799 already did the
reset of the cached stateless var
TmpPage(Component).internalBeforeRender() line: 922
TmpPage(Component).beforeRender() line: 990
TmpPage(Component).internalPrepareForRender(boolean) line: 2204
TmpPage(Page).internalPrepareForRender(boolean) line: 247
TmpPage(Component).render() line: 2289
TmpPage(Page).renderPage() line: 1021

This stack trace occurs before the repeating view is populated which would
render the page stateful and causes the Page to cache that it is stateless.

By the way, I did find a workaround to achieve the desired effect so that's
not why I brought this up here. I'm just concerned that such erroneous
computations of the page's stateless state might cause other bugs down the
road.


-
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