Ajax: listening to specic event in custom

2014-08-22 Thread lucast
Dear forum,
I have implemented a custom-made modal window using twitter bootstrap
syntax.

The modal window has a confirm and a cancel ajax link.

Similarly to Wicket's own modal window, I have implemented a
show(AjaxRequestTarget) function that calls 



and I have managed to display the modal window no problem.

When I click either confirm/cancel, on AjaxLink.onClick(AjaxRequestTarget) I
close the modal window and I send and event:



on the main panel where the modal window is added to, I catch the events
sent from the modal window by implementing  onEvent(IEvent).

The problem is that on the main panel, upon catching the event, when I
replace the current panel, it hides the modal window but the blocking
greyed-out foreground remains. It therefore blocks the screen from any
usage. I have to refresh the screen for it to go away.


According to the  bootstrap documentation
http://getbootstrap.com/javascript/#modals-usage  , Bootstrap's modal
class exposes a few events for hooking into modal functionality.
One of them is *hidden.bs.modal*:   This event is fired when the modal has
finished being hidden from the user (will wait for CSS transitions to
complete).
Example taken from  tutorialrepublic.com
http://www.tutorialrepublic.com/codelab.php?topic=bootstrapfile=modal-events 
 

How can I, from the confirm/delete.onClick(AjaxRequestTarget) know when the
modal window has been completely closed before calling ?

I am assuming I need to listen for the *hidden.bs.modal* ajax event. would
that be right? if so, how can I listen for this custom ajax event?

I just want to get rid of the blocking foreground, when the panel has been
successfully replaced.

Thanks in advance. Sorry for the long post.

Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-listening-to-specic-event-in-custom-tp4667138.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: Ajax: listening to specic event in custom

2014-08-22 Thread Christian Schröter
You can listen to a custom event. Just add an new 
AjaxEventBehavior(‚hidden.bs.modal“) {…};
If you are working closely with Bootstrap I recommend to have a look at 
https://github.com/l0rdn1kk0n/wicket-bootstrap

Cheers,
Chris

Am 22.08.2014 um 15:46 schrieb lucast 
lucastol...@hotmail.commailto:lucastol...@hotmail.com:

Dear forum,
I have implemented a custom-made modal window using twitter bootstrap
syntax.

The modal window has a confirm and a cancel ajax link.

Similarly to Wicket's own modal window, I have implemented a
show(AjaxRequestTarget) function that calls



and I have managed to display the modal window no problem.

When I click either confirm/cancel, on AjaxLink.onClick(AjaxRequestTarget) I
close the modal window and I send and event:



on the main panel where the modal window is added to, I catch the events
sent from the modal window by implementing  onEvent(IEvent).

The problem is that on the main panel, upon catching the event, when I
replace the current panel, it hides the modal window but the blocking
greyed-out foreground remains. It therefore blocks the screen from any
usage. I have to refresh the screen for it to go away.


According to the  bootstrap documentation
http://getbootstrap.com/javascript/#modals-usage  , Bootstrap's modal
class exposes a few events for hooking into modal functionality.
One of them is *hidden.bs.modal*: This event is fired when the modal has
finished being hidden from the user (will wait for CSS transitions to
complete).
Example taken from  tutorialrepublic.comhttp://tutorialrepublic.com
http://www.tutorialrepublic.com/codelab.php?topic=bootstrapfile=modal-events

How can I, from the confirm/delete.onClick(AjaxRequestTarget) know when the
modal window has been completely closed before calling ?

I am assuming I need to listen for the *hidden.bs.modal* ajax event. would
that be right? if so, how can I listen for this custom ajax event?

I just want to get rid of the blocking foreground, when the panel has been
successfully replaced.

Thanks in advance. Sorry for the long post.

Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-listening-to-specic-event-in-custom-tp4667138.html
Sent from the Users forum mailing list archive at Nabble.comhttp://Nabble.com.

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




Re: Compound Property Model to a form is not getting updated

2014-08-22 Thread suvojit168
Hi Sven,

Thanks for pinpointing the redundant usage of PropertyModel. 

I will definitely try to do a quickstart project. I need to be aware of
creating quickstart, first though. Will try to follow  this http://this  . 
My project structure is bit complex. It will take some time to come up with
the quickstart module (I am simultaneously looking at other issues at hand
also). 

In mean time, I will share my observation with you. Can you please see if
something clicks for you?

The model attached to the form here is a new model every time the form is
loaded. However the properties inside this model remains same. I mean the
*ProductPageModel productItem* which is the model for the form is always a
new object, however on submit I can see that the properties of these model
remains same as first time. It seems that somehow the framework is caching
the model's property and setting those in new model.
Is it possible somehow?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Compound-Property-Model-to-a-form-is-not-getting-updated-tp4667114p4667137.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: Compound Property Model to a form is not getting updated

2014-08-22 Thread Sven Meier

Hi,

The model attached to the form here is a new model every time the form 
is loaded.


that doesn't go well with the code you have posted:

productName = new TextFieldString(productName,
new PropertyModelString(productItem, productName),

Here you bind the textField's model to productItem, which is the form's 
initial model.
If you change the latter afterwards, your textField's will still work 
with the old model.


Using a CompoundPropertyModel  without PropertyModel's should help here.

IMHO changing a component's model is seldomly justified and this will be 
cause of much troubles.


Regards
Sven


On 08/22/2014 02:55 PM, suvojit168 wrote:

Hi Sven,

Thanks for pinpointing the redundant usage of PropertyModel.

I will definitely try to do a quickstart project. I need to be aware of
creating quickstart, first though. Will try to follow  this http://this  .
My project structure is bit complex. It will take some time to come up with
the quickstart module (I am simultaneously looking at other issues at hand
also).

In mean time, I will share my observation with you. Can you please see if
something clicks for you?

The model attached to the form here is a new model every time the form is
loaded. However the properties inside this model remains same. I mean the
*ProductPageModel productItem* which is the model for the form is always a
new object, however on submit I can see that the properties of these model
remains same as first time. It seems that somehow the framework is caching
the model's property and setting those in new model.
Is it possible somehow?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Compound-Property-Model-to-a-form-is-not-getting-updated-tp4667114p4667137.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