Re: generalized way to ignore mouse input during screen refresh?

2009-01-10 Thread Martin Makundi
I use a non-intrusive javascript snipplet which requires nothing else
from the server side and it works with or without Wicket...:

css:
#busy-symbol { position: absolute; top: 0px; left: 0px; margin: 0px;
width: 100%; z-index: 10; background: url(../images/raster.png)
repeat; cursor: wait; }
#busy-symbol div { font-size: 18px; width: 100px; background: #f8f8f8;
font-weight: bold; color: orange; text-decoration: blink; z-index:
10; text-align: center; margin: 50% auto auto auto; }


wicket:head
script type=text/javascript
!--
  window.onload = setupFunc;

  var busySymbol;

  function setupFunc() {
document.getElementsByTagName('body')[0].onclick = clickFunc;
hideBusysign();
Wicket.Ajax.registerPreCallHandler(showBusysign);
Wicket.Ajax.registerPostCallHandler(hideBusysign);
Wicket.Ajax.registerFailureHandler(hideBusysign);
  }

  function hideBusysign() {
if (busySymbol != null) {
  busySymbol.parentNode.removeChild(busySymbol);
  busySymbol = null;
}
  }

  function showBusysign() {
if (!document.getElementById('busy-symbol')) {
  busySymbol = document.createElement('div');
  busySymbol.id = 'busy-symbol';

  var pageHeight;

  if ((window.innerHeight != null)  (window.scrollMaxY != null))
{ // Firefox
pageHeight = window.innerHeight + window.scrollMaxY;
  } else if (document.body.scrollHeight 
document.body.offsetHeight) { // all but Explorer Mac
pageHeight = document.body.scrollHeight;
  } else if (document.height != undefined) {
pageHeight = document.height;
  } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
pageHeight = document.body.offsetHeight + document.body.offsetTop;
  }

  {
var busyLabel  = document.createElement('div');
busyLabel.innerHTML = 'Loading ...';
busySymbol.appendChild(busyLabel);
  }

  document.body.appendChild(busySymbol);

  busySymbol.style.height = pageHeight + 'px';
}
  }

  function clickFunc(eventData) {
var clickedElement = (window.event) ? event.srcElement : eventData.target;

if ((clickedElement.tagName.toUpperCase() == 'A'
   (clickedElement.href.lastIndexOf('#') !=
(clickedElement.href.length-1))
   (clickedElement.href.indexOf('WicketAjaxDebug')  0)
   (clickedElement.href.lastIndexOf('.doc') !=
(clickedElement.href.length-4))
   (clickedElement.href.lastIndexOf('.csv') !=
(clickedElement.href.length-4))
   (clickedElement.href.lastIndexOf('.xls') !=
(clickedElement.href.length-4))
   ((clickedElement.onclick == null) ||
(clickedElement.onclick.toString().indexOf('window.open') = 0))
  )
  || (clickedElement.parentNode.tagName.toUpperCase() == 'A'
   (clickedElement.parentNode.href.lastIndexOf('#') !=
(clickedElement.parentNode.href.length-1))
   (clickedElement.parentNode.href.lastIndexOf('.doc') !=
(clickedElement.parentNode.href.length-4))
   (clickedElement.parentNode.href.lastIndexOf('.csv') !=
(clickedElement.parentNode.href.length-4))
   (clickedElement.parentNode.href.lastIndexOf('.xls') !=
(clickedElement.parentNode.href.length-4))
   ((clickedElement.parentNode.onclick == null) ||
(clickedElement.parentNode.onclick.toString().indexOf('window.open')
= 0))
  )
  || (
 ((clickedElement.onclick == null)
   || ((clickedElement.onclick.toString().indexOf('window') = 0)
 (clickedElement.onclick.toString().indexOf('confirm') = 0)))
  ((clickedElement.tagName.toUpperCase() == 'INPUT' ||
clickedElement.tagName.toUpperCase() == 'BUTTON')
  (clickedElement.type.toUpperCase() == 'BUTTON'
 || clickedElement.type.toUpperCase() == 'IMAGE'
 || clickedElement.type.toUpperCase() == 'SUBMIT'))
 )
  ) {
  showBusysign();
}
  }
--
/script
/wicket:head


**
Martin



2009/1/10 Kirk Is kirkj...@gmail.com:
 Could you share the code, or at least the core idea of how it hooks
 into a normal page/component, in the meanwhile

 On Fri, Jan 9, 2009 at 4:55 PM, Valentine2008
 valentine...@alumni.sfu.ca wrote:

 I created a reusable component, PanelWithAjaxBusyIndicatingMask, which
 extends Panel.

 The functions it has:

 It will add a transparent mask layer to the current page to prevent further
 UI interactivity when there are any busy Ajax activities.

 The mask layer will have an animation gif and a configurable display text
 (the default is: Please wait…).

 Both the display text and the animation gif file are configurable in the
 constructors.

 I am proposing it to the Wicket developers. Hope they will incorporate it
 into the next release.


 Kirk Israel-2 wrote:

 So one problem we've seen in a few places occurs when a (somewhat
 slow) request happens that refreshes the page or component, but then
 the user clicks on a link on the pre-refresh screen, and ends up
 getting a 

Re: FileUpload in a Panel

2009-01-10 Thread Stephen Swinsburg
In addition, the iframe method that Ed mentioned was a hack to get  
around the fact that AJAX can't handle fileuploads yet. That might  
have been what he was talking about.


cheers.



On 10/01/2009, at 5:06 AM, Jeremy Thomerson wrote:

Yes - a FileUpload can be in any component (though it will need to  
be nested
in some parent multi-part form).  Your error below has nothing to do  
with it

being in a panel.  In later versions of 1.4, there was a change that
requires a FileUpload component to have a model to store it's data.   
You

need to call the constructor like new FileUpload(ID, new Model())


--
Jeremy Thomerson
http://www.wickettraining.com

On Fri, Jan 9, 2009 at 8:05 PM, Ed _ ed_b...@hotmail.com wrote:




Is it possible to do a file upload within a Panel ?

Or can it only be done in a WebPage?  I have seen some solutions  
using

IFrames within panels to get around this.


ERROR [http-8080-1] (RequestCycle.java:1072) - there was an error  
cleaning

up target
org 
.apache 
.wicket 
.request 
.target 
.component.listener.listenerinterfacerequesttar...@654004161[page

class = com.mydomain.admin.Admin, id = 0, version =
0]-fileUpload-interface
org 
.apache 
.wicket.markup.html.form.IFormSubmitListener.IFormSubmitListener
(request paramaters: [RequestParameters   
componentPath=0:xPanel:fileUpload

pageMapName=null versionNumber=0 interfaceName=IFormSubmitListener
componentId=null behaviorId=null urlDepth=-1 parameters={}
onlyProcessIfPathActive=false]).
java.lang.IllegalStateException: Attempt to set model object on  
null model

of component: xPanel:fileUpload:fileInput
  at
org.apache.wicket.Component.setDefaultModelObject(Component.java: 
2933)


thanks,

Ed

_
Windows Live™ Hotmail(R): Chat. Store. Share. Do more with mail.

http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_hm_justgotbetter_howitworks_012009




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



Re: generalized way to ignore mouse input during screen refresh?

2009-01-10 Thread Daniele Dellafiore
On Fri, Jan 9, 2009 at 10:55 PM, Valentine2008
valentine...@alumni.sfu.ca wrote:

 I created a reusable component, PanelWithAjaxBusyIndicatingMask, which
 extends Panel.

 The functions it has:

 It will add a transparent mask layer to the current page to prevent further
 UI interactivity when there are any busy Ajax activities.

 The mask layer will have an animation gif and a configurable display text
 (the default is: Please wait…).

 Both the display text and the animation gif file are configurable in the
 constructors.

 I am proposing it to the Wicket developers. Hope they will incorporate it
 into the next release.

It seems like the mechanism of blur that happens to background
openign the modal window.

Anyway, it would be great to share the code using wicket stuff, I
think is a better way for some reason: component is immediately
available, many people can use it to provide feedback and let the
component grow, so eventually it can become a standard wicket
component.

getting commit accesso for wicket stuff is not complicated, I guess
some project in wicket-stuff can host your component.

-- 
Daniele Dellafiore
http://blog.ildella.net/

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



Re: Nested inner forms, each with their own AjaxSubmitLink, but only the 1st onSubmit ever gets called

2009-01-10 Thread Jeremy2009

Hi Martijn,

So the only solution is to move the inner forms to be no longer 'inner'?

Thanks
J

Jeremy2009 wrote:
 
 Hi Martijn,
 
 Thanks for your super-fast reply.
 
 According to the Wicket Ajax Debugger, it says INFO: focus set on
 userTagsCons144 - which is the 2nd inner form's text field.  On clicking
 'enter', is the Ajax javascript able to check which form-related object
 has the current focus and therefore decide which inner form to dispatch
 the Ajax request to?
 
 If not, is there any kind of work-around? 
 
 Would I get the same problem if the inner forms were not nested?
 
 Many thanks,
 Jeremy
 
 
 
 Martijn Dashorst wrote:
 
 According to me this is a browser thing, nothing Wicket can do
 anything about (without registering which field has focus, and sending
 that with the form, detecting that the default submit was triggered by
 pressing enter, figuring out which form was actually meant, etc.
 
 Martijn
 
 On Wed, Jan 7, 2009 at 3:06 PM, Jeremy2009 jscol...@gmail.com wrote:

 Hi,

 I have searched theforums for a similar situation but can't seem to find
 anything.

 I have a complicated panel that consists of an outer form that contains
 2
 inner forms:

 a) The outer form has an AjaxSubmitLink with an onSubmit() that gets
 fired
 as expected.

 b) Each inner form has its own AjaxSubmitLink that allows the user to
 enter
 specific text which then gets added to the panel.

 All 3 forms have unique wicket id's.

 My problem is that when the user presses 'enter' in either of the 2
 inner
 forms, the onSubmit of the 1st inner form always fires!  The wicket Ajax
 Debugger confirms that the 2nd inner form has focus, but that the 1st
 inner
 form is the target of the submit request!  I would expect that the 2nd
 inner
 form be the target.  If i comment out the 1st inner form, then the 2nd
 inner
 form's onSubmit fires as expected.

 The inner forms are created by a subclass since all that changes is the
 name
 of the wicket components inside each form so no need to duplicate the
 code.
 Here's my code for the inner forms:

 i) JAVA:
final Form tagsForm = new Form(userTypedTags +
 tagType);

AjaxSubmitLink link = new
 AjaxSubmitLink(onReturnSubmitTags+tagType,
 tagsForm) {
private static final long serialVersionUID = 1L;

@Override
public void onSubmit(AjaxRequestTarget target,
 Form tagsForm) {
LOGGER.info( in AjaxSubmitLink's
 onsubmit for tagType:  +
 tagType);
addSelectedTag(selectedTags,
 tagText.getModelObjectAsString());
tagText.setModelObject();
target.addComponent(selectedContainer);
target.addComponent(tagsForm);
}
};
tagsForm.add(link);

tagsForm.setOutputMarkupId(true);
add(tagsForm);

 ii) HTML for one of the subclasses that requires a form to be created
 for
 'Pros' text (the 2nd subclass creates a form for 'Cons' text):

 wicket:extend
form wicket:id=userTypedTagsPros
input type=text wicket:id=userTagsPros
 class=text/
input type=submit wicket:id=onReturnSubmitTagsPros
 style=display:
 none;
/form
 /wicket:extend

 Have you seen anything similar?

 Many thanks for your time,
 Jeremy


 --
 View this message in context:
 http://www.nabble.com/Nested-inner-forms%2C-each-with-their-own-AjaxSubmitLink%2C-but-only-the-1st-onSubmit-ever-gets-called-tp21331944p21331944.html
 Sent from the Wicket - User 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


 
 
 
 -- 
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Nested-inner-forms%2C-each-with-their-own-AjaxSubmitLink%2C-but-only-the-1st-onSubmit-ever-gets-called-tp21331944p21392404.html
Sent from the Wicket - User 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: generalized way to ignore mouse input during screen refresh?

2009-01-10 Thread Valentine2008

Yes. It is similar. But I didn't look at the source code of the ModalWindow.

The idea I have put in https://issues.apache.org/jira/browse/WICKET-2017.

- Valentine


Daniele Dellafiore wrote:
 
 It seems like the mechanism of blur that happens to background
 openign the modal window.
 
 Anyway, it would be great to share the code using wicket stuff, I
 think is a better way for some reason: component is immediately
 available, many people can use it to provide feedback and let the
 component grow, so eventually it can become a standard wicket
 component.
 
 getting commit accesso for wicket stuff is not complicated, I guess
 some project in wicket-stuff can host your component.
 
 -- 
 Daniele Dellafiore
 http://blog.ildella.net/
 
 

-- 
View this message in context: 
http://www.nabble.com/generalized-way-to-ignore-mouse-input-during-screen-refresh--tp21379945p21392474.html
Sent from the Wicket - User 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 / where can I contribute my source code to the wicket?

2009-01-10 Thread Valentine2008

I created https://issues.apache.org/jira/browse/WICKET-2017

For this proposed new feature, I think wicket-extensions would be a best
place.

- Valentine Wu


Jeremy Thomerson-5 wrote:
 
 Oh, and if you want to add it to wicket stuff, just ask here for commit
 rights by supplying your SF ID.
 Read thoroughly: http://wicketstuff.org/confluence/display/STUFFWEB/Home
 
 -- 
 Jeremy Thomerson
 http://www.wickettraining.com
 
 

-- 
View this message in context: 
http://www.nabble.com/How---where-can-I-contribute-my-source-code-to-the-wicket--tp21381608p21392637.html
Sent from the Wicket - User 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