ModalWindow with input type = submit

2010-09-28 Thread Early Morning
Hi all,

In our ModalWindow, we have forms that have submit buttons (input type =
submit /). We found that after a user closes a modal window, and then the
user presses the Enter key, an exception is thrown saying that the submit
button is not visible. Is there any solution for this other than setting the
input type to button? Thanks!


Regards,

Ces


How to implement single-select functionality for a set of buttons?

2010-09-09 Thread Early Morning
Hi All,

I just wanted to ask how to go about creating a component that would mimic
radio group or dropdown choice functionality, but be displayed as a set of
buttons? Basically the choices would be displayed as toggle buttons. When
pressing a button, it would be activated and the model changed to that value
(as with a dropdown/radio group), with the others deselected. How would I go
about implementing this? I saw the AbstractSingleSelectChoice class, which I
extended, but I'm a bit unclear how the component is supposed to create the
buttons representing the choices and the logic for selecting and updating
the model. etc. Any help would be greatly appreciated. Thanks!


Regards,

Ces


How to still have session timeout with AjaxTimerBehavior?

2010-06-08 Thread Early Morning
Hi All,

I asked this question before in the context of wicketstuff-push, but
actually, this is a more general instance of that question: what's the best
way to still have the session timeout even though I have a timer behavior in
my page? Would it be wise to keep track of the time in the timer behavior
and invalidate the session there, or is there a better way? Thanks!


Regards,

Ces


Use wicketstuff-push and still have proper session timeout?

2010-06-07 Thread Early Morning
Hi All,

We're currently using the wicketstuff-push project for notifications and the
like. I added a TimerChannelService to our main Application class, and added
a ChannelListener in our BasePage (using the user's username as the
channel).

However, the problem now is that the session never times out since the
Channel Listener polls the server and makes a request every time. Is there a
way to work around this, or some other way I can implement this? Thanks!


Regards,

Ces


Remove busy indicator from ajax timer behavior?

2010-05-12 Thread Early Morning
Hi All,

I followed this to implement a sitewide busy indicator:
https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

However, I have an ajax behavior that polls in the page every 2 seconds, and
every time it does the busy indicator flashes since the showBusysign()
javascript method is registered as the PreCallHandler. How can I remove the
busy indicator for only the polling behavior but keep it for other Ajax
requests? Thanks!


Regards,

Ces


Re: Remove busy indicator from ajax timer behavior?

2010-05-12 Thread Early Morning
Hi Stefan,

Currently there is a javascript method hideBusysign() which is registered as
the PostCallHandler for all Wicket Ajax requests, which  is how the busy
sign is hidden. However, for the timer behavior, I don't want the indicator
to show at all, since it flashes every 2 seconds and is very distracting ^^
Is there a method that I can call/override so that the Ajax PreCallHandler
is not called/changed for this particular behavior? Thanks!


Regards,

Ces

On Wed, May 12, 2010 at 4:28 PM, Stefan Lindner lind...@visionet.de wrote:

 I don't use it but i suggest something like

 div class=hideBusy
   div qwicket:id=budyIndicator/
 /div


 and use

 div.hideBusy {
display:none;
 }

 in css.

 Just theoretically, not tested

 Stefan

 -Ursprüngliche Nachricht-
 Von: Early Morning [mailto:goodmorning...@gmail.com]
 Gesendet: Mi 12.05.2010 09:44
 An: users@wicket.apache.org
 Betreff: Remove busy indicator from ajax timer behavior?

 Hi All,

 I followed this to implement a sitewide busy indicator:

 https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

 However, I have an ajax behavior that polls in the page every 2 seconds,
 and
 every time it does the busy indicator flashes since the showBusysign()
 javascript method is registered as the PreCallHandler. How can I remove the
 busy indicator for only the polling behavior but keep it for other Ajax
 requests? Thanks!


 Regards,

 Ces




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



Best practice for dynamically storing state?

2010-04-05 Thread Early Morning
Hi All,

I have an application with a widget sidebar, with all the normal
capabilities (add/remove widgets for user, minimize, maximize, sort widgets,
etc.). I just wanted to ask what the best practice for storing the state
of these widgets to a DB is. The current implementation involves using an
Ajax call every time the state is changed (complete with a Loading
indicator), so that the state is saved to the DB. This seems a bit heavy to
me though, and doesn't seem that responsive (as the user has to wait every
time the state is changed).

The other option I was thinking of is to just save the state in the Session,
and persist upon logout. Would there be any problems with this approach
(memory-heavy)? Or are there other alternatives? I prefer to have the user
change state (sort, expand/collapse, etc.) anytime they like, which is why I
didn't go for the lock/unlock widgets approach (where you have to manually
save your widget state). If it makes a difference, I'm using wiQuery. Thanks
for any help!


Regards,

Ces


Re: Role-based wicket application

2010-02-28 Thread Early Morning
Hi,

We just use one application/page for all roles, otherwise, you'd have a hard
time maintaining everything especially if you have dynamic roles. Wicket has
an interface you can implement for authorization (IAuthorizationStrategy);
there are also existing projects that implement it for you as well and cover
the general use case such as wicket-auth-roles and wicket-security. However,
we just implemented our own IAuthorizationStrategy since we have an existing
role-based system from older applications so I haven't had much experience
with the existing projects. The basics of implementing your own are covered
pretty well in the Wicket in Action book as well, but if the existing
projects cover your needs then you should be able to use them pretty easily.




On Fri, Feb 26, 2010 at 6:35 PM, Jing Ge (Besitec IT DEHAM) j...@besitec.com
 wrote:

 Hello guys,



 We have been using wicket since more than one year. It is very
 comfortable to work with wicket and live here in this community.
 Thanks you guys!



 Now we want to add more features into our application and we get a
 (actually very common) problem:



 What is the correct way for building a role-based wicket application?



 The requirement is something like this:



 1.  Users are assigned to different roles, or groups, or projects.

 2.  Some pages looks similar to the users of different roles. But they
 are not same.



 We have thought about it for a while and get some ideas:



 1.   One application for all roles and one page for all roles. (with
 if.. else maybe, we know it is not good). Is it possible with wicket?
 Since the wicket:id, that is defined in the html , must be added in the
 java class. Maybe show/hide it for different roles?

 2.   One application for all roles but one page for each role. The
 drawback is the duplicated code  logic. This could be solved by class
 inheritance. But the html files are still duplicated.

 3.   One application for each role.  Build a base project and then
 let other projects inheritance from the base one.



 We know that the third choice is not good (actually very bad from the
 technical point of view, has a lot of problems for changes, release,
 deployment, etc.), but it has also one real great benefit: role relevant
 changes will be limited only to the users of that role. That means, for
 such changes, only the application for that role needed to be updated,
 redeployed, and restarted.



 Is there any features of wicket can solve such problem? Does anyone of
 you guys has some better ideas? We appreciate any suggestions, guides,
 helps, etc. Thanks!



 Best regards

 Jing




Re: Question regarding DataTable and Checkbox/Radio Columns

2010-01-04 Thread Early Morning
Hi Igor,

Thanks for the information. I implemented the CheckBoxColumn with a
HeaderCheckBoxPanel, do you mean that I should do the same and create e.g. a
RadioButtonPanel and a RadioModel similar to the CheckBoxModel?

Additionally, if you don't mind, I have some questions regarding filtering
the Ajax DataTable:

1) What would be the correct way to implement the FilterToolbar /
GoAndClearFilter for the Ajax DataTable? I added the code used in the
DataTable, and although I'm able to filter the table once, the Go button
doesn't work again (and of course it refereshes the page since it doesn't
use Ajax).
2) How do you set a Renderer for the ChoiceFilteredPropertyColumn?
3) When using the PropertyColumn with a Sort property, I get an error when I
use properties such as status.description. The Display property works
using this property selection format, however the Sort Property gets an
exception saying the property isn't found. Using just status works for the
Sort property, however this is not ideal since the sorting isn't using the
proper display property to sort.

Thanks again!


Regards,

Ces

On Tue, Dec 29, 2009 at 1:16 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Mon, Dec 28, 2009 at 4:49 AM, Early Morning goodmorning...@gmail.com
 wrote:
  Hi all,
 
  I created a custom DataTable based on AjaxFallbackDefaultDataTable, as
 well
  as a ChecBoxColumn based on the CheckBoxColumn in wicket-phonebook. My
  questions:
 
  1. Would it be also possible to create a RadioColumn for the DataTable?
 From
  what I've read, I need to add the entire DataTable to the RadioGroup, so
 I'm
  not sure if it's possible to implement this as a column. How would I
  implement this as a column?

 it is possible without a RadioGroup/Radio components, simply write
 your own component that represents the input type=radio.

  2. Relatedly, is there a way for me to implement the CheckBoxColumn
 having a
  CheckGroup with a select all checkbox in the header?

 you dont need a CheckGroup for this also, it is trivial to write a
 simple javascript. every CheckBoxColumn should create a uuid when it
 is constructed, either using UUID.randomUUID or Session.nextUuid().
 then append this uuid as a class to the input type=checkbox you are
 using. once this is done you have a way to identify all related
 checkboxes in the page. then it is simply a matter of creating a
 checkbox that in onclick does some javascript like
 $(.+myuuid).checked=this.checked; and putting it into a panel that
 is used as a header of the column. phew.

 -igor


 
 
  Thanks!
 
 
  Regards,
 
  Ces
 

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




Question regarding DataTable and Checkbox/Radio Columns

2009-12-28 Thread Early Morning
Hi all,

I created a custom DataTable based on AjaxFallbackDefaultDataTable, as well
as a ChecBoxColumn based on the CheckBoxColumn in wicket-phonebook. My
questions:

1. Would it be also possible to create a RadioColumn for the DataTable? From
what I've read, I need to add the entire DataTable to the RadioGroup, so I'm
not sure if it's possible to implement this as a column. How would I
implement this as a column?
2. Relatedly, is there a way for me to implement the CheckBoxColumn having a
CheckGroup with a select all checkbox in the header?


Thanks!


Regards,

Ces


Re: Getting Page Expired in Glassfish but not in Jetty

2009-12-10 Thread Early Morning
Heh, I feel a bit silly now; turns out it was a serialization error, and the
reason why it was happening at every page was because it was occurring in
the MenuHelper ^^ Thanks all!


Regards,

Ces

On Thu, Dec 10, 2009 at 12:14 PM, zlus...@gmail.com zlus...@gmail.comwrote:

 Hi,

 Check that session cookies are not mixed up between the application
 servers. I had PageExpired exceptions when testing the same application on
 the very same browser with WebLogic and Tomcat, and that was caused by that
 both servers are using the JSESSIONID cookie, but with different paths, so
 actually there was two JSESSIONID cookies appearing in the browser. And
 because wrong cookie was picked up the session was always recreated, which
 was causing PageExpired exceptions. The easy solution was to configure
 WebLogic to use an other cookie name, and after that everything worked fine.
 For testing just clear the cookies in your browser before/when switching
 between app servers.
 Cheers,
 Zoltan

 Early Morning írta:

  Well yes, ideally, but it is easier to not use such a heavy appserver when
 developing, so we make do with an internal QA deployment on Glassfish :)
 In
 any case, I was more wondering about the differences between how
 appservers
 handle wicket page versions and the like, since I'd like to understand why
 such differences exist. In any case, I'll check for serialization errors
 first. Thanks!


 Regards,

 Ces

 On Thu, Dec 10, 2009 at 5:52 AM, b...@actrix.gen.nz wrote:



 Hi,

 It is usually easier to have identical development and production
 platforms. If then you get an error as you describe, you usually catch
 it in development before it reaches production.

 So why don't you develop with GlassFish?


 Bernard



 On Thu, 10 Dec 2009 02:36:49 +0800, you wrote:



 Hi all,

 Currently I have a problem with my application wherein when I press the


 Back


 button of the browser and navigate to a new page, I get a Page Expired


 error


 consistently. However, this only happens when my application is deployed


 in


 Glassfish, but not when I run it using Jetty. Any suggestions for what I
 should check?

 Related to that, I also experienced an error wherein there was a
 target.add(form) in the onSubmit method of the button, which caused an
 Exception in Glassfish whenever the feedback panel within the form was


 added


 because the page could not be constructed; however In Jetty, the same
 code
 caused no errors. The fix (removing target.add(form)) was simple enough,


 but


 I was hoping someone could enlighten me regarding how different
 appservers
 handle wicket page versions, etc. Is there a resource I can look up for
 this? Thanks!


 Regards,

 Ces


 -
 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




Getting Page Expired in Glassfish but not in Jetty

2009-12-09 Thread Early Morning
Hi all,

Currently I have a problem with my application wherein when I press the Back
button of the browser and navigate to a new page, I get a Page Expired error
consistently. However, this only happens when my application is deployed in
Glassfish, but not when I run it using Jetty. Any suggestions for what I
should check?

Related to that, I also experienced an error wherein there was a
target.add(form) in the onSubmit method of the button, which caused an
Exception in Glassfish whenever the feedback panel within the form was added
because the page could not be constructed; however In Jetty, the same code
caused no errors. The fix (removing target.add(form)) was simple enough, but
I was hoping someone could enlighten me regarding how different appservers
handle wicket page versions, etc. Is there a resource I can look up for
this? Thanks!


Regards,

Ces


Re: Getting Page Expired in Glassfish but not in Jetty

2009-12-09 Thread Early Morning
Well yes, ideally, but it is easier to not use such a heavy appserver when
developing, so we make do with an internal QA deployment on Glassfish :) In
any case, I was more wondering about the differences between how appservers
handle wicket page versions and the like, since I'd like to understand why
such differences exist. In any case, I'll check for serialization errors
first. Thanks!


Regards,

Ces

On Thu, Dec 10, 2009 at 5:52 AM, b...@actrix.gen.nz wrote:

 Hi,

 It is usually easier to have identical development and production
 platforms. If then you get an error as you describe, you usually catch
 it in development before it reaches production.

 So why don't you develop with GlassFish?


 Bernard



 On Thu, 10 Dec 2009 02:36:49 +0800, you wrote:

 Hi all,
 
 Currently I have a problem with my application wherein when I press the
 Back
 button of the browser and navigate to a new page, I get a Page Expired
 error
 consistently. However, this only happens when my application is deployed
 in
 Glassfish, but not when I run it using Jetty. Any suggestions for what I
 should check?
 
 Related to that, I also experienced an error wherein there was a
 target.add(form) in the onSubmit method of the button, which caused an
 Exception in Glassfish whenever the feedback panel within the form was
 added
 because the page could not be constructed; however In Jetty, the same code
 caused no errors. The fix (removing target.add(form)) was simple enough,
 but
 I was hoping someone could enlighten me regarding how different appservers
 handle wicket page versions, etc. Is there a resource I can look up for
 this? Thanks!
 
 
 Regards,
 
 Ces


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




Re: How to make a feedback panel appear on page load?

2009-12-01 Thread Early Morning
Hi Martin,

Yes, and the feedback appears when doing a normal in-page Ajax action (such
as clicking the search button within the page), but not when loading the
page from setResponsePage.


Regards,

Ces

On Tue, Dec 1, 2009 at 3:56 PM, Martijn Dashorst martijn.dasho...@gmail.com
 wrote:

 Did you add a feedbackpanel?

 Martijn

 On Tue, Dec 1, 2009 at 8:03 AM, Early Morning goodmorning...@gmail.com
 wrote:
  Hi Martin,
 
  I pass a DataProvider in the constructor of the page, and process it
  somewhat like this:
 
 if(accountDataProvider == null){
 container.add(new EmptyPanel(resultPanel));
 asm = new AccountSearchModel();
 }else{
 asm = accountDataProvider.getAccountSearchModel();
 if(accountDataProvider.size()  0){
 container.add(new AccountSearchResultsPanel(resultPanel,
  accountDataProvider));
 }else{
 container.add(new EmptyPanel(resultPanel));
 error(No results found.);
 }
 }
 
  Basically if the DataProvider is null, it just adds an empty panel, but
 if
  not (and the size of the results is 0), there should be a feedback
 showing
  No results found. It successfully executes the error statement when I
  debug, but when loading the page there is still no feedback shown. Is
 there
  anything else I should add? Thanks.
 
 
  Regards,
 
  Ces
 
  On Tue, Dec 1, 2009 at 2:30 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
  Hi!
 
  It should appear if you call error or something... what's your code?
 
  **
  Martin
 
  2009/12/1 Early Morning goodmorning...@gmail.com:
   Hi,
  
   I'm trying to make a feedback panel appear immadiately after page load
  (such
   as when you search and the results appear in a new page, but there is
 an
   error), but even if I call error(message); no feedback panel appears.
  What
   would be the recommended way to do this? Thanks!
  
  
   Regards,
  
   Ces
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.4 increases type safety for web applications
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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




How to make a feedback panel appear on page load?

2009-11-30 Thread Early Morning
Hi,

I'm trying to make a feedback panel appear immadiately after page load (such
as when you search and the results appear in a new page, but there is an
error), but even if I call error(message); no feedback panel appears. What
would be the recommended way to do this? Thanks!


Regards,

Ces


Re: How to make a feedback panel appear on page load?

2009-11-30 Thread Early Morning
Hi Martin,

I pass a DataProvider in the constructor of the page, and process it
somewhat like this:

if(accountDataProvider == null){
container.add(new EmptyPanel(resultPanel));
asm = new AccountSearchModel();
}else{
asm = accountDataProvider.getAccountSearchModel();
if(accountDataProvider.size()  0){
container.add(new AccountSearchResultsPanel(resultPanel,
accountDataProvider));
}else{
container.add(new EmptyPanel(resultPanel));
error(No results found.);
}
}

Basically if the DataProvider is null, it just adds an empty panel, but if
not (and the size of the results is 0), there should be a feedback showing
No results found. It successfully executes the error statement when I
debug, but when loading the page there is still no feedback shown. Is there
anything else I should add? Thanks.


Regards,

Ces

On Tue, Dec 1, 2009 at 2:30 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 It should appear if you call error or something... what's your code?

 **
 Martin

 2009/12/1 Early Morning goodmorning...@gmail.com:
  Hi,
 
  I'm trying to make a feedback panel appear immadiately after page load
 (such
  as when you search and the results appear in a new page, but there is an
  error), but even if I call error(message); no feedback panel appears.
 What
  would be the recommended way to do this? Thanks!
 
 
  Regards,
 
  Ces
 

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




Automatically avoid executing component code when not authorized for instantiation?

2009-11-13 Thread Early Morning
Hi All,

There are cases wherein a user is authorized to view a page, but not a
component within that page. Currently we set the authorizations needed for a
component using a custom annotation, and handle the Render and Enable
actions in a custom AuthorizationStrategy. However, we also have to handle
authorizations for component instantiation such that the actual code of the
component should not be run if it is not authorized. This is needed since
there are many components which retrieve data from a DB or otherwise do
unnecessary processing which ideally shoudn't be done if the component is
not authorized for instantiation in the first place.

Is there a way that we can automatically replace that component with a dummy
component or just not execute the code within the component (say, in the
onUnauthorizedInstantiation method) in our AuthorizationStrategy? Of course,
we could manually check within the component whether the processing should
be done depending on the authorization, but we'd like to avoid that since
that would mean manually checking authorizations for every component (thus
rendering the AuthorizationStrategy somewhat redundant). Is there a way for
us to do this automatically for components where we've set
isInstantiationAuthorized = false? Thanks!


---Ces