Re: JPA EntityManager storage

2009-06-05 Thread Martin Makundi
To stress this point:  EntityManager should not be visible in Wicket
UI Eclipse Project namespace (classpath).

**
Martin

2009/6/5 Frank Tegtmeyer :
>> Putting the EntityManager in the Request means you
>> have to pass the Request around into your business logic layer.
>
> Ok, that's a convincing point. Thank you.
>
> Regards, Frank
>
>
> -
> 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: Wicket and HTML5

2009-06-05 Thread Johan Compagner
and what browser are you planning to target...

When will be the day that 50-80% of the users are using a html5 browser...



On Fri, Jun 5, 2009 at 18:49, Igor Vaynberg  wrote:

> what features are you referring to?
>
> -igor
>
> On Fri, Jun 5, 2009 at 5:32 AM, Gabriel
> Kastenbaum wrote:
> > Hi everyone,
> >
> > I was watching (part of) the video about google wave and they say it is
> full
> > html5. It made me think of one thing, maybe html isn't "that" a thing of
> the
> > past...
> > Is there any support of HTML 5 features planned for Wicket?
> >
> > Have a good day,
> > Gabriel K.
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: JPA EntityManager storage

2009-06-05 Thread Frank Tegtmeyer
> Putting the EntityManager in the Request means you
> have to pass the Request around into your business logic layer.

Ok, that's a convincing point. Thank you.

Regards, Frank


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



Re: WWB for W 1.4 (was Re: when will be wicket 1.4 final release)

2009-06-05 Thread danisevsky
Hi Daniel, when I tried build web beans project I get the following error

[ERROR] BUILD FAILURE
[INFO]

[INFO] Compilation failure

C:\projects\webbeans\wicketwebbeans-databinder\src\main\java\com\googlecode\wick
etwebbeans\databinder\DataSearchFilter.java:[91,23] cannot find symbol
symbol  : method getModelObject()
location: class net.databinder.components.hib.SearchPanel

C:\projects\webbeans\wicketwebbeans-databinder\src\main\java\com\googlecode\wick
etwebbeans\databinder\DataSearchFilter.java:[101,59] cannot find symbol
symbol  : method getModelObject()
location: class net.databinder.components.hib.SearchPanel

2009/6/5 Daniel Toffetti 

> danisevsky  gmail.com> writes:
> >
> > Hi,
> > I would like ask you when I can expect wicket 1.4 final release? I am
> asking
> > because I am waiting for wicket web beans which will be release after
> filnal
> > wicket 1.4 release.
> > Thanks for answer.
> >
>
> Hi,
>
>Wicket Web Beans has been updated to Wicket 1.4, there is not a
> final release yet, you can check the code in trunk:
>
>  http://code.google.com/p/wicket-web-beans/source/checkout
>
>
> Regards,
>
> Daniel
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Logging to an additional File

2009-06-05 Thread Francisco Diaz Trepat - gmail
:-)
Tonio, my man. Thank you so much for your reply.

I'm looking for some alternatives.

I'll see to post (mail) my conclusions if any.

f(t)

On Fri, Jun 5, 2009 at 3:36 PM, Tonio Caputo  wrote:

> Francisco,
>
> I'm not a wicket expert (as you know), the log4j configuration seems to be
> ok, so probably
> the reason for the problem is in other place.
>
> hope this helps
> tonio
>
>
>
>
> On Thu, Jun 4, 2009 at 5:18 PM, Francisco Diaz Trepat - gmail <
> francisco.diaztre...@gmail.com> wrote:
>
> > Hi all,
> > I'm having a small problem trying to log to an additional file with a
> >  org.apache.log4j.FileAppender.
> >
> > Problem: Does not log Wicket stuff to the file. For instance this
> message:
> >
> > "WARNING: Tried to retrieve a localized string for a component that has
> not
> > yet been added to the page.".
> >
> > Is written to the StdOut which netbeans shows in its output window. But
> > this
> > message doesn't appears in my MyLog.log file.
> >
> > I have this log4j property file:
> >
> > log4j.debug=false log4j.rootLogger=INFO,Stdout,Fileappender
> > log4j.logger.org=INFO
> > log4j.logger.com=INFO log4j.logger.net=INFO log4j.logger.nl=INFO
> > log4j.logger.org.apache.wicket=INFO
> > log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO
> > log4j.logger.org.apache.catalina.cluster=INFO
> > log4j.logger.org.apache.wicket.version=INFO
> > log4j.logger.org.apache.wicket.RequestCycle=INFO
> > log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
> > log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
> > log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
> #
> > Additional configuration
> > log4j.appender.Fileappender=org.apache.log4j.FileAppender
> > log4j.appender.Fileappender.file=${mylog.log.dir}/logs/MyLog.log
> > log4j.appender.Fileappender.layout=org.apache.log4j.PatternLayout
> > log4j.appender.Fileappender.layout.conversionPattern=%d [%t] %p - %m%n
> >
> > Is this correct?
> >
> > Can anyone comment?
> >
> > Thanks,
> > f(t)
> >
>


Re: Logging to an additional File

2009-06-05 Thread Tonio Caputo
Francisco,

I'm not a wicket expert (as you know), the log4j configuration seems to be
ok, so probably
the reason for the problem is in other place.

hope this helps
tonio




On Thu, Jun 4, 2009 at 5:18 PM, Francisco Diaz Trepat - gmail <
francisco.diaztre...@gmail.com> wrote:

> Hi all,
> I'm having a small problem trying to log to an additional file with a
>  org.apache.log4j.FileAppender.
>
> Problem: Does not log Wicket stuff to the file. For instance this message:
>
> "WARNING: Tried to retrieve a localized string for a component that has not
> yet been added to the page.".
>
> Is written to the StdOut which netbeans shows in its output window. But
> this
> message doesn't appears in my MyLog.log file.
>
> I have this log4j property file:
>
> log4j.debug=false log4j.rootLogger=INFO,Stdout,Fileappender
> log4j.logger.org=INFO
> log4j.logger.com=INFO log4j.logger.net=INFO log4j.logger.nl=INFO
> log4j.logger.org.apache.wicket=INFO
> log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO
> log4j.logger.org.apache.catalina.cluster=INFO
> log4j.logger.org.apache.wicket.version=INFO
> log4j.logger.org.apache.wicket.RequestCycle=INFO
> log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n #
> Additional configuration
> log4j.appender.Fileappender=org.apache.log4j.FileAppender
> log4j.appender.Fileappender.file=${mylog.log.dir}/logs/MyLog.log
> log4j.appender.Fileappender.layout=org.apache.log4j.PatternLayout
> log4j.appender.Fileappender.layout.conversionPattern=%d [%t] %p - %m%n
>
> Is this correct?
>
> Can anyone comment?
>
> Thanks,
> f(t)
>


Re: Wicket and HTML5

2009-06-05 Thread Igor Vaynberg
what features are you referring to?

-igor

On Fri, Jun 5, 2009 at 5:32 AM, Gabriel
Kastenbaum wrote:
> Hi everyone,
>
> I was watching (part of) the video about google wave and they say it is full
> html5. It made me think of one thing, maybe html isn't "that" a thing of the
> past...
> Is there any support of HTML 5 features planned for Wicket?
>
> Have a good day,
> Gabriel K.
>

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



Re: JPA EntityManager storage

2009-06-05 Thread John Krasnay
On Fri, Jun 05, 2009 at 04:28:07PM +0200, Frank Tegtmeyer wrote:
> 
> > Don't fall into the trap of premature optimization!
> 
> Hm. Maybe I'm in this trap already.
> But what is wrong with binding a resource directly to the request when 
> it is used exactly for the lifetime of the request? For me this only 
> sounds logical compared to the pragmatic approach using a ThreadLocal 
> object.
> Are there any technical reasons against storing in the request?
> 

I try to keep my UI logic, my business logic, and my persistence
strategy separate. Putting the EntityManager in the Request means you
have to pass the Request around into your business logic layer. By
putting it in a ThreadLocal, the UI and business layers can be
blissfully unaware of its existance.

BTW I use Spring's OpenEntityManagerInViewFilter for this. Works very
well.

jk

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



Re: how to call javascript with AjaxPagingNavigator ?

2009-06-05 Thread Igor Vaynberg
you can override the factory that creates the next link, and return a
link subclass that calls the javascript you want.

-igor

2009/6/5 新希望软件 -- 俞宏伟 :
> Hi, all
>
> I need to call javascript after jumping to the next page, how can I do this?
>
> i try to add Behavior to my ajaxpagingNavigator,
>
> myAjaxpagingNavigator.add(new AbstractBehavior() {
>
>@Override
>public void renderHead(IHeaderResponse iHeaderResponse) {
>super.renderHead(iHeaderResponse);
>
> iHeaderResponse.renderOnDomReadyJavascript("Register.init('latestShops');");//add
> javascript here
>}
>});
>
> but when click next page, the page reload all.
>
> thanks
>

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



Re: ListMultipleChoice and HashSet

2009-06-05 Thread Igor Vaynberg
you can create a quickstart and attach it to a jira issue. its hard to
tell without having all the code.

-igor

On Thu, Jun 4, 2009 at 11:49 PM, Linda van der
Pal wrote:
> That is very strange, as this is the code in the domain model:
>
>   public Set getFriends() {
>       return friends;
>   }
>     public void setFriends(final Set friends) {
>       this.friends = friends;
>   }
>
> So I don't see why it would recognize the getter, but not the setter.
>
> Linda
>
> Igor Vaynberg wrote:
>>
>> so looks like you are using a set as the model object but dont have a
>> setter that takes a set as an argument in your domain model.
>>
>> -igor
>>
>> On Wed, Jun 3, 2009 at 11:57 PM, Linda van der Pal
>>  wrote:
>>
>>>
>>> Igor Vaynberg wrote:
>>>

 need to see more of the stacktrace

 -igor


>>>
>>> This is the entire stacktrace that is shown:
>>>
>>> WicketMessage: Error calling method: public void
>>> nl.lunaris.bookdb.model.database.User.setFriends(java.util.Set) on
>>> object:
>>> User: Test
>>>
>>> Root cause:
>>>
>>> java.lang.IllegalArgumentException: argument type mismatch at
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
>>>
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at java.lang.reflect.Method.invoke(Method.java:597) at
>>>
>>> org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1100)
>>> at
>>>
>>> org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:582)
>>> at
>>>
>>> org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:136)
>>> at
>>>
>>> org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169)
>>> at org.apache.wicket.Component.setDefaultModelObject(Component.java:3021)
>>> at
>>>
>>> org.apache.wicket.markup.html.form.ListMultipleChoice.updateModel(ListMultipleChoice.java:344)
>>> at
>>>
>>> org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223)
>>> at
>>>
>>> org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:488)
>>> at
>>>
>>> org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467)
>>> at
>>>
>>> org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:439)
>>> at
>>>
>>> org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1970)
>>> at
>>>
>>> org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1938)
>>> at org.apache.wicket.markup.html.form.Form.process(Form.java:960) at
>>> org.apache.wicket.markup.html.form.Form.process(Form.java:908) at
>>> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:876) at
>>> java.lang.reflect.Method.invoke(Method.java:597) at
>>>
>>> org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
>>> at
>>>
>>> org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
>>> at
>>>
>>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>>> at
>>>
>>> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)
>>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271) at
>>> org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370) at
>>> org.apache.wicket.RequestCycle.request(RequestCycle.java:501) at
>>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
>>> at
>>>
>>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
>>> at
>>>
>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>> at
>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>>> at
>>>
>>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>> at
>>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>> at
>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
>>> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>>> at
>>>
>>> org.apache.geronimo.jetty6.handler.TwistyWebAppContext.access$101(TwistyWebAppContext.java:40)
>>> at
>>>
>>> org.apache.geronimo.jetty6.handler.TwistyWebAppContext$TwistyHandler.handle(TwistyWebAppContext.java:65)
>>> at
>>>
>>> org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler.handle(ThreadClassloaderHandler.java:46)
>>> at
>>>
>>> org.apache.geronimo.jetty6.handler.InstanceContextHandler.handle(InstanceContextHandler.java:58)
>>> at
>>>
>>> org.apache.geronimo.jetty6.handler.UserTransactionHandler.handle(UserTransactionHandler.java:48)
>>> at
>>>
>>> org.apache.geronimo.jetty6.handler.ComponentContextHandler.handle(ComponentContextHandler.java:47)
>>> at
>>>
>>> org.apache.geronimo.jetty6.handler.TwistyWebAppContext.handl

Re: JPA EntityManager storage

2009-06-05 Thread Frank Tegtmeyer
> You may find these of interest:
> http://javanotepad.blogspot.com/2007/08/managing-jpa-entitymanager-lifecycle.html

Yes, if I need that level of flexibility (which I don't need). I pay 
with complexity of the implementation.
Anyway, this is a nice lesson, thanks for the link!

Regards, Frank


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



Re: JPA EntityManager storage

2009-06-05 Thread Christopher L Merrill

Frank Tegtmeyer wrote:
> would the Request object be a good place to store a JPA EntityManager?
> It would be created in onBeginRequest() and destroyed in
> onEndRequest() of the RequestCycle object.

You may find these of interest:
  
http://javanotepad.blogspot.com/2007/08/managing-jpa-entitymanager-lifecycle.html
  http://javanotepad.blogspot.com/2007/05/jpa-entitymanagerfactory-in-web.html

Chris

--
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Website Load Testing and Stress Testing Software & Services
 -

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



Re: DropDownChoice - required, one item so preselection?

2009-06-05 Thread m_salman

Thanks so much for yoru response.  I tried a few things from your response
and one solution solved the problem.  I changed the ChoiceRenderer
constructor to include the "id" part. And it worked.

So here is the code:


form = new Form(
"form",
new 
CompoundPropertyModel(parameterMetaData));

form.setOutputMarkupPlaceholderTag(true);

add(form);



form.add(choiceParameterInOutType = 
new DropDownChoice(
"parameterInOutType",
listParameterInOutType,
new 
ChoiceRenderer("name", "id")));

choiceParameterInOutType.setOutputMarkupPlaceholderTag(true);


Thanks again.



Brill Pappin wrote:
> 
> Set the expected value of the id part in your form model (the model  
> where the dropdown will store the submitted value).
> when the dropdown renders it will use the existing value to preset the  
> choice.
> 
> In your code below, it looks like the model is created new every time.  
> for this to work, the model has to have the preselected choice set on  
> it, or it need to survive renders.
> Your ChoiceRenderer simply tells the component which part is id and  
> which is display.
> 
> - Brill Pappin
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice---required%2C-one-item-so-preselection--tp19198000p23890566.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: JPA EntityManager storage

2009-06-05 Thread Martin Makundi
> But what is wrong with binding a resource directly to the request when
> it is used exactly for the lifetime of the request?

a) sounds complex
b) you are BINDING it.

The less you have dependencies on _specific_ bound components, the
better.. in general.

**
Martin
>
>
> -
> 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: DropDownChoice - required, one item so preselection?

2009-06-05 Thread Brill Pappin
Set the expected value of the id part in your form model (the model  
where the dropdown will store the submitted value).
when the dropdown renders it will use the existing value to preset the  
choice.


In your code below, it looks like the model is created new every time.  
for this to work, the model has to have the preselected choice set on  
it, or it need to survive renders.
Your ChoiceRenderer simply tells the component which part is id and  
which is display.


- Brill Pappin


On 2-Jun-09, at 6:54 PM, m_salman wrote:



I have set the model. But I still don't see it preselected when the
dropDownChoice object is displayed:

form.add(new DropDownChoice(
"parameterInOutType",
new
CompoundPropertyModel 
(parameterMetaData.getParameterInOutType()),

listParameterInOutType,
new 
ChoiceRenderer("name")));



Am I missing some thing?  DO I need to do something in the html?

Thanks.





Nino.Martinez wrote:


just set the model to what you want selected:)

John wrote:

hi, when using a DropDownChoice is there a way to have the value
preselected if there is only one available and the field is  
required?


i have looked through the code but cannot see any settings that  
might

control this, and am stumped trying to work out how to extend the
control in this way.

john

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




--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
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/DropDownChoice---required%2C-one-item-so-preselection--tp19198000p23842503.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




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



ModalWindow content doesn't work in Firefox 3 in 1.4 rc4

2009-06-05 Thread Johan Haleby
Hi,

I'm creating a standard Wicket Modal Window and adding a Panel to it using
modalWindow.setContent(new MyPanel(..));

The modal window pops up and displays a header but the content is completely
empty in Firefox. Everything works fine in Internet Explorer though. Have
anyone experienced the same problem?

/Johan


Re: Mix generic HTML for Wicket

2009-06-05 Thread Brill Pappin

Yes.

not to be rude, but your missing a bit of the concept of WIcket  
here... the point is that the html *is* generic.
There are options for displaying table data fairly quickly, but in no  
case (that I know of) are you going to get it for free without doing  
anything at all.


I recommend you do a spike and try out a few ways of doing it. Also  
take a look at some of the WIcketStuff examples. Heres a starting point:

http://tinyurl.com/p4v28m


- Brill Pappin

On 2-Jun-09, at 3:34 PM, sjtirtha wrote:


Hi,

I'm a newbie with wicket.
I see that all sample always require .html and .java on the same  
folder with

the same name.
When I look into the .html files. They always contain simple html.
Is there any possibility that I have a generic html and a generic  
wicket

component that can be used shows DB tables.

Regards,
Steve




Re: JPA EntityManager storage

2009-06-05 Thread Frank Tegtmeyer

> Don't fall into the trap of premature optimization!

Hm. Maybe I'm in this trap already.
But what is wrong with binding a resource directly to the request when 
it is used exactly for the lifetime of the request? For me this only 
sounds logical compared to the pragmatic approach using a ThreadLocal 
object.
Are there any technical reasons against storing in the request?

Regards, Frank


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



YUI drag and drop problem in Wicket 1.4 rc4

2009-06-05 Thread Johan Haleby
Hi,

I'm using the latest snapshot of the YUI drag and drop component (a
YuiDDListView) for Wicket 1.4 rc4. The problem is that there seems to be a
bug in the code and the position parameter is lost. This means that where
ever you drop a component it will always end up at the first position in the
list view (since position is lost the integer position value is set to 0).
Have anyone else experienced this problem? Is it a bug or am I doing
something wrong?

/Johan


Re: JPA EntityManager storage

2009-06-05 Thread Martin Makundi
> I don't like this approach because it depends on the implicit assumption
> that each request is handled in a thread  (this depends on Wicket
> implementation details, therefor I dislike it)

Don't fall into the trap of premature optimization!

**
Martin

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



Re: JPA EntityManager storage

2009-06-05 Thread Martin Makundi
I would just use a ThreadLocal variable in some static
EntityManagerUtil/Helper class.

**
Martin

2009/6/5 Frank Tegtmeyer :
> Hi,
>
> would the Request object be a good place to store a JPA EntityManager?
> It would be created in onBeginRequest() and destroyed in
> onEndRequest() of the RequestCycle object.
>
> I saw two other options already:
> - use a filter in combination with Spring (I don't want to use Spring
>  yet - this would add to all the new stuff I have to learn so far)
> - use a ThreadLocal object like in
>  http://rattlab.net/2008/10/persistenz-fur-den-feedreader/
>  in the class JpaUtil. I don't like this approach because it depends
>  on the implicit assumption that each request is handled in a thread
>  (this depends on Wicket implementation details, therefor I dislike it)
>
> Any advice is welcome.
>
> Regards, Frank
>
>
> -
> 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



Autocomplete - show more alternatives

2009-06-05 Thread Jon Jaatun
Hi,
We are trying to add an option to an autocompletetextfield to allow showing
more alternatives if we have more suggestions than is actually shown. We
want to show this in either a new panel on the original page the
autocomplete is on or showing it in a modal window. In the process we have
copied over some code from the original autocompletetextfield. Our problem
is that the ajax response is just handled in the javascript and never
updated on the page.

What we have done is adding this this to the javascript

  if(
element.firstChild.childNodes[selected].attributes['islink']!=undefined ) {
var ivalue = wicketGet(elementId).value;
var request = new
Wicket.Ajax.Request(callbackUrl+"&l="+processValue(ivalue), doEndConv,
false, true, false, "wicket-autocomplete|d");
request.get();

and

function doEndConv(resp){
Wicket.replaceOuterHtml(wicketGet("panel"), resp);
   hideAutoComplete();
Wicket.Log.info("Response processed successfully.");
Wicket.Ajax.invokePostCallHandlers();
}


in respond(AjaxRequestTarget target) in the AbstractAutocompleteBehavior we
have tried to both replacing a panel and opening a modal window when:

  final String link = requestCycle.getRequest().getParameter("l");
  if( link!=null ) {

is there anything here that we should have done differently, or are there
other ways of doing this that are actually working? any experiences? :-)


JPA EntityManager storage

2009-06-05 Thread Frank Tegtmeyer
Hi,

would the Request object be a good place to store a JPA EntityManager?
It would be created in onBeginRequest() and destroyed in 
onEndRequest() of the RequestCycle object.

I saw two other options already:
- use a filter in combination with Spring (I don't want to use Spring 
  yet - this would add to all the new stuff I have to learn so far)
- use a ThreadLocal object like in
  http://rattlab.net/2008/10/persistenz-fur-den-feedreader/
  in the class JpaUtil. I don't like this approach because it depends 
  on the implicit assumption that each request is handled in a thread 
  (this depends on Wicket implementation details, therefor I dislike it)
  
Any advice is welcome.

Regards, Frank


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



Wicket and HTML5

2009-06-05 Thread Gabriel Kastenbaum
Hi everyone,

I was watching (part of) the video about google wave and they say it is full
html5. It made me think of one thing, maybe html isn't "that" a thing of the
past...
Is there any support of HTML 5 features planned for Wicket?

Have a good day,
Gabriel K.


Re: Dynamic green or red UL background for FeedbackPanel

2009-06-05 Thread Luther Baker
This worked out for me:

*html*
[feedback]

*Java*
final Panel panel = new FeedbackPanel("feedbackPanel");
...
and then as necessary

panel.add(new SimpleAttributeModifier("class", "info"));
or
panel.add(new SimpleAttributeModifier("class", "error"));
etc ...


*css*

ul.feedbackPanel {  /* default color scheme */
border: 1px solid #099;
background-color: #eff;
color: #099;
}

div.error ul.feedbackPanel {   /* color scheme on explicit error */
background-color: #fee;
border: 1px solid #900;
color: #900;
}

div.info ul.feedbackPanel { /* color scheme on explicit info */
border: 1px solid #090;
background-color: #efe;
color: #090;
}

On Fri, Jun 5, 2009 at 1:14 AM, Luther Baker  wrote:

> Thanks ... I will try to apply a behavior ...
>
> -Luther
>
>
>
> On Fri, Jun 5, 2009 at 1:02 AM, Jeremy Thomerson <
> jer...@wickettraining.com> wrote:
>
>> You actually could - write a behavior that runs through the messages
>> that the FP will be displaying and set the class based on it.  Or
>> subclass FP and do the same.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Fri, Jun 5, 2009 at 12:53 AM, Luther Baker 
>> wrote:
>> > Yep - that is what I'm asking - and Javascript would be fine.
>> >
>> > I guess it'd also be nice if, say, I could do something directly in
>> Java.
>> > Explicitly apply a behavior or something specific to the FeedbackPanel
>> to
>> > set or override the CSS class attribute.
>> >
>> > Thanks Jeremy,
>> >
>> > -Luther
>> >
>> >
>> >
>> > On Fri, Jun 5, 2009 at 12:02 AM, Jeremy Thomerson <
>> jer...@wickettraining.com
>> >> wrote:
>> >
>> >> Use javascript.  First, style your LI elements to the appropriate
>> >> color.  That gives the default.  Then when the page loads, you can
>> >> check to see if they are all error (in which case they'd all already
>> >> be red).  I guess what you're saying is that if ANY of them are an
>> >> error message, that you want the whole UL to be red?  If so, you could
>> >> do that in JS.
>> >>
>> >> --
>> >> Jeremy Thomerson
>> >> http://www.wickettraining.com
>> >>
>> >>
>> >>
>> >>
>> >> On Thu, Jun 4, 2009 at 11:58 PM, Luther Baker 
>> >> wrote:
>> >> > I have a minor question regarding the FeedbackPanel.
>> >> >
>> >> > I'd like to have the panel display a subtle red background on ERROR
>> and a
>> >> > subtle green background on INFO. Obviously there can be more than one
>> LI
>> >> -
>> >> > but assuming its all errors or info ... using css on the LI isn't
>> enough.
>> >> > For instance, the LI bullet shows up outside of the LI background.
>> The
>> >> css
>> >> > background color therefore needs to be on the UL of the resulting:
>> >> >
>> >> >  
>> >> >
>> >> >  Login
>> >> > failed. Please try again.
>> >> >
>> >> >  
>> >> >
>> >> >
>> >> > Unfortunately, error or info, I the FeedbackPanel only uses
>> >> "feedbackPanel"
>> >> > as the style and can't really make the background consistent with the
>> >> > general notice being displayed.
>> >> >
>> >> > Is there an easy way around this? I guess I want to make the UL green
>> or
>> >> > red, depending on the type of message being displayed (understanding
>> that
>> >> > more than one type can be displayed).
>> >> >
>> >> > -Luther
>> >> >
>> >>
>> >> -
>> >> 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
>>
>>
>


WWB for W 1.4 (was Re: when will be wicket 1.4 final release)

2009-06-05 Thread Daniel Toffetti
danisevsky  gmail.com> writes:
> 
> Hi,
> I would like ask you when I can expect wicket 1.4 final release? I am asking
> because I am waiting for wicket web beans which will be release after filnal
> wicket 1.4 release.
> Thanks for answer.
> 

Hi,

Wicket Web Beans has been updated to Wicket 1.4, there is not a
final release yet, you can check the code in trunk:

  http://code.google.com/p/wicket-web-beans/source/checkout


Regards,

Daniel




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



Re: Could TinyMCE Upload pictures or files

2009-06-05 Thread Janos Cserep
I'm using the following custom tinymce javascript initialization (I
don't use the default which comes with wicket-tinymce, but put this
together manually). I override the image button of tinymce so the
callback can change the whole panel and display a selector one. The
user can use the selector panel to upload new pictures as well, but
that's handled by wicket at that point.


public class FormTinyMceRow extends FormTextAreaRow {

private static final long serialVersionUID = 1L;

public static final ResourceReference REFERENCE_MIN = new
CompressedResourceReference(
InPlaceEditBehavior.class, "tiny_mce/tiny_mce.js");

public FormTinyMceRow(String id, String selector) {
super(id, selector);
get("component").setOutputMarkupId(true);
add(JavascriptPackageResource.getHeaderContribution(REFERENCE_MIN));
final AjaxFormSubmitBehaviorImpl b = new
AjaxFormSubmitBehaviorImpl("onNever");
add(b);
add(new Label("script", new Model() {

@Override
public String getObject() {
String siteCss =
CmsConfig.getSiteById(((CmsSession)getSession()).getSiteId()).getCss();
return " tinyMCE.init({ " +
"mode : \"exact\", " +
"elements : \"" +
FormTinyMceRow.this.get("component").getMarkupId() + " \"," +
"language : \"hu\", " +
"theme : \"advanced\", " +
"plugins : \"paste, searchreplace, preview,
table, emotions\", " +
"theme_advanced_buttons1 :
\"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect\","
+
"theme_advanced_buttons2 :
\"cut,copy,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,preview,|,forecolor\","
+
"theme_advanced_buttons3 :
\"tablecontrols,|,blockquote,removeformat,visualaid,|,sub,sup,|,charmap,emotions,hr,advhr,fullscreen\",
" +
"theme_advanced_buttons4 : '', " +
"theme_advanced_toolbar_location : \"top\"," +
"theme_advanced_statusbar_location : \"bottom\"," +
"theme_advanced_toolbar_align : \"left\"," +
"theme_advanced_resizing : true," +
"entity_encoding : \"raw\"," +
"content_css : \"" + siteCss + "\"," +
"verify_css_classes : true," +
"verify_html : true," +
"setup : function(ed) {" +
"ed.addButton('image', {" +
" onclick : function() {\n" +
"   tinyMCE.execCommand('mceInsertContent',
false, '%%IMAGE%%'); \n"+
"   tinyMCE.triggerSave(true,true);\n" +
"   " + b.getEventHandler() +
"\n  }" +
"});" +
"} });";
}
}).setEscapeModelStrings(false));
}


Unfotunately I couldn't get the javascript functions to insert the
image at the right position, so I'm using a string substitution
pattern to do it. My base pages can handle pushing (to display a new
dialog) and popping (to get back to previous content) components into
the main area of my layout:

  private class AjaxFormSubmitBehaviorImpl extends AjaxFormSubmitBehavior {

public AjaxFormSubmitBehaviorImpl(String event) {
super(event);
}

@Override
public void onSubmit(AjaxRequestTarget target) {
CmsPage page = (CmsPage) getPage();
ContentSelector selector = new
ContentSelector(page.getMainId(), new Model(), Photo.class) {

@Override
public void close(AjaxRequestTarget target) {

Photo photo = (Photo) getDefaultModelObject();
String replacement = "";
if (photo != null) {
Image image = photo.getThumbnail();
if (image != null) {
replacement =

ImageView.contentImageUrl(image.getId(), 1, null,
photo.getTitle()).toString();
}
}
IModel model =
FormTinyMceRow.this.get("component").getDefaultModel();

model.setObject(model.getObject().toString().replaceAll("%%IMAGE%%",
replacement));
((CmsPage) getPage()).popMainContent(target);
}
};
page.pushMainContent(selector, target);
}

@Override
protected void onError(AjaxRequestTarget target) {
}

// have to make it public
@Override
public CharSequence getEventHandler() {
return su

Re: Different xml property filename for the markup and java

2009-06-05 Thread jensiator

That is what I missed! That must be the solution. Thanks Igor
Jens
-- 
View this message in context: 
http://www.nabble.com/Different-xml-property-filename-for-the-markup-and-java-tp23847329p23885796.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: Wicketstuff-artwork and jQuery

2009-06-05 Thread nino martinez wael
Great to hear..:)

What about some screen shots?

2009/6/4 Stefan Jozsa :
>
> Fixed!
>
> Last (minute/hour) version of WicketJQuery.jar helped, that is
> Wicketstuff-artwork is no more messed by JQuery based drag&drop.
>
> Thanks to Stefan Lindner,
>
> Stefan (Jozsa)
>
>
> --- On Thu, 6/4/09, Stefan Jozsa  wrote:
>
>> From: Stefan Jozsa 
>> Subject: RE: Wicketstuff-artwork and jQuery
>> To: users@wicket.apache.org
>> Date: Thursday, June 4, 2009, 10:11 PM
>>
>> Artwork works OK without drag&drop
>> (regardles based on WicketJQuery or WiQuery).
>> Using WiQuery based drag&drop artwork is messed, but
>> using WicketJQuery based drag&drop artwork is
>> "disabled"
>> (it is "killed", no canvas at all rendered).
>>
>> WicketJQuery uses jQuery-1.3.2.
>> Wiquery-1.0-alpha.jar uses jQuery-1.3.2.
>>
>> Now, artwork requires wicketstuff-jslibraries.
>> As I saw in jslibraries-1.4-20090529.171935-199.jar
>> there is a lot of JS library (versions) !
>> I don't know which version of jQuery,
>> in jslibraries, is used by artwork !
>>
>> Regarding JS library loading, sometimes
>> they are loaded by JS script(s),
>> sometimes by Java, so I
>> cannot say which was loaded "first"
>> (sorry, I'm not a JS guy...)
>>
>> Stefan Jozsa
>>
>>
>> --- On Thu, 6/4/09, Stefan Lindner 
>> wrote:
>>
>> > From: Stefan Lindner 
>> > Subject: RE: Wicketstuff-artwork and jQuery
>> > To: users@wicket.apache.org
>> > Date: Thursday, June 4, 2009, 9:29 PM
>> > This means if you use
>> > Wicketstuf-artwork without another jquery based
>> library all
>> > works fine? If you add WicketJQuery,
>> Wicketstuf-artwork
>> > stops working correctly?
>> >
>> > Do they both use the same jquery version? WicketJQuery
>> uses
>> > version 1.3.2. Which library is loaded first (if you
>> inspect
>> > the  section)?
>> >
>> > -Ursprüngliche Nachricht-
>> > Von: Stefan Jozsa [mailto:stefan_...@yahoo.com]
>> >
>> > Gesendet: Donnerstag, 4. Juni 2009 19:45
>> > An: users@wicket.apache.org
>> > Betreff: Wicketstuff-artwork and jQuery
>> >
>> >
>> > After having Wicketstuf-artwork problems using
>> > drag&drop based on WiQuery,
>> > I tryed Stefan Lindner's WicketJQuery library
>> > (see http://subversion.visionet.de/project/WicketJQuery).
>> >
>> > I still have problems, that is, artwork's liquid
>> canvases
>> > (and rounded rectangles) are not rendered at all !
>> >
>> > The catch is that Wicketstuff-artwork and the
>> drag&drop
>> > library,
>> > both, use JQuery.
>> >
>> > I'm using:
>> > Wicket-1.4.rc4,
>> > Wicketstuff-artwork-1.4-20090529.171935-143,
>> > Wicketstuff-jslibraries-1.4-20090529.171935-199,
>> > WicketJQuery.jar,
>> > Firefox-3.0.10
>> >
>> > Can anyone help ?
>> >
>> > Thanks,
>> > Stefan Jozsa
>> >
>> >
>> >
>> >
>> >
>> >
>> -
>> > 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
>> >
>> >
>>
>>
>>
>>
>> -
>> 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
>
>

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



how to call javascript with AjaxPagingNavigator ?

2009-06-05 Thread 新希望软件 -- 俞宏伟
Hi, all

I need to call javascript after jumping to the next page, how can I do this?

i try to add Behavior to my ajaxpagingNavigator,

myAjaxpagingNavigator.add(new AbstractBehavior() {

@Override
public void renderHead(IHeaderResponse iHeaderResponse) {
super.renderHead(iHeaderResponse);

iHeaderResponse.renderOnDomReadyJavascript("Register.init('latestShops');");//add
javascript here
}
});

but when click next page, the page reload all.

thanks