Re: Wicket localization in stateful pages

2013-11-12 Thread Martin Grigorov
On Mon, Nov 11, 2013 at 7:02 PM, meduolis meduol...@gmail.com wrote:

 Storing it in page will not work as it will reset each time I call
 setResponsePage.
 Storing it in data base will not work also, because locale will became
 global for all visitors.
 So I tried to pass it using page parameters. Also, I have updated dynamic
 label model to LoadableDetachableModel.

 This time I got different result, but still, not what I expected.


What is actually the expected behavior ?
Please describe the full use case.



 Back action restores locale from page parameter one step behind the value
 stored in session,
 so I got different values each time I go back.
 Attaching updated version, if there is still someone who will to help me:
 versionLocale.zip
 
 http://apache-wicket.1842946.n4.nabble.com/file/n4662326/versionLocale.zip
 



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662326.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: Get return value of ajax event in Wicket 6.9.1

2013-11-12 Thread Daniela L
Hi,
thank you so much for your help this works fantastic.
I am so happy I was trying around with this for days :-)


2013/11/11 Martin Grigorov mgrigo...@apache.org

 respond() is the callback method that Wicket will notify.
 But you need to trigger an Ajax call first. This is done with the Wicket
 Ajax API: Wicket.Ajax.get(...).

 Just try with the line I've added in your JS code


 On Mon, Nov 11, 2013 at 4:04 PM, Daniela L danigal...@gmail.com wrote:

  I thought adding respond was the ajax call to the server, am I wrong?
  I didn't work much with ajax, i am sorry
 
 
  2013/11/11 Martin Grigorov mgrigo...@apache.org
 
   Did you do what I suggested you ?
  
  
   On Mon, Nov 11, 2013 at 3:49 PM, Daniela L danigal...@gmail.com
 wrote:
  
Hi,
   
I have tryed to change to AbstractDefaultAjaxBehavior like I
 described
below, but respond is never called. What am I doing wrong?
   
   
Hi,
   
as far as I have understood this can only be achieved, if I subclass
AbstractDefaultAjaxBehavior like this?
   
public class PageExitWarningBehavior extends
  AbstractDefaultAjaxBehavior
{
@Override
protected void respond(AjaxRequestTarget target) {
   
AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
  }
   
   
Hi,
   
You need to make an Ajax call to the server.
   
   
On Mon, Nov 11, 2013 at 2:10 PM, Daniela L danigal...@gmail.com
danigal...@gmail.comdanigal...@gmail.com danigal...@gmail.com
wrote:
   
   
Hi,
this is my first question, so i hope I get everything right.
   
I am trying to catch the event of the user closing the browser window
  in
wicket.
   
I followed this example:
   
   
  
 
 http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
   
and I managed to get the example working so the message is displayed,
   but I
have no idea how to get the event triggered by the javascript
 function
  in
wicket. I need this because when the user closes the browser window I
   want
to update some data in my database.
Here is what I have tryed:
   
   
 RequiredTextFieldString myTextField = new
RequiredTextFieldString(myTextField);
 myTextField.setOutputMarkupPlaceholderTag(true);
 myTextField.add(new PageExitWarningBehavior(){
@Override
public void onEvent(Component component, IEvent? event)
{
//this isn't ever called
MySession.get().releaseBlockedDataFromDatabase();
}
});
   
public class PageExitWarningBehavior extends Behavior  {
@Override
public void renderHead(Component component, IHeaderResponse
response) {
super.renderHead(component, response);
response.render(new
OnDomReadyHeaderItem(window.onbeforeunload = function (e) {
   
   
  + Wicket.Ajax.get({u: '+getCallbackUrl()+',
   async:
false});
   
   
  + var message = 'Your confirmation message goes
here.',
   
  + e = e || window.event; + if (e) {
   
  + e.returnValue = message; + } + return
  message;
   +
};));
}
}
   
What am I missing? Thank you very much in advance
   
  
 



Re: Wicket localization in stateful pages

2013-11-12 Thread meduolis
Those are screenshots taken from quickstart project I have provided:

1. (0 page version) We enter the page. Default locale is EN.
Everything are localized in english because locale is correct for all
components
http://apache-wicket.1842946.n4.nabble.com/file/n4662342/1-enterTheSite.jpg 

2. (1 page version) Click to DE to sitch to german language.
Everything are localized in german because locale is correct for all
components
http://apache-wicket.1842946.n4.nabble.com/file/n4662342/2-changeTOGerman.jpg 

3. (0 page version) Click browser back button once.
Only No Model label got localized to english. Other stuff stays with
german locale
http://apache-wicket.1842946.n4.nabble.com/file/n4662342/3-browserBackCLickeOnce.jpg
 

What I expect on step 3:
Expected: *all components got localized to en_EN locale;*
Actual: No Model got localized to en_EN, but With model and
{wicket:message} stays in german.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662342.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



wicket library example, but with tabs

2013-11-12 Thread Erik Ostermueller
Hello all,

I'm trying to get the wicket library example (which is awesome) to
display the BookDetails in a page with three tabs.

But I'm a very new to wicket and could use some help.
I've put a small-as-possible (well, almost) example app out here:
https://github.com/eostermueller/wicket-tablibrary

The README.md has the full error and simple instructions for how to
build/run, but below is the main error.

Would really appreciate some help, thanks.
--Erik

id for TabPanel1 [3]
ERROR - MarkupContainer- Unable to find component with id
'title' in [Page class =
org.apache.wicket.examples.tablibrary.TabPanel1, id = 3, render count
= 1]
Expected: ':title'.
Found with similar names: ''
ERROR - DefaultExceptionMapper - Unexpected error occurred
Unable to find component with id 'title' in [Page class =
org.apache.wicket.examples.tablibrary.TabPanel1, id = 3, render count
= 1]
Expected: ':title'.
Found with similar names: ''
 MarkupStream: [markup =
file:/Users/erikostermueller/Documents/src/jdist/wicket/tablibrary/wicket-examples/target/classes/org/apache/wicket/examples/tablibrary/TabPanel1.html

snip!

 , index = 1, current =  'span wicket:id=title' (line 0, column 0)]
at 
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1435)


Re: wicket library example, but with tabs

2013-11-12 Thread meduolis
You have three different consructors for TabPanel1:
1. TabPanel1(BookDetails bookDetails);
2. TabPanel1();
3. TabPanel1(BookDetails bookDetails, String id);

If you create instance of that class using first constructor you don't have
any component added yet.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-library-example-but-with-tabs-tp4662343p4662344.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 Components as Class Members

2013-11-12 Thread mashleyttu
Thank you everyone for your replies.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Components-as-Class-Members-tp4662235p4662345.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



quick CRUD application

2013-11-12 Thread saty
Hi,

Is it possible to develop/generate a quick CRUD application using wicket,
something like the OpenXawa does or even JSF

Thanks




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/quick-CRUD-application-tp4662346.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: quick CRUD application

2013-11-12 Thread Josh Kamau
Look at isis.apache.org

Josh


On Wed, Nov 13, 2013 at 12:09 AM, saty satya...@gmail.com wrote:

 Hi,

 Is it possible to develop/generate a quick CRUD application using wicket,
 something like the OpenXawa does or even JSF

 Thanks




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/quick-CRUD-application-tp4662346.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: quick CRUD application

2013-11-12 Thread saty
Ok, thanks




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/quick-CRUD-application-tp4662346p4662350.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