Re: Form in tfoot disappears after submission

2010-11-16 Thread Igor Vaynberg
form tag is now allowed as a child of tr

-igor

On Tue, Nov 16, 2010 at 9:29 PM, Alec Swan  wrote:
> Hello,
>
> I have a  with  containing the table header, 
> containing a list of records and  containing a
> .. which allows the user to add a new record to
> the table. The table is rendered using DataView class and is updated
> using AJAX after the form submission.
>
> This works as expected in IE. The user enters new record data, submits
> the form which causes table to get updated with the new record.
>
> In Firefox, the form in thead gets hidden after that table is
> refreshed. So, effectively the user can no longer add a new row.
>
> What is causing this and how to solve this?
>
> Thanks!
>
> P.S. Here is the form markup that Wicket generates for the form after
> it is submitted (note style="width: 0px; height: 0px;.." part)
>
> 
>  id="addForm1b4"
> action="?wicket:interface=modal-dialog-pagemap:6:msPanel:variableListPanel:addForm::IFormSubmitListener::">
>  id="addForm1b4_hf_0" name="addForm1b4_hf_0">
>     ..
> 
>
> -
> 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: Switching between wicket tabs

2010-11-16 Thread Igor Vaynberg
RequestCycle.get().setResponsePage( getPage() ); is unnecessary

-igor

On Tue, Nov 16, 2010 at 2:01 PM, Alexander Monakhov  wrote:
> Hello.
>
> Add link to content panel. onClick() method should select appropriated tab:
>                Link link = new Link( "link" ) {
>
>                       �...@override
>                        public void onClick() {
>                             tabbedPanel.setSelectedTab( /* any tab
> index here*/ );
>                             RequestCycle.get().setResponsePage( getPage() );
>                        }
>
>                };
>
> When onClick() method invoked, desired tab is selected and page that
> contains tabbed panel is set as response page.
>
> Best regards, Alexander.
>
> -
> 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: StackOverflowError

2010-11-16 Thread Igor Vaynberg
added a log warning to property models when they reference session.

-igor

On Tue, Nov 16, 2010 at 9:46 AM, Douglas Ferguson
 wrote:
> We found it.. Finally!!!
>
> There was a property model that was using the session as the model object.
>
> It would be cool if PropertyModel, etc would check for this and blow up on 
> construction.
> i.e. not allow Page, Session, Application as the model object...
>
> D/
> On Nov 16, 2010, at 11:20 AM, Douglas Ferguson wrote:
>
>> Just tested on 1.4.13 and it still happens
>>
>> On Nov 16, 2010, at 9:43 AM, Douglas Ferguson wrote:
>>
>>> 1.4.12, but the problem has been around since a few versions back.
>>>
>>> D/
>>>
>>> On Nov 16, 2010, at 12:43 AM, Martijn Dashorst wrote:
>>>
 Are you using 1.4.13?

 Martijn

 On Tue, Nov 16, 2010 at 5:54 AM, Douglas Ferguson
  wrote:
> Some time ago I posted to the list regarding a stack overflow error that 
> I was receiving and the advice was to make sure that I didn't have a page 
> storing a reference to another page.
> We did track this down and have just had to ignore it in the production 
> logs.  Now we've made it a priority to track this down.
>
> Anyway, we've recently tracked this down to "AutomaticMultiWindowSupport" 
> feature. We are able to recreate the bug by pasting a url into a new 
> browser window and thus generating a new pagemap. On a certain page the 
> memory consumption doubles as you generate new pagemaps (see the chart 
> below). The profile is indicating that the memory is being taken up by a 
> hashmap, but that's as far as we've been able to trace it so far.
>
>> PageMap #    Size    Growth
>> 13    389523448    1.93
>> 12    202059096    1.93
>> 11    104804096    1.93
>> 10    54352280    1.93
>> 9    28182760    1.93
>> 8    14594976    1.93
>> 7    7549336    1.94
>> 6    3900704    1.94
>> 5    2013480    2
>> 4    1006960    2
>> 3    503696    2
>> 2    252072    1.86
>> 1    135704
>
>
> Any thoughts or tips on trying to get to the bottom of this one?
>
> Here's the stack trace
>
>>     at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
>>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>     at java.lang.reflect.Method.invoke(Unknown Source)
>>     at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>     at java.util.LinkedList.writeObject(Unknown Source)
>>     at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
>>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>     at java.lang.reflect.Method.invoke(Unknown Source)
>>     at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
>>     at org.apache.wicket.Component.writeObject(Component.java:4660)
>>     at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
>>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>     at java.lang.reflect.Method.invoke(Unknown Source)
>>     at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinar

Re: StackOverflowError

2010-11-16 Thread Igor Vaynberg
it is perfectly valid to use page as the model object. in fact if you
wanted to pull something out of session you can simply say new
PropertyModel(this, "session.property"), this being the Page instance
you are in.

-igor

On Tue, Nov 16, 2010 at 9:46 AM, Douglas Ferguson
 wrote:
> We found it.. Finally!!!
>
> There was a property model that was using the session as the model object.
>
> It would be cool if PropertyModel, etc would check for this and blow up on 
> construction.
> i.e. not allow Page, Session, Application as the model object...
>
> D/
> On Nov 16, 2010, at 11:20 AM, Douglas Ferguson wrote:
>
>> Just tested on 1.4.13 and it still happens
>>
>> On Nov 16, 2010, at 9:43 AM, Douglas Ferguson wrote:
>>
>>> 1.4.12, but the problem has been around since a few versions back.
>>>
>>> D/
>>>
>>> On Nov 16, 2010, at 12:43 AM, Martijn Dashorst wrote:
>>>
 Are you using 1.4.13?

 Martijn

 On Tue, Nov 16, 2010 at 5:54 AM, Douglas Ferguson
  wrote:
> Some time ago I posted to the list regarding a stack overflow error that 
> I was receiving and the advice was to make sure that I didn't have a page 
> storing a reference to another page.
> We did track this down and have just had to ignore it in the production 
> logs.  Now we've made it a priority to track this down.
>
> Anyway, we've recently tracked this down to "AutomaticMultiWindowSupport" 
> feature. We are able to recreate the bug by pasting a url into a new 
> browser window and thus generating a new pagemap. On a certain page the 
> memory consumption doubles as you generate new pagemaps (see the chart 
> below). The profile is indicating that the memory is being taken up by a 
> hashmap, but that's as far as we've been able to trace it so far.
>
>> PageMap #    Size    Growth
>> 13    389523448    1.93
>> 12    202059096    1.93
>> 11    104804096    1.93
>> 10    54352280    1.93
>> 9    28182760    1.93
>> 8    14594976    1.93
>> 7    7549336    1.94
>> 6    3900704    1.94
>> 5    2013480    2
>> 4    1006960    2
>> 3    503696    2
>> 2    252072    1.86
>> 1    135704
>
>
> Any thoughts or tips on trying to get to the bottom of this one?
>
> Here's the stack trace
>
>>     at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
>>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>     at java.lang.reflect.Method.invoke(Unknown Source)
>>     at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>     at java.util.LinkedList.writeObject(Unknown Source)
>>     at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
>>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>     at java.lang.reflect.Method.invoke(Unknown Source)
>>     at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
>>     at org.apache.wicket.Component.writeObject(Component.java:4660)
>>     at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
>>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>     at java.lang.reflect.Method.invoke(Unknown Source)
>>     at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>     at java.io.ObjectOutputStream.defaultWriteFi

Re: Problem including CSS with CSSPackageResource

2010-11-16 Thread Igor Vaynberg
packageresource is for reading files out of java packages. sounds like
your css files are in your webapp. see how ContextImage works, you
might have to write something similar to pull css files out of the
context.

-igor

On Tue, Nov 16, 2010 at 7:35 AM, Benjamin Lorenz
 wrote:
> Hello,
>
> I need to dynamically include different style sheet files for different 
> browser types.
>
> Trying to go with
>
>    add(CSSPackageResource.getHeaderContribution("css/common.css"));
>
> from by BasePage.java, which is the base class all my pages inherit from 
> (net.myself.myproject.BasePage.java)
>
> For some reason, the generated code is
>
> 
>
> I cannot get rid of this (wrong!) "../" in the path. The layout in myapp.war 
> is a very basic one:
>
>
> /WEB-INF
> /images
> /css
>
> I am calling my wicket application like this:
>
> http://www.server.com/myapp
>
> So, I can, by hand, reach my css by
>
> http://www.server.com/myapp/css/common.css
>
> But exactly this last path is impossible to create with wicket. I am 
> wondering what is wrong with above code...
>
> Thanks so much for your help!
>
> Benjamin
>
>
>

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



Re: Link inside feedback message

2010-11-15 Thread Igor Vaynberg
you would have to subclass the component that feedbackpanel uses to
render the message with something like SmartLinkLabel, and add the
urls to your feedback messages.

-igor

On Mon, Nov 15, 2010 at 1:10 PM, Anna Simbirtsev  wrote:
> Hi,
>
> Is it possible to add a bookmarkable link to a feedback message? To
> have a link inside a message?
>
> Thanks,
> Anna
>
> -
> 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: NPE when the underlaying model changed and ajax re-appear.

2010-11-14 Thread Igor Vaynberg
like i said in the jira issue, the NPE is in your code, not in wicket's.

-igor

On Sun, Nov 14, 2010 at 11:26 AM, smallufo  wrote:
> Hi Igor :
>
> Please re-verify WICKET-3162
> (and run the quickstart)
>
> It's not solved.
>
>
> 2010/11/12 Igor Vaynberg 
>
>> jira+quickstart
>>
>> -igor
>>
>> On Thu, Nov 11, 2010 at 5:48 PM, smallufo  wrote:
>> > Hi , thanks
>> > I tried , but NPE is still thrown , with the same stacktrace...
>> > Is there anything I missed ?
>> >
>> > Here is my border's HTML :
>> >
>> > 
>> >  
>> > 
>> >
>> > border's java code :
>> >
>> >    content = new WebMarkupContainer("content");
>> >
>> >    content.setOutputMarkupPlaceholderTag(true);
>> >    content.setVisible(defaultExpanded);
>> >    content.setRenderBodyOnly(false);
>> >    add(content);
>> >    content.add(getBodyContainer());
>> >
>> > and the ajax link's onClick() :
>> >
>> > Link collapseExpandLink = new
>> > AjaxFallbackLink("collapseExpandLink")
>> > {
>> > �...@override
>> >  public void onClick(AjaxRequestTarget target)
>> >  {
>> >    expanded=!expanded;
>> >    content.setVisible(expanded);
>> >    target.addComponent(content);
>> >  }
>> > };
>> > add(collapseExpandLink);
>> >
>> >
>> >
>> >
>> > 2010/11/12 Igor Vaynberg 
>> >
>> >>
>> s/border.add(commentsView);/border.getbodycontainer().add(commentsView);/
>> >>
>> >> On Thu, Nov 11, 2010 at 1:42 PM, smallufo  wrote:
>> >> > Hi , I have a simple panel , with a border and a listView :
>> >> >
>> >> > 
>> >> >  
>> >> >    
>> >> >      //comment layout
>> >> >    
>> >> >  
>> >> > 
>> >> >
>> >> > And the code :
>> >> >
>> >> > add(border);
>> >> > ListView commentsView = new ListView("commentsView"
>> ,
>> >> new
>> >> > LoadableDetachableModel>()
>> >> > {
>> >> > �...@override
>> >> >  protected List load() {
>> >> >    return commentDao.getComments(0 , 10);
>> >> >  }
>> >> > })
>> >> > {
>> >> > �...@override
>> >> >  protected void populateItem(ListItem item) {
>> >> >    //comment layout
>> >> >  }
>> >> > };
>> >> > border.add(commentsView);
>> >> > commentsView.setReuseItems(false);
>> >> >
>> >> > The Panel has a border , with a clickable button , can be used to
>> >> > collapse/expand the content of the border with AJAX.
>> >> > Here is my steps :
>> >> >
>> >> > 1. I first collapse the panel .
>> >> > 2. Then open another browser panel , add a comment. (the underlaying
>> data
>> >> > model is changed)
>> >> > 3. Back to the original panel , expand the panel ...
>> >> >
>> >> > And I got a NPE :
>> >> >
>> >> > 2010-11-12 05:19:12,661 ERROR wicket.RequestCycle - Exception in
>> >> rendering
>> >> > component: [MarkupContainer [Component id = _body]]
>> >> > org.apache.wicket.WicketRuntimeException: Exception in rendering
>> >> component:
>> >> > [MarkupContainer [Component id = _body]]
>> >> >        at
>> >> org.apache.wicket.Component.renderComponent(Component.java:2725)
>> >> >        at
>> >> > org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
>> >> >        at org.apache.wicket.Component.render(Component.java:2517)
>> >> >        at
>> >> >
>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
>> >> >        at
>> >> >
>> >>
>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
>> >> >        at
>> >> >
>> >>
>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
>> >> >        at
>> >> org.apache.wicket.Component.renderComponent(Component.java:2686)
>> >> >        at
>> >> > org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
>> >> >
>> >> > ...
>> >> >
>> >> > Caused by: java.lang.NullPointerException
>> >> >        at
>> >> >
>> >>
>> org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:375)
>> >> >        at
>> >> org.apache.wicket.Component.renderComponent(Component.java:2686)
>> >> >        ... 45 more
>> >> >
>> >> > Can anybody tell me where goes wrong ? Thanks.
>> >> > Wicket 1.4.13
>> >> >
>> >>
>> >> -
>> >> 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



Re: Memory Leak in 1.4.13?

2010-11-13 Thread Igor Vaynberg
please test with latest snapshot. see
https://issues.apache.org/jira/browse/WICKET-3160

-igor

On Wed, Nov 10, 2010 at 2:57 PM, Brad Grier  wrote:
> I recently upgraded our app from 1.4.12 to 1.4.13. Our app has an admin 
> screen that shows the current session size using Session’s getSizeInBytes 
> method. This screen is just a panel that gets replaced/refreshed via Ajax 
> when a link is clicked. Today I noticed that every time I clicked the link to 
> reload the panel the session size grows by around 3000 KB and never does a 
> gc. If I roll back to 1.4.12 and the problem goes away.
>
> In the Netbeans profiler, the only thing I see spiraling out of control are 
> byte[] objects (serialized objects?). Nothing unusual appears with the size 
> or number of my application specific objects. For now I’m rolling back to 
> 1.4.12 as I’m not sure how this is affecting things outside this specific 
> screen.
>
> Thanks.

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



Re: Multiple URL coding strategies on the same mount path

2010-11-13 Thread Igor Vaynberg
the easiest way is to mount a page onto /shop using indexed coding
strategy. parse the parameters, and throw a restartresponseexception
with the right page.

-igor

On Sat, Nov 13, 2010 at 5:15 PM, Sebastian  wrote:
> Hi,
> we are currently migrating a webapp to Wicket and have the requirement to
> keep the existing URL structure.
>
> Here is an example of REST-like URLs we need to match to different pages:
> /shop/                    => ShopWelcomePage.class
> /shop/A/                  => BrandsByFirstCharPage.class
> /shop/A/Activision/       => BrandPage.class
> /shop/A/Apple/            => BrandPage.class
> /shop/A/Apple/iPhone-4G   => ProductPage.class
> /shop/H/HTC/              => BrandPage.class
> /shop//         => CategoryPage.class
> /shop// => SubCategoryPage.class
>
> What is the best way to achieve this in Wicket 1.4/1.5?
>
> I found https://issues.apache.org/jira/browse/WICKET-1534 where a
> VersatileWebRequestCodingStrategy is proposed for Wicket 1.3. I updated the
> code for Wicket 1.4 and it seems to work. However I am unsure if this really
> is best practice or if there is a better solution available.
>
> Here is an example how I am currently mounting pages using the
> VersatileWebRequestCodingStrategy:
>
> mount(new BookmarkablePageRequestTargetUrlCodingStrategy("/shop/",
> ShopWelcomePage.class, null) {
>  public boolean matches(String path, boolean caseSensitive) {
>    return path.equals("shop/");
>  }
> });
>
> mount(new MixedParamUrlCodingStrategy("/shop/", BrandPage.class, new
> String[]{"brandFirstChar", "brandName"}) {
>  Pattern pattern = Pattern.compile("^shop/([^/])/([^/]+)/$");
>  public boolean matches(String path, boolean caseSensitive) {
>    Matcher matcher = pattern.matcher(path);
>    return matcher.matches() &&
> matcher.group(1).equals(matcher.group(2).substring(0, 1));
>  }
> });
>
> mount(new MixedParamUrlCodingStrategy("/shop/", ProductPage.class, new
> String[]{"brandFirstChar", "brandName", "productSlug"}) {
>  Pattern pattern = Pattern.compile("^shop/[^/]/[^/]+/[^/]+/$");
>  public boolean matches(String path, boolean caseSensitive) {
>    return pattern.matcher(path).matches();
>  }
> });
>
> mount(new MixedParamUrlCodingStrategy("/shop/", CategoryPage.class, new
> String[]{"category"}) {
>  Pattern pattern = Pattern.compile("^shop/[^/]{2,}/$");
>  public boolean matches(String path, boolean caseSensitive) {
>    return pattern.matcher(path).matches();
>  }
> });
>
> mount(new MixedParamUrlCodingStrategy("/shop/",  SubCategoryPage.class, new
> String[]{"category", "subCategory"}) {
>  Pattern pattern = Pattern.compile("^shop/[^/]{2,}/[^/]+/$");
>  public boolean matches(String path, boolean caseSensitive) {
>    return pattern.matcher(path).matches();
>  }
> });
>
> Thanks.
>
> Regards,
>
> Seb
>
>
> -
> 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: PropertyResolver and dynamic properties

2010-11-13 Thread Igor Vaynberg
or let whatever it is that has dynamic properties also implement Map

-igor

On Sat, Nov 13, 2010 at 5:59 AM, James Carman
 wrote:
> Have you tried using BeanUtils' DynaBeans?  BeanUtils can resolve
> properties on DynaBeans.  I don't know about the default property
> resolver in Wicket, though.  However, you can always supply your own
> which adds functionality.  It could even "wrap" the existing one.
>
> On Sat, Nov 13, 2010 at 7:13 AM, Adrian Wiesmann  wrote:
>> Hello list
>>
>> I am working on filtering tables. To do so I use the FilterToolbar,
>> FilterForm, etc. Everything renders perfectly so far. Now I am trying to
>> implement my FilterState and run into problems.
>>
>> Looking into the sourcecode I noticed that the PropertyResolver of Wicket
>> tries to find getter and setter methods. My problem with this is, that I
>> need some dynamic getter and setter. This is because I work with my own UI
>> and data binding engine. I define my UIs in XML and have a renderer render
>> my Wicket UI. All UI fields are bound to Cayenne DataObjects via their
>> absolute path. Now that is not much of a problem. My model knows how to
>> interpret paths like this:
>>
>> table1.relation2.field3
>>
>> But unfortunately the PropertyResolver does not. It only detects specific
>> methods but does not support generic ones ( set(String key, Object value),
>> get(String key) ).
>>
>> Now I could generate FilterState-classes for all of my DataObjects and bind
>> those to the UI. While this works for UIs binding single tables only, it
>> does not work for the example above where a field is bound using a relation
>> to another table.
>>
>> Which brings me to my questions:
>>
>> - Can I somehow extend the PropertyResolver so that I can add my own
>> getter/setter logic for my own FilterState class?
>> - Can I somehow have the standard PropertyResolver call dynamic/generic
>> setter and getter on my FilterState?
>> - Is there another solution to this problem?
>>
>> Thanks for your help.
>>
>> Cheers,
>> Adrian
>>
>> -
>> 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



Re: Wicket design incompatible with Web 2.0 ?

2010-11-12 Thread Igor Vaynberg
not a bad idea. we already have a concept of "channels", but right now
they can only queue or drop requests. with some work it should be
possible to add an "aggregate" mode and process multiple callbacks
within the same request. please file a jira issue.

-igor

On Fri, Nov 12, 2010 at 11:44 AM, John Armstrong  wrote:
> EXT-JS does a nice queueing model where you can set a queue timer (say
> 100ms) and any AJAX requests get bundled up into a single package that
> goes across the wire at once, returning and then being sent back to
> their callers.
>
> This lets a page update many components at once in what appears to be
> real-time without blocking.
>
> Might be an interesting model for wicket at some point in the future.
>
> Yes, I know, EST-JS is a client-side framework. I am only using it as
> an example of how some stacks are resolving these sorts of issues.
>
> John-
>
> On Fri, Nov 12, 2010 at 9:36 AM, Josh Kamau  wrote:
>> AjaxSelfUpdatingTimerBehavior works perfectly for notifications. I guess it
>> wouldnt work very well for a chat-like scenario. I have set mine to 30
>> seconds and it works perfectly. Long polling would hold  a request with
>> nothing to report back in most of the times.
>>
>> regards.
>>
>> On Fri, Nov 12, 2010 at 12:17 PM, Igor Vaynberg 
>> wrote:
>>
>>> why would you need a request every few milliseconds. what is so urgent
>>> about a notification that you cant poll every ten seconds?
>>>
>>> what your long polling thread can do is access the page, render a part
>>> of it, and send it back to the client - but, only when it has
>>> something to say. which instead of many very quick requests to the
>>> page is many very quick accesses to the page.
>>>
>>> -igor
>>>
>>> On Fri, Nov 12, 2010 at 9:13 AM, José Monzón  wrote:
>>> > AjaxSelfUpdatingTimerBehavior is cool for simple repetitive requests.
>>> > But if you try to do long polling with that (comet, retain the request
>>> > in the server as long as you can while there's nothing to send back)
>>> > you will see how your other ajax requests are queued and your page
>>> > freezes.
>>> >
>>> > I've seen many people using AjaxSelfUpdatingTimerBehavior to replace
>>> > long poling. Performing very quick requests to the server (every few
>>> > millisecons). I believe that abusing  AjaxSelfUpdatingTimerBehavior
>>> > leads you to scalability issues. Not to mention that the browser gets
>>> > choppy in slow computers.
>>> >
>>> >
>>> > On Fri, Nov 12, 2010 at 4:42 PM, Josh Kamau 
>>> wrote:
>>> >> I have implemented an application that alerts the user on various
>>> events. I
>>> >> created a notification's bar at the top of my page. This bar has a panel
>>> on
>>> >> which i added AjaxSelfUpdatingTimerBehavior.  The Panel is available in
>>> all
>>> >> pages. whatever the page the use is, as long as the panel is rendered,
>>> it
>>> >> polls the server on regular intervals and displays notifications for
>>> various
>>> >> events - the facebook style.  This is one of the features that has made
>>> me
>>> >> stick with wicket.
>>> >>
>>> >> regards.
>>> >> Josh
>>> >>
>>> >>
>>> >> 1.
>>> >>
>>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/ajax/AjaxSelfUpdatingTimerBehavior.html
>>> >>
>>> >> On Fri, Nov 12, 2010 at 10:37 AM, Frank van Lankvelt <
>>> >> f.vanlankv...@onehippo.com> wrote:
>>> >>
>>> >>> On Fri, Nov 12, 2010 at 3:55 PM, José Monzón 
>>> wrote:
>>> >>> > I recently run into a problem that has make me consider whether
>>> >>> > continuing using Wicket or not for a project. I hope guys you can
>>> >>> > throw some light into it.
>>> >>> >
>>> >>> > I need to create a web application that uses ajax to keep itself
>>> >>> > udpated while still allows the user interact with it also using Ajax.
>>> >>> > Imagine something as GMail, Documents, Facebook, Twitter, etc.
>>> >>> >
>>> >>> > On this pages, is very common to have some ajax COMMET, long polling
>>> >>> > or also known as inverse AJAX to keep the page updated. But that
>>> 

Re: Wicket design incompatible with Web 2.0 ?

2010-11-12 Thread Igor Vaynberg
why would you need a request every few milliseconds. what is so urgent
about a notification that you cant poll every ten seconds?

what your long polling thread can do is access the page, render a part
of it, and send it back to the client - but, only when it has
something to say. which instead of many very quick requests to the
page is many very quick accesses to the page.

-igor

On Fri, Nov 12, 2010 at 9:13 AM, José Monzón  wrote:
> AjaxSelfUpdatingTimerBehavior is cool for simple repetitive requests.
> But if you try to do long polling with that (comet, retain the request
> in the server as long as you can while there's nothing to send back)
> you will see how your other ajax requests are queued and your page
> freezes.
>
> I've seen many people using AjaxSelfUpdatingTimerBehavior to replace
> long poling. Performing very quick requests to the server (every few
> millisecons). I believe that abusing  AjaxSelfUpdatingTimerBehavior
> leads you to scalability issues. Not to mention that the browser gets
> choppy in slow computers.
>
>
> On Fri, Nov 12, 2010 at 4:42 PM, Josh Kamau  wrote:
>> I have implemented an application that alerts the user on various events. I
>> created a notification's bar at the top of my page. This bar has a panel on
>> which i added AjaxSelfUpdatingTimerBehavior.  The Panel is available in all
>> pages. whatever the page the use is, as long as the panel is rendered, it
>> polls the server on regular intervals and displays notifications for various
>> events - the facebook style.  This is one of the features that has made me
>> stick with wicket.
>>
>> regards.
>> Josh
>>
>>
>> 1.
>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/ajax/AjaxSelfUpdatingTimerBehavior.html
>>
>> On Fri, Nov 12, 2010 at 10:37 AM, Frank van Lankvelt <
>> f.vanlankv...@onehippo.com> wrote:
>>
>>> On Fri, Nov 12, 2010 at 3:55 PM, José Monzón  wrote:
>>> > I recently run into a problem that has make me consider whether
>>> > continuing using Wicket or not for a project. I hope guys you can
>>> > throw some light into it.
>>> >
>>> > I need to create a web application that uses ajax to keep itself
>>> > udpated while still allows the user interact with it also using Ajax.
>>> > Imagine something as GMail, Documents, Facebook, Twitter, etc.
>>> >
>>> > On this pages, is very common to have some ajax COMMET, long polling
>>> > or also known as inverse AJAX to keep the page updated. But that
>>> > doesn't prevent the user to click here and there and update the page
>>> > also using AJAX. They are independent XMLHttpRequest with a browser
>>> > can handle perfectly.
>>> >
>>> > I was thinking about doing this on Wicket, but apparently it's
>>> > impossible by design:
>>> > https://issues.apache.org/jira/browse/WICKET-2437
>>> >
>>> > Page objects aren't thread-safe and wicket will block any other thread
>>> > (AJAX call) that tries to access the page while another request (for
>>> > instance our long poll) is there.
>>> >
>>> > Have you ever find yourself into this kind of problem? What's the
>>> > workaround if any?
>>> >
>>> the comet-like functionality is useful for things like chatting, but
>>> you wouldn't
>>> need access to the page for that as you're unlikely to change the
>>> component tree.
>>>
>>> The alternative to long polling is, of course, regular polling.  Queue
>>> the events
>>> and process them when a request is processed.  Then you can access the
>>> page,
>>> update the component tree and rerender the relevant parts.
>>> Maintaining the queue
>>> is a bit tricky, as one has to make sure that it doesn't grow too
>>> large and it must be
>>> disposed of properly.
>>>
>>> We've used this method to implement a single-page-application that updates
>>> exclusively with ajax.  It's not in the facebook/google/... range, but
>>> it works well
>>> enough for our purposes.
>>>
>>> cheers, Frank
>>>
>>> > -
>>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> > For additional commands, e-mail: users-h...@wicket.apache.org
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Hippo
>>> Europe  •  Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31 (0)20 522
>>> 4466
>>> USA  • San Francisco  185 H Street Suite B  •  Petaluma CA 94952-5100
>>> •  +1 (707) 773 4646
>>> Canada    •   Montréal  5369 Boulevard St-Laurent #430 •  Montréal QC
>>> H2T 1S5  •  +1 (514) 316 8966
>>> www.onehippo.com  •  www.onehippo.org  •  i...@onehippo.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
>
>

-
To unsubscri

Re: Everything serializable (and a Java general question)

2010-11-12 Thread Igor Vaynberg
the models have to be serializable, not the model objects they point to.

for example if you are accessing a hibernate entity then the model
that accesses it has to be serializable, not the entity itself. this
is why we have LoadableDetachableModels.

-igor

On Fri, Nov 12, 2010 at 8:18 AM, Brown, Berlin [GCG-PFS]
 wrote:
> I haven't entirely researched this.  But I know wicket recommends
> declaring your model objects as serializable so that if the page
> serializes than so do the objects.
>
> With this approach, I tend to define all or most of my beans and service
> objects as serializable.  Do you have to define an object serializable
> if it is accessed from Wicket (say on an event method)?
>
> Also, aren't there issues with declaring objects as serializable?  Is it
> insecure to put data in a serializable object?  Where by the security
> mechanisms for that object can be bypassed?
>
> For example.
>
> Some Panel.java:
>
> final Serializable x = new Serializable() {}
>
> final Component z = new Link() {
>  onClick {
>      x???  <--- does X have to be serializable in this case?
>  }
> }
>
> Berlin Brown (POL)
>
>

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



Re: NPE when the underlaying model changed and ajax re-appear.

2010-11-11 Thread Igor Vaynberg
jira+quickstart

-igor

On Thu, Nov 11, 2010 at 5:48 PM, smallufo  wrote:
> Hi , thanks
> I tried , but NPE is still thrown , with the same stacktrace...
> Is there anything I missed ?
>
> Here is my border's HTML :
>
> 
>  
> 
>
> border's java code :
>
>    content = new WebMarkupContainer("content");
>
>    content.setOutputMarkupPlaceholderTag(true);
>    content.setVisible(defaultExpanded);
>    content.setRenderBodyOnly(false);
>    add(content);
>    content.add(getBodyContainer());
>
> and the ajax link's onClick() :
>
> Link collapseExpandLink = new
> AjaxFallbackLink("collapseExpandLink")
> {
> �...@override
>  public void onClick(AjaxRequestTarget target)
>  {
>    expanded=!expanded;
>    content.setVisible(expanded);
>    target.addComponent(content);
>  }
> };
> add(collapseExpandLink);
>
>
>
>
> 2010/11/12 Igor Vaynberg 
>
>> s/border.add(commentsView);/border.getbodycontainer().add(commentsView);/
>>
>> On Thu, Nov 11, 2010 at 1:42 PM, smallufo  wrote:
>> > Hi , I have a simple panel , with a border and a listView :
>> >
>> > 
>> >  
>> >    
>> >      //comment layout
>> >    
>> >  
>> > 
>> >
>> > And the code :
>> >
>> > add(border);
>> > ListView commentsView = new ListView("commentsView" ,
>> new
>> > LoadableDetachableModel>()
>> > {
>> > �...@override
>> >  protected List load() {
>> >    return commentDao.getComments(0 , 10);
>> >  }
>> > })
>> > {
>> > �...@override
>> >  protected void populateItem(ListItem item) {
>> >    //comment layout
>> >  }
>> > };
>> > border.add(commentsView);
>> > commentsView.setReuseItems(false);
>> >
>> > The Panel has a border , with a clickable button , can be used to
>> > collapse/expand the content of the border with AJAX.
>> > Here is my steps :
>> >
>> > 1. I first collapse the panel .
>> > 2. Then open another browser panel , add a comment. (the underlaying data
>> > model is changed)
>> > 3. Back to the original panel , expand the panel ...
>> >
>> > And I got a NPE :
>> >
>> > 2010-11-12 05:19:12,661 ERROR wicket.RequestCycle - Exception in
>> rendering
>> > component: [MarkupContainer [Component id = _body]]
>> > org.apache.wicket.WicketRuntimeException: Exception in rendering
>> component:
>> > [MarkupContainer [Component id = _body]]
>> >        at
>> org.apache.wicket.Component.renderComponent(Component.java:2725)
>> >        at
>> > org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
>> >        at org.apache.wicket.Component.render(Component.java:2517)
>> >        at
>> > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
>> >        at
>> >
>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
>> >        at
>> >
>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
>> >        at
>> org.apache.wicket.Component.renderComponent(Component.java:2686)
>> >        at
>> > org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
>> >
>> > ...
>> >
>> > Caused by: java.lang.NullPointerException
>> >        at
>> >
>> org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:375)
>> >        at
>> org.apache.wicket.Component.renderComponent(Component.java:2686)
>> >        ... 45 more
>> >
>> > Can anybody tell me where goes wrong ? Thanks.
>> > Wicket 1.4.13
>> >
>>
>> -
>> 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: NPE when the underlaying model changed and ajax re-appear.

2010-11-11 Thread Igor Vaynberg
s/border.add(commentsView);/border.getbodycontainer().add(commentsView);/

On Thu, Nov 11, 2010 at 1:42 PM, smallufo  wrote:
> Hi , I have a simple panel , with a border and a listView :
>
> 
>  
>    
>      //comment layout
>    
>  
> 
>
> And the code :
>
> add(border);
> ListView commentsView = new ListView("commentsView" , new
> LoadableDetachableModel>()
> {
> �...@override
>  protected List load() {
>    return commentDao.getComments(0 , 10);
>  }
> })
> {
> �...@override
>  protected void populateItem(ListItem item) {
>    //comment layout
>  }
> };
> border.add(commentsView);
> commentsView.setReuseItems(false);
>
> The Panel has a border , with a clickable button , can be used to
> collapse/expand the content of the border with AJAX.
> Here is my steps :
>
> 1. I first collapse the panel .
> 2. Then open another browser panel , add a comment. (the underlaying data
> model is changed)
> 3. Back to the original panel , expand the panel ...
>
> And I got a NPE :
>
> 2010-11-12 05:19:12,661 ERROR wicket.RequestCycle - Exception in rendering
> component: [MarkupContainer [Component id = _body]]
> org.apache.wicket.WicketRuntimeException: Exception in rendering component:
> [MarkupContainer [Component id = _body]]
>        at org.apache.wicket.Component.renderComponent(Component.java:2725)
>        at
> org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
>        at org.apache.wicket.Component.render(Component.java:2517)
>        at
> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
>        at
> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
>        at
> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
>        at org.apache.wicket.Component.renderComponent(Component.java:2686)
>        at
> org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
>
> ...
>
> Caused by: java.lang.NullPointerException
>        at
> org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:375)
>        at org.apache.wicket.Component.renderComponent(Component.java:2686)
>        ... 45 more
>
> Can anybody tell me where goes wrong ? Thanks.
> Wicket 1.4.13
>

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



Re: How do I create bookmarkable link to somewhat dynamic content?

2010-11-11 Thread Igor Vaynberg
ahh, if its not a page use a shared resource. there are pages on the
wiki that explain how and this also:
http://stackoverflow.com/questions/1512510/wicket-dynamic-image-url

-igor

On Thu, Nov 11, 2010 at 10:13 AM, Sky  wrote:
>
> Bookmarkable page link with page parameters will give me a URL similar in
> structure to:
>>
>>
>> http://www.MyPublicLink.com/getFile?file=/1997/03/12/report52.xls&server=server25
>
> How do I construct a page to return a non-html page - but to return an
> unzipped inputStream that I obtained by contacting the backhiddenweb.com?
> I understand that any page.java should be associated with page.html. How do
> I return back an arbitrary extension? What kind of java class do I build and
> what "class" parameters do I give the bookmarkable page link?
>
> -Original Message- From: Igor Vaynberg
> Sent: Thursday, November 11, 2010 8:34 AM
> To: users@wicket.apache.org
> Subject: Re: How do I create bookmarkable link to somewhat dynamic content?
>
> bookmarkable page link with page parameters
>
> -igor
>
> On Thu, Nov 11, 2010 at 1:01 AM, Sky  wrote:
>>
>> My first post as a newbie to Wicket DL, so am ready for flames - if the
>> question is too silly or obvious.
>>
>> My website will expose bunch of files for end users search for and
>> selectively download.
>>
>> The backend webserver which is to be hidden from public will contain files
>> in following URL format:
>>
>> http://backendhiddenweb.com/year/month/day/name.of.file.extension.gz
>> example of backend files:
>> http://server25.backendhiddenweb.com/1997/03/12/report52.xls.gz
>> http://server51.backendhiddenweb.com/2003/05/15/report91.DOC.gz
>>
>> I want to convert these links such that
>>  A:) The user never knows the existence of backendhiddenweb.com domain -
>> but just knows my front end machine
>>  B:) I am able to dynamically un-gzip the files and serve them.
>>
>> Example of exposed URLs:
>> http://www.MyPublicLink.com/server25/1997/03/12/report52.xls
>> http://www.MyPublicLink.com/server51/2003/05/15/report91.DOC
>>
>> I could also settle for a url like:
>>
>> http://www.MyPublicLink.com/getFile?file=/1997/03/12/report52.xls&server=server25
>>
>> http://www.MyPublicLink.com/getFile?file=/2003/05/15/report91.DOC&server=server51
>>
>> The list of backend URLs is dynamically changing and I can determine them
>> at
>> runtime.
>>
>> Any help on how I could achieve this?
>>
>> Thx
>> - Akash
>>
>> -
>> 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



Re: How do I create bookmarkable link to somewhat dynamic content?

2010-11-11 Thread Igor Vaynberg
bookmarkable page link with page parameters

-igor

On Thu, Nov 11, 2010 at 1:01 AM, Sky  wrote:
> My first post as a newbie to Wicket DL, so am ready for flames - if the
> question is too silly or obvious.
>
> My website will expose bunch of files for end users search for and
> selectively download.
>
> The backend webserver which is to be hidden from public will contain files
> in following URL format:
>
> http://backendhiddenweb.com/year/month/day/name.of.file.extension.gz
> example of backend files:
> http://server25.backendhiddenweb.com/1997/03/12/report52.xls.gz
> http://server51.backendhiddenweb.com/2003/05/15/report91.DOC.gz
>
> I want to convert these links such that
>   A:) The user never knows the existence of backendhiddenweb.com domain -
> but just knows my front end machine
>   B:) I am able to dynamically un-gzip the files and serve them.
>
> Example of exposed URLs:
> http://www.MyPublicLink.com/server25/1997/03/12/report52.xls
> http://www.MyPublicLink.com/server51/2003/05/15/report91.DOC
>
> I could also settle for a url like:
> http://www.MyPublicLink.com/getFile?file=/1997/03/12/report52.xls&server=server25
> http://www.MyPublicLink.com/getFile?file=/2003/05/15/report91.DOC&server=server51
>
> The list of backend URLs is dynamically changing and I can determine them at
> runtime.
>
> Any help on how I could achieve this?
>
> Thx
> - Akash
>
> -
> 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: For objects out of session, work with directly or use loadable detachable model

2010-11-10 Thread Igor Vaynberg
even though they are in session it is still better to use a detachable
model. if you dont you may end up with the instance in session and in
your page diverging on back button because wicket clones the page with
the page being the root not the session so it wont handle the
reference properly. the rule of thumb is that unless the lifecycle is
managed by the page use a model.

-igor

On Wed, Nov 10, 2010 at 5:32 AM, Brown, Berlin [GCG-PFS]
 wrote:
> For objects that I get from session, I was trying to avoid accessing
> them in the constructor but I wanted to setup my default model so that
> they are pulled on the load method from a loadabledetachable model.
>
> Which approach do you use?  Here are the three approaches,
>
> (The code below is pseudo code, I am typing it out from memory).
>
> ** Scenario 1.  Add a call to the constructor.
>
> public class SomePage extends Page {
>
>   public SomePage() {
>      ...
>      ...
>      final bigSessObjBean = WicketSession.get().getSomeObjBean();  <---
> Access object from session in local constructor method scope.
>      final Form x  = new Form("form", new
> Model(bigSessObjBean)) { <--- Obj bean as default model
>           ...
>      }
>
>     or even...
>
>     final Form x  = new Form("form") {
>           ...
>          onSubmit()  {
>               bigSessObjBean.getData(); < Here, accessing bigSess
> Obj Bean
>          }
>      }
>
>   }
>
> }
>
>
> ** Scenario 2.  Use loadable detachable Model
>
> public class SomePage extends Page {
>
>   public SomePage() {
>      ...
>      ...
>
>     l = new LoadableDetachableModel() {
>        public Bean load() {
>            return WicketSession.get().getSessBeanObj();
>        }
>     };
>     final Form x  = new Form("form", l) {
>           ...
>          onSubmit()  {
>              getDefaultModel().getData(); < Here, accessing bigSess
> Obj Bean
>          }
>      }
>
>   }
>
> }
>
> ** Scenario 3: Call the session get when you need it.
>
>  final Form x  = new Form("form", l) {
>           ...
>          onSubmit()  {
>            WicketSession.get().getSessBeanObj();.getData(); < Here,
> accessing bigSess Obj Bean
>          }
>      }
>
> Berlin Brown (POL)
>

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



Re: Free wicket from component hierarchy hell

2010-11-10 Thread Igor Vaynberg
you guys are both making an argument against queuing, and against
each-other. paradox.

-igor

On Wed, Nov 10, 2010 at 5:08 AM, Carl-Eric Menzel  wrote:
> On Wed, 10 Nov 2010 07:31:28 -0500
> James Carman  wrote:
>
>> On Wed, Nov 10, 2010 at 3:49 AM, Carl-Eric Menzel
>>  wrote:
>> >
>> > So either there is a difference between the forms (different submit
>> > method maybe?), then this move would make a semantic/behavioral
>> > difference and needs to be done in code.
>> >
>>
>> As I said, the two forms edit different values on the same object.
>> Yes, this change would be a semantic/behavioral change, but you could
>> actually do it with just a change in the markup.  It wouldn't require
>> a change to the code.  This is assuming you queue the fields onto the
>> containing panel and not onto the contained forms, which is entirely
>> possible (and even likely).  How many times have you accidentally
>> called add() when you meant to call rowItem.add() in a repeater?  With
>> the queue() method, you wouldn't get an error message saying the
>> markup doesn't match.  It would just figure it out and you'd be none
>> the wiser.
>
> That's exactly my point :-)
>
> This is not a good example to allow queuing, because there's no gain.
> Either there is an important difference between the two forms, then it
> doesn't make sense to queue *above* the forms, or there is no
> difference between the forms, then you can just have *one* form and not
> need queue at all.
>
> By "needs to be done in code" I mean that it is not something that
> should be doable in markup.
>
> Carl-Eric
> www.wicketbuch.de
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-10 Thread Igor Vaynberg
On Wed, Nov 10, 2010 at 1:05 AM, Carl-Eric Menzel  wrote:
> On Tue, 9 Nov 2010 12:16:00 -0800
> Igor Vaynberg  wrote:
>
>> the difficult part is that doing this to complex pages is...difficult.
>> in the example above it is easy to see the two components that need to
>> be renested. but, in complex pages there can be 20 components that
>> need to be renested, and they are probably initially added from a
>> bunch of helper methods that attempted to keep the code clean. so, it
>> may be difficult to find all 20 componets. queuing can make
>> maintenance and refactoring of pages easier.
>
> I can see how it might make it somewhat easier, but it seems to me that
> one is treading on rather thin ice.

well. the thin ice part of the argument remains to be proven. when can
it cause problems? how about some practical examples?

> And speaking of these helper methods: Maybe it's my increasingly
> functional style coming from some exposure to Scala, but I really hate
> it when these methods add stuff behind my back to anything else than
> the component they're returning.

you are explicitly telling it to add things behind your back. the
queue() method does not replace the add(), its an addition. it
operates on a container, so it returns the container back - that makes
sense.

>> yes, ive had to do it plenty times. ive had to go into pages that were
>> already written and ajaxify them. sometimes a table needs to be
>> updated via ajax, it needs to be wrapped in a container. other times a
>> set of related form fields needs to be updated, its easier to wrap
>> them in a container and update it rather then having to add them one
>> by one from multiple places.
>
> But wouldn't such a page be a prime candidate for a proper refactoring
> anyway? I'm getting a "quick & dirty" feeling.

not at all. adding three or four ajax-zones into an existing page does
not warrant a refactor, nor would there be anything to refactor. there
was no need for these things before, they are there purely to
facilitate the new requirement of making something ajaxy.

-igor

>
>> > IMHO valid use cases have not been provided yet.
>>
>> we can agree to disagree
>
> Certainly, especially since you do make some valid arguments.
>
> Carl-Eric
> www.wicketbuch.de
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-10 Thread Igor Vaynberg
i can only hazard a guess, but if i did it would be that "it was the
simplest and cleanest solution that made sense". that is always a good
starting point.

-igor

On Wed, Nov 10, 2010 at 6:19 AM, Frank Silbermann
 wrote:
> What were the reasons for requiring the hierarchies to match in the
> original design of Wicket?
>
> -
> 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: RestartResponseAtInterceptPageException issue

2010-11-09 Thread Igor Vaynberg
On Tue, Nov 9, 2010 at 4:07 PM, Henrique  wrote:
> Hello, I'll try to make this simple.
> User fills in some data, clicks submit to persist it but since he has
> to login first, he is redirected to a login page (via throw new
> RestartResponseAtInterceptPageException(Login.class); ).
> He logs in and is redirected back to the original page (via
> continueToOriginalDestination() )
>
> Now that he is back in the original page, even though the data he
> entered into the form's components (textfields) are still there, the
> onSubmit() method on this form does not respond, so the data cannot be
> saved into the database.
>
> Here is the onSubmit() method in the original page:
>        public void onSubmit() {
>
>                Item item = (Item)getModelObject();
>
>                if(!UserLoggedInSession.get().isLoggedIn()) {
>                        throw new 
> RestartResponseAtInterceptPageException(Login.class);
>                }
>
>                // UNREACHABLE CODE WHEN THE USER COMES BACK FROM THE LOGIN 
> PAGE!!!
>                User user = UserLoggedInSession.get().getUser();
>                item.setUser(user);
>                ItemDAO.persist(item);
>                setResponsePage(UserHomePage.class);
>        }
>
> Any help is appreciated.

restart response at intercept exception does not support forms because
it only keeps the url of the page not form values. form values are
showing up because the browser remembers them, probably wont be the
case for every browser. you lucked out.

as for the actual problem i am afraid you are going to have to debug
the code and see why it never reaches onsubmit.

> btw, if someone replies to this, how do I answer back? (i am viewing
> this mailing list through mark mail)

same way you posted this message...

-igor
>
> Thanks.
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
nah. you go ahead. the AutoComponentSource sounds vary vague, you will
need to elaborate it.

-igor

On Tue, Nov 9, 2010 at 12:58 PM, James Carman
 wrote:
> on dev list?  You wanna start it?
>
> On Tue, Nov 9, 2010 at 3:57 PM, Igor Vaynberg  wrote:
>> can we fork this into another thread?
>>
>> -igor
>>
>> On Tue, Nov 9, 2010 at 12:46 PM, James Carman
>>  wrote:
>>> Could we introduce the concept of an AutoComponentSource or something,
>>> perhaps?  A page/component could potentially have multiple?
>>>
>>> On Tue, Nov 9, 2010 at 3:43 PM, Sven Meier  wrote:
>>>> +1 on rethinking the auto* stuff together with the proposed queueing.
>>>>
>>>> Sven
>>>>
>>>> Am 09.11.2010 um 21:17 schrieb Igor Vaynberg:
>>>>
>>>>> i wonder if queuing can actually replace icomponentresolver and
>>>>> auto-adding. i wonder if after onbeforerender we can do what unqueing
>>>>> does now, parse the markup, find any missing components, and insert
>>>>> them. autocomponents and autoadd() is something ive always disliked
>>>>> because it doesnt work for anything that needs to stick around across
>>>>> requests.
>>>>>
>>>>> -igor
>>>>>
>>>>>
>>>>> On Tue, Nov 9, 2010 at 11:10 AM, Johan Compagner  
>>>>> wrote:
>>>>>> and that is only because i cant do
>>>>>>
>>>>>> component.setAuto(false)
>>>>>>
>>>>>> right after i call autoAdd()
>>>>>>
>>>>>> else it would just stay there :)
>>>>>>
>>>>>> and this is then only done to resolve it once with the first render...
>>>>>>
>>>>>>
>>>>>> On Tue, Nov 9, 2010 at 20:03, Igor Vaynberg  
>>>>>> wrote:
>>>>>>> it still wont work for a lot of usecases that require proper
>>>>>>> hierarchy. like a form trying to find form submitting component, etc
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Tue, Nov 9, 2010 at 10:59 AM, Johan Compagner  
>>>>>>> wrote:
>>>>>>>> ok a sample that it also works in with the right parent:
>>>>>>>>
>>>>>>>> public class HelloWorld extends WebPage implements IComponentResolver {
>>>>>>>>
>>>>>>>>        final Label label;
>>>>>>>>        public HelloWorld()
>>>>>>>>        {
>>>>>>>>                label = new Label("label", new Model()
>>>>>>>>                                {
>>>>>>>>                                       �...@override
>>>>>>>>                                        public String getObject() {
>>>>>>>>                                                return "my label: "  + 
>>>>>>>> label.isEnabledInHierarchy();
>>>>>>>>                                        }
>>>>>>>>                                });
>>>>>>>>                add(new WebMarkupContainer("body").setEnabled(false));
>>>>>>>>                add(label);
>>>>>>>>        }
>>>>>>>>
>>>>>>>>        public boolean resolve(MarkupContainer container,
>>>>>>>>                        MarkupStream markupStream, ComponentTag tag) {
>>>>>>>>
>>>>>>>>                Component component = get(tag.getId());
>>>>>>>>                if (component != null)
>>>>>>>>                {
>>>>>>>>                        container.autoAdd(component, markupStream);
>>>>>>>>                        return true;
>>>>>>>>                }
>>>>>>>>                return false;
>>>>>>>>        }
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> you will see that it is disabled...
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Nov 9, 2010 at 19:37, Johan Compagner  
>>>>>>>> wrote:
>>>>>>&g

Re: Updating model object on AjaxFallbackDefaultDataTable page change

2010-11-09 Thread Igor Vaynberg
see my last suggestion and replace navigator's links with submitlinks

-igor

On Tue, Nov 9, 2010 at 1:02 PM, Matt Schmidt  wrote:
> Yes that works for the first page - only on that page are the javascript
> behaviors rendered.
>
> Basically, we are looking for a way to NOT do an ajax request every time we
> check a box - The model object of the check group should be updated when we
>
> a) click the submit button or
> b) change the page of the datatable.
>
> What are we missing here?
>
> On Tue, Nov 9, 2010 at 3:32 PM, Igor Vaynberg wrote:
>
>> use AjaxFormChoiceComponentUpdatingBehavior, that one works with Check.
>>
>> also you can use CheckBox with the ajax behavior instead of
>> CheckGroup/Check
>>
>> or replace links used by navigator with submit links, there are
>> factory methods on the navigator.
>>
>> -igor
>>
>> On Tue, Nov 9, 2010 at 8:41 AM, Matt Schmidt  wrote:
>> > I have a CheckGroup that contains an AjaxFallbackDefaultDataTable that
>> has a
>> > column containing a Check. As long as I click my submit button while on
>> the
>> > first page of the DataTable, the model object of the CheckGroup is
>> updated
>> > as expected with the items I had checked. However, if I check some
>> > checkboxes and then go to page 2 of the DataTable, the CheckGroup's model
>> > object is not updated and I lose everything I checked on page 1.
>> >
>> > The DataTable class has an "onPageChanged()" event, but it appears that
>> it
>> > is called after the page is actually changed.
>> >
>> > My other thought was to add an AjaxFormComponentUpdatingBehavior to the
>> > Check, but Check is not a FormComponent.
>> >
>> > Any thoughts?
>> >
>> > Thanks,
>> > Matt
>> >
>>
>> -
>> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
can we fork this into another thread?

-igor

On Tue, Nov 9, 2010 at 12:46 PM, James Carman
 wrote:
> Could we introduce the concept of an AutoComponentSource or something,
> perhaps?  A page/component could potentially have multiple?
>
> On Tue, Nov 9, 2010 at 3:43 PM, Sven Meier  wrote:
>> +1 on rethinking the auto* stuff together with the proposed queueing.
>>
>> Sven
>>
>> Am 09.11.2010 um 21:17 schrieb Igor Vaynberg:
>>
>>> i wonder if queuing can actually replace icomponentresolver and
>>> auto-adding. i wonder if after onbeforerender we can do what unqueing
>>> does now, parse the markup, find any missing components, and insert
>>> them. autocomponents and autoadd() is something ive always disliked
>>> because it doesnt work for anything that needs to stick around across
>>> requests.
>>>
>>> -igor
>>>
>>>
>>> On Tue, Nov 9, 2010 at 11:10 AM, Johan Compagner  
>>> wrote:
>>>> and that is only because i cant do
>>>>
>>>> component.setAuto(false)
>>>>
>>>> right after i call autoAdd()
>>>>
>>>> else it would just stay there :)
>>>>
>>>> and this is then only done to resolve it once with the first render...
>>>>
>>>>
>>>> On Tue, Nov 9, 2010 at 20:03, Igor Vaynberg  
>>>> wrote:
>>>>> it still wont work for a lot of usecases that require proper
>>>>> hierarchy. like a form trying to find form submitting component, etc
>>>>>
>>>>> -igor
>>>>>
>>>>> On Tue, Nov 9, 2010 at 10:59 AM, Johan Compagner  
>>>>> wrote:
>>>>>> ok a sample that it also works in with the right parent:
>>>>>>
>>>>>> public class HelloWorld extends WebPage implements IComponentResolver {
>>>>>>
>>>>>>        final Label label;
>>>>>>        public HelloWorld()
>>>>>>        {
>>>>>>                label = new Label("label", new Model()
>>>>>>                                {
>>>>>>                                       �...@override
>>>>>>                                        public String getObject() {
>>>>>>                                                return "my label: "  + 
>>>>>> label.isEnabledInHierarchy();
>>>>>>                                        }
>>>>>>                                });
>>>>>>                add(new WebMarkupContainer("body").setEnabled(false));
>>>>>>                add(label);
>>>>>>        }
>>>>>>
>>>>>>        public boolean resolve(MarkupContainer container,
>>>>>>                        MarkupStream markupStream, ComponentTag tag) {
>>>>>>
>>>>>>                Component component = get(tag.getId());
>>>>>>                if (component != null)
>>>>>>                {
>>>>>>                        container.autoAdd(component, markupStream);
>>>>>>                        return true;
>>>>>>                }
>>>>>>                return false;
>>>>>>        }
>>>>>> }
>>>>>>
>>>>>>
>>>>>> you will see that it is disabled...
>>>>>>
>>>>>>
>>>>>> On Tue, Nov 9, 2010 at 19:37, Johan Compagner  
>>>>>> wrote:
>>>>>>> textfield.isEnabledInHierachy() will then ofcourse not get to the
>>>>>>> parent it is on.
>>>>>>> because its parent is the webpage not the body markupcontainer.
>>>>>>>
>>>>>>> So no this will not resolver from the child to the parent, only the
>>>>>>> parent to the child.
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Nov 9, 2010 at 19:30, Martin Makundi
>>>>>>>  wrote:
>>>>>>>> How will it work if I call get("body").setEnabled(false); and if label
>>>>>>>> was a textfield? Would the textfield be still enabled?
>>>>>>>>
>>>>>>>> **
>>>>>>>> Martin
>>>>>>>>
>>>>>>>> 

Re: Updating model object on AjaxFallbackDefaultDataTable page change

2010-11-09 Thread Igor Vaynberg
use AjaxFormChoiceComponentUpdatingBehavior, that one works with Check.

also you can use CheckBox with the ajax behavior instead of CheckGroup/Check

or replace links used by navigator with submit links, there are
factory methods on the navigator.

-igor

On Tue, Nov 9, 2010 at 8:41 AM, Matt Schmidt  wrote:
> I have a CheckGroup that contains an AjaxFallbackDefaultDataTable that has a
> column containing a Check. As long as I click my submit button while on the
> first page of the DataTable, the model object of the CheckGroup is updated
> as expected with the items I had checked. However, if I check some
> checkboxes and then go to page 2 of the DataTable, the CheckGroup's model
> object is not updated and I lose everything I checked on page 1.
>
> The DataTable class has an "onPageChanged()" event, but it appears that it
> is called after the page is actually changed.
>
> My other thought was to add an AjaxFormComponentUpdatingBehavior to the
> Check, but Check is not a FormComponent.
>
> Any thoughts?
>
> Thanks,
> Matt
>

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



Re: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
wtf is with all the stupid and, more importantly, broken analogies? if
you wouldve kept quiet instead of spouting all this garbage i bet a
lot more people wouldve been receptive to the idea. you are digging
your own hole. id like to think we are all practical people, so stick
to practical points. you want to help yourself? fork my branch, modify
the readme to add more examples that illustrate your pain, and create
a pull request so i can merge it in.

-igor

On Tue, Nov 9, 2010 at 1:01 AM, Martin Makundi
 wrote:
> Hi!
>
>> Coding friction? Yes. Every time I need to look at somebody else's code
>> and try to figure out what exactly they did.
>
> Ah.. so you are trying to solve your problem probably from the wrong
> end? If you have bad warriors give them plastic swords so they can
> hurt nobody? Training, Coding dojos, Code Reviews, Coding Policies,
> Dream teams, ...
>
>> Please consider the needy ones that would have to deal with this and
>> would have to support people who made the mistake of using it :-)
>
> I don't think there is a substitute for coding skills/talent ;)))
>
>>> It's just the itchy feeling you get all day long when coding "in the
>>> zone". "This unneccessary fuzz is in my way".
>>
>> If you only write code and never read or need to fix it.
>
> I understand if you are a consultant it gives you plenty of billable
> to code again and again. But my sweetspot is product development and I
> need to make flexibly reusable components and unfortunately requiring
> html hierarchy to match on different pages makes really messy code on
> java side if I try to implement free-from-iherarchy in a manual way (I
> must provide various different parent containers to a generic
> component so that it can land in the right place).
>
>> Well that certainly applies the other way around too. It's not for
>> everybody, so please don't introduce a new source of bugs into *this*
>> toolkit. Also, unless I missed a message (which is possible), so far we
>> seem to have a needy *one*, not *ones*.
>
> Still, I don't think there is a substitute for coding skills/talent ;)))
>
> **
> Martin
>
>>
>> Carl-Eric
>> www.wicketbuch.de
>>
>> -
>> 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



Re: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
i wonder if queuing can actually replace icomponentresolver and
auto-adding. i wonder if after onbeforerender we can do what unqueing
does now, parse the markup, find any missing components, and insert
them. autocomponents and autoadd() is something ive always disliked
because it doesnt work for anything that needs to stick around across
requests.

-igor


On Tue, Nov 9, 2010 at 11:10 AM, Johan Compagner  wrote:
> and that is only because i cant do
>
> component.setAuto(false)
>
> right after i call autoAdd()
>
> else it would just stay there :)
>
> and this is then only done to resolve it once with the first render...
>
>
> On Tue, Nov 9, 2010 at 20:03, Igor Vaynberg  wrote:
>> it still wont work for a lot of usecases that require proper
>> hierarchy. like a form trying to find form submitting component, etc
>>
>> -igor
>>
>> On Tue, Nov 9, 2010 at 10:59 AM, Johan Compagner  
>> wrote:
>>> ok a sample that it also works in with the right parent:
>>>
>>> public class HelloWorld extends WebPage implements IComponentResolver {
>>>
>>>        final Label label;
>>>        public HelloWorld()
>>>        {
>>>                label = new Label("label", new Model()
>>>                                {
>>>                                       �...@override
>>>                                        public String getObject() {
>>>                                                return "my label: "  + 
>>> label.isEnabledInHierarchy();
>>>                                        }
>>>                                });
>>>                add(new WebMarkupContainer("body").setEnabled(false));
>>>                add(label);
>>>        }
>>>
>>>        public boolean resolve(MarkupContainer container,
>>>                        MarkupStream markupStream, ComponentTag tag) {
>>>
>>>                Component component = get(tag.getId());
>>>                if (component != null)
>>>                {
>>>                        container.autoAdd(component, markupStream);
>>>                        return true;
>>>                }
>>>                return false;
>>>        }
>>> }
>>>
>>>
>>> you will see that it is disabled...
>>>
>>>
>>> On Tue, Nov 9, 2010 at 19:37, Johan Compagner  wrote:
>>>> textfield.isEnabledInHierachy() will then ofcourse not get to the
>>>> parent it is on.
>>>> because its parent is the webpage not the body markupcontainer.
>>>>
>>>> So no this will not resolver from the child to the parent, only the
>>>> parent to the child.
>>>>
>>>>
>>>> On Tue, Nov 9, 2010 at 19:30, Martin Makundi
>>>>  wrote:
>>>>> How will it work if I call get("body").setEnabled(false); and if label
>>>>> was a textfield? Would the textfield be still enabled?
>>>>>
>>>>> **
>>>>> Martin
>>>>>
>>>>> 2010/11/9 Johan Compagner :
>>>>>> no ofcourse not
>>>>>> The label will then be gone because the body is gone.
>>>>>> so the output will be this
>>>>>> 
>>>>>> 
>>>>>>
>>>>>> when the body container is not visible
>>>>>>
>>>>>> if the label is not visible:
>>>>>>
>>>>>> 
>>>>>> 
>>>>>>
>>>>>> 
>>>>>> 
>>>>>>
>>>>>> this solution you just can throw everything in the panel or webpage
>>>>>> that is the IComponentResolver for all its childs...
>>>>>> Just look at how the code works..
>>>>>> IF a component can't be found on its own parent the ComponentResolver
>>>>>> will ask all the parents which can be IComponentResolver to render the
>>>>>> child..
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Nov 9, 2010 at 19:04, Martin Makundi
>>>>>>  wrote:
>>>>>>> This does not really nest the components logically, does it?
>>>>>>>
>>>>>>> If you set get("body").setVisible(false) will the label remain visible?
>>>>>>>
>>>>>>> **
>>>>>>> Martin
>>>>>>>

Re: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
On Tue, Nov 9, 2010 at 12:03 PM, Sven Meier  wrote:
> Hi,
>
>> an easy example is:
>>
>>  > wicket:id="last"/>
>>
>> now the designer wants tds to have a css class based on some
>> condition. you now have to add a webmarkupcontainer to represent the
>> td and renest first and last labels into it. the container is there
>> purely for the design aspect.
>
> I have to change some Java code anyway, so why should I queue anything rather 
> than add() the components into the correct hierarchy right away?

the difficult part is that doing this to complex pages is...difficult.
in the example above it is easy to see the two components that need to
be renested. but, in complex pages there can be 20 components that
need to be renested, and they are probably initially added from a
bunch of helper methods that attempted to keep the code clean. so, it
may be difficult to find all 20 componets. queuing can make
maintenance and refactoring of pages easier.

>
>> another usecase is introducing an arbitrary webmarkupcontainer just to
>> have a div to repaint via ajax. it is hard to do this when refactoring
>> a complex page because you have to find all the components that now
>> need to be re-nested into the new container.
>
> Is this a common example? Did anyone ever have to "just repaint a div via 
> ajax" without having to change much more Java code? What's complex about this 
> page thus it's difficult to re-parent some of its components?

yes, ive had to do it plenty times. ive had to go into pages that were
already written and ajaxify them. sometimes a table needs to be
updated via ajax, it needs to be wrapped in a container. other times a
set of related form fields needs to be updated, its easier to wrap
them in a container and update it rather then having to add them one
by one from multiple places.

> IMHO valid use cases have not been provided yet.

we can agree to disagree

-igor

>
> My 2 cents
>
> Sven
> -
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
On Tue, Nov 9, 2010 at 12:20 AM, Martin Makundi
 wrote:
>> I frankly don't see any way to have this "auto-hierarchy" stuff
>> without getting lots of unnecessary ambiguity and sources of bugs. I
>> totally agree with what Eelco wrote below, and what someone else said
>> about the Python way of having only *one* way to do *one* thing.
>
> Would you be happy if there was an application level configuration switch:
>
>      getMarkupSettings().setAllowComponentAutoHierarchy(true);

like i said, there will be no such switch if this feature moves forward.

-igor

>
> Which is default false?
>
> This way you can make sure nobody in YOUR project messes things up?
>
> **
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
it still wont work for a lot of usecases that require proper
hierarchy. like a form trying to find form submitting component, etc

-igor

On Tue, Nov 9, 2010 at 10:59 AM, Johan Compagner  wrote:
> ok a sample that it also works in with the right parent:
>
> public class HelloWorld extends WebPage implements IComponentResolver {
>
>        final Label label;
>        public HelloWorld()
>        {
>                label = new Label("label", new Model()
>                                {
>                                       �...@override
>                                        public String getObject() {
>                                                return "my label: "  + 
> label.isEnabledInHierarchy();
>                                        }
>                                });
>                add(new WebMarkupContainer("body").setEnabled(false));
>                add(label);
>        }
>
>        public boolean resolve(MarkupContainer container,
>                        MarkupStream markupStream, ComponentTag tag) {
>
>                Component component = get(tag.getId());
>                if (component != null)
>                {
>                        container.autoAdd(component, markupStream);
>                        return true;
>                }
>                return false;
>        }
> }
>
>
> you will see that it is disabled...
>
>
> On Tue, Nov 9, 2010 at 19:37, Johan Compagner  wrote:
>> textfield.isEnabledInHierachy() will then ofcourse not get to the
>> parent it is on.
>> because its parent is the webpage not the body markupcontainer.
>>
>> So no this will not resolver from the child to the parent, only the
>> parent to the child.
>>
>>
>> On Tue, Nov 9, 2010 at 19:30, Martin Makundi
>>  wrote:
>>> How will it work if I call get("body").setEnabled(false); and if label
>>> was a textfield? Would the textfield be still enabled?
>>>
>>> **
>>> Martin
>>>
>>> 2010/11/9 Johan Compagner :
 no ofcourse not
 The label will then be gone because the body is gone.
 so the output will be this
 
 

 when the body container is not visible

 if the label is not visible:

 
 

 
 

 this solution you just can throw everything in the panel or webpage
 that is the IComponentResolver for all its childs...
 Just look at how the code works..
 IF a component can't be found on its own parent the ComponentResolver
 will ask all the parents which can be IComponentResolver to render the
 child..



 On Tue, Nov 9, 2010 at 19:04, Martin Makundi
  wrote:
> This does not really nest the components logically, does it?
>
> If you set get("body").setVisible(false) will the label remain visible?
>
> **
> Martin
>
> 2010/11/9 Johan Compagner :
>> Why are we discussing here already that works in wicket 1.4 if you
>> really need it?
>>
>>
>> public class HelloWorld extends WebPage implements IComponentResolver {
>>
>>        public HelloWorld()
>>        {
>>                add(new WebMarkupContainer("body"));
>>                add(new Label("label","my label"));
>>        }
>>
>>        public boolean resolve(MarkupContainer container,
>>                        MarkupStream markupStream, ComponentTag tag) {
>>
>>                Component component = get(tag.getId());
>>                if (component != null)
>>                {
>>                        component.render(markupStream);
>>                        return true;
>>                }
>>                return false;
>>        }
>> }
>>
>> 
>> 
>> 
>> 
>> 
>>
>>
>>
>> On Tue, Nov 9, 2010 at 16:29, Frank Silbermann
>>  wrote:
>>> Progress is made by people who have understanding, not by the ignorant.
>>> You're not in a position to make suggestions about extending Wicket if
>>> you don't yet understand how to use the powers it already has.
>>>
>>> -Original Message-
>>> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>>> Sent: Tuesday, November 09, 2010 9:23 AM
>>> To: users@wicket.apache.org
>>> Subject: Re: Free wicket from component hierarchy hell
>>>
 So instead of asking, "How can we make Wicket different so that my
 problem will go away?" the proper question to try first is, "What is
>>> the
 Wicket way of solving my problem?"
>>>
>>> That's not how proggress is made...
>>>
>>> **
>>> 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-un

Re: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
On Tue, Nov 9, 2010 at 9:38 AM, Martin Makundi
 wrote:
>> The user can queue stuff to the wrong component unknowingly because
>> they won't get an exception.
>
> You will get an exception if you queue explicitly to the wrong
> component. If you don't care about the parent component, it 's their
> choie (good or bad) ;)
>
>> Then later a markup change could completely change what's
>> going on behind the scenes, not just the look.
>
> If in doubt, there is always
> getMarkupSettings().setAllowComponentAutoHierarchy(false);

there will be no such method.

-igor

>
> **
> 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
>
>

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



Re: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
the queue() method is there in addition to add(), so you dont have to
use it. yes, it is riskier to use under some circumstances because it
is more forgiving then add() - but thats the point i think.

-igor

On Tue, Nov 9, 2010 at 9:41 AM, James Carman  wrote:
> On Tue, Nov 9, 2010 at 12:38 PM, Martin Makundi
>  wrote:
>>
>> You will get an exception if you queue explicitly to the wrong
>> component. If you don't care about the parent component, it 's their
>> choie (good or bad) ;)
>>
>
> You're not understanding what I'm saying.  I'm saying they're not
> consciously making a *choice*; they're queueing the component to the
> wrong parent on accident, but they aren't getting an exception.  This
> can lead to problems later on.
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
yes, and that would of course be a mistake. if you just queue
everything into the page you can cause serious security problems.

sometimes you have a "hard" container you want your components to live
under, and other times you dont care. you should always queue into the
hard container, just like you add to something under it now.

-igor

On Tue, Nov 9, 2010 at 8:57 AM, James Carman  wrote:
> On Tue, Nov 9, 2010 at 11:55 AM, Igor Vaynberg  
> wrote:
>> um. no. queued components cannot be moved out of their parent. so if
>> you queued field1 under form1 and the designer moves the tag tied to
>> field1 outside the tag tied to form1 you will get the same error you
>> would get now.
>>
>
> I'm not saying that.  I'm saying that if you queue the fields into the
> parent of form1 and form2, then you are free to move them between the
> forms solely in the markup.
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
ive outlined a couple of usecases when this is useful in another
email. see there.

-igor

On Tue, Nov 9, 2010 at 8:56 AM, James Carman  wrote:
> On Tue, Nov 9, 2010 at 11:55 AM, Martin Makundi
>  wrote:
>> For security reasons in general, you might want to use:
>>
>> formA.queue(formAstuff);
>> formB.queue(formBstuff);
>>
>
> But then you're right back where you started.  Why not just "add" and
> not "queue"?
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
um. no. queued components cannot be moved out of their parent. so if
you queued field1 under form1 and the designer moves the tag tied to
field1 outside the tag tied to form1 you will get the same error you
would get now.

-igor

On Tue, Nov 9, 2010 at 8:50 AM, James Carman  wrote:
> On Tue, Nov 9, 2010 at 11:48 AM, Igor Vaynberg  
> wrote:
>> so queue each formcomponet under the form they belong to. that way
>> they cannot be moved outside the form.
>>
>
> That's what happens in "code" not markup.  You could potentially
> change what gets edited by the form merely by moving fields around in
> the markup.
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
On Tue, Nov 9, 2010 at 8:10 AM, Carl-Eric Menzel  wrote:
> On Tue, 9 Nov 2010 10:51:49 -0500
> James Carman  wrote:
>
>> On Tue, Nov 9, 2010 at 10:48 AM, Frank Silbermann
>>  wrote:
>> > If the component hierarchy can be changed without changing behavior
>> > or semantics, then why are the components in a hierarchy to begin
>> > with? Why aren't all the components being moved around already
>> > siblings at the same level?  Does Wicket require that the order of
>> > sibling Wicket components match the order at which simply HTML
>> > elements appear?
>> >
>>
>> You could do that, but I think Martin is trying to take it a step
>> further allowing you to have an arbitrary hierarchy in your markup and
>> just figure it out at runtime.  Wicket doesn't care what order you add
>> stuff to the page/component as long as they're all on the same level
>> within the hierarchy.
>
> I think you misunderstood Frank's point. Why are the components in a
> hierarchy in the first place, if the hierarchy can be changed without
> changing behavior or semantics? They can simply be flat in the parent
> then.

sadly there are valid usecases for having the hierarchy purely for
design purposes. an easy example is:

 

now the designer wants tds to have a css class based on some
condition. you now have to add a webmarkupcontainer to represent the
td and renest first and last labels into it. the container is there
purely for the design aspect.

with queuing you can queue first and last under the repeater item.
when you need to add css to td you simply queue the webmarkupcontainer
under the repeater item as well and wicket will properly nest the
labels in it for you.

another usecase is introducing an arbitrary webmarkupcontainer just to
have a div to repaint via ajax. it is hard to do this when refactoring
a complex page because you have to find all the components that now
need to be re-nested into the new container.

hopefully queuing can eliminate some of this noise and make it easier.

-igor

>
> Carl-Eric
> www.wicketbuch.de
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
On Tue, Nov 9, 2010 at 7:36 AM, John Owen  wrote:
> "Do we really think this is that big of a problem that we need to change the 
> whole paradigm of the framework to address it?"

it will not be changing the paradigm. it is adding a new method for
you to add components. use it if you want, dont use it if you dont.

-igor

>
> IMO, No.
>
> -Original Message-
> From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On 
> Behalf Of James Carman
> Sent: Tuesday, November 09, 2010 9:06 AM
> To: users@wicket.apache.org
> Subject: Re: Free wicket from component hierarchy hell
>
> I think we need to try to put our heads together on this one.  I don't
> necessarily think this approach is the best, but I haven't really had
> a chance to wrap my head around it yet, frankly.  Do we really think
> this is that big of a problem that we need to change the whole
> paradigm of the framework to address it?  Perhaps you can create a new
> "container" component that does all of this stuff with some pre-render
> magic or something?  If you want to use it, you can.  If not, you
> don't have to.  So, if you're the type that likes this loosey goosey
> stuff, you basically "wrap" your pages with one of these things to
> enable this type of behavior.  I don't know.  This is just off the top
> of my head.  Still not done with my morning coffee.
>
> On Tue, Nov 9, 2010 at 9:58 AM, Martin Grigorov  wrote:
>> I think we have to make a vote whether this feature has to be investigated
>> further.
>> There are over 90 mails in the thread and I have the feeling that only
>> Martin Makundi likes the idea.
>>
>> On Tue, Nov 9, 2010 at 3:46 PM, Frank Silbermann >> wrote:
>>
>>> Well then, why don't you have your base panel provide methods that
>>> generate the individual components, with methods that implement
>>> composite behaviors involving groups of components.
>>>
>>> Your constructor can call the component-creation methods to assemble the
>>> component hierarchy to match the HTML.
>>>
>>> Then, when you want a panel with a different hierarchy you subclass the
>>> panel, override the constructor to create the 2nd component hierarchy,
>>> and provide the new panel its own HTML page.
>>>
>>> If you don't like overriding the constructor along with the HTML, then
>>> you can build some sort of configurable constructor-constructor.
>>>
>>> /Frank
>>>
>>> -Original Message-
>>> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>>> Sent: Tuesday, November 09, 2010 6:55 AM
>>> To: users@wicket.apache.org
>>> Subject: Re: Free wicket from component hierarchy hell
>>>
>>> Hi!
>>>
>>> > Isn't this exactly the reason we've got CSS?
>>>
>>> It's just the buzz, not the reality. Unfortunately often CSS "doesn't
>>> quite cut it:
>>> * http://blog.iconara.net/2007/09/21/the-failure-of-css/
>>>
>>> > HTML shouldn't really be used for look&feel and the size and placement
>>> of
>>> > components can perfectly be defined using CSS classes.
>>>
>>> In CSS the actual nesting of components plays a big role (div inside
>>> float inside abs top 0px ul relative etc.).
>>>
>>> If you want a professional finish, you will often need to pull
>>> components around the layers for different display. Even trying to
>>> pull one component will break wicket in strict hierarchy mode.
>>>
>>> **
>>> Martin
>>>
>>> >
>>> > Matt
>>> >
>>> > On 2010-11-09 13:34, Martin Makundi wrote:
>>> >>
>>> >> Also making skins for different devices / screen sizes becomes
>>> easier.
>>> >>
>>> >> **
>>> >> Martin
>>> >>
>>> >> 2010/11/9 Vitaly Tsaplin:
>>> 
>>>  In simple cases it makes no difference. It makes real difference
>>> with
>>>  some complex widgets (for example search components) that must be
>>>  reused on many pages and they should render differently on each
>>> page
>>>  depending on how much space and what context they are in. I don't
>>> like
>>>  duplicating code even if it is gui code.
>>> >>>
>>> >>> Sounds like the first appealing argument slowly comming out of
>>> >>> surrounding fuzz =)
>>> >
>>> >
>>> >
>>>
>>> -
>>> 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
>
>

-

Re: Free wicket from component hierarchy hell

2010-11-09 Thread Igor Vaynberg
so queue each formcomponet under the form they belong to. that way
they cannot be moved outside the form.

-igor

On Tue, Nov 9, 2010 at 8:46 AM, James Carman  wrote:
> On Tue, Nov 9, 2010 at 11:40 AM, Martin Makundi
>  wrote:
>>
>> Yeah ids must be unique per each level and ofcourse if you have markup like:
>>
>> 
>>
>> If you have code like:
>> panel {
>>  queue(a("a"));
>>  a.queue(a("a"));
>> }
>>
>
> This could be a problem.  Say you do have two forms on the same page.
> One form edits a Person and the other edits a Department.  Each of
> which have a "name" field (with id "name") which are queued/auto-added
> so that the Department's name field is queued before the Person's name
> field.  To begin with, in the markup, the Department form comes before
> the Person form.  Now, what if the "designer" switches the order of
> the markup and puts the Person form before the Department form?  Then,
> the wrong name field will be added to the wrong form.  Am I
> understanding this correctly?
>
> -
> 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: Configuration of AbstractCalendar

2010-11-09 Thread Igor Vaynberg
the value should be available in the formcomponent's model the
datepicker is attached to.

-igor


On Tue, Nov 9, 2010 at 2:27 AM, Jan Ferko  wrote:
> Thanks,
>
> I figured it out. I have one more question ... can i use wicket behaviour to
> retrieve selected date from calendar or i have to write some JS hacks to do
> it?
>
>
> On 11/06/2010 06:38 PM, Igor Vaynberg wrote:
>>
>> i think its whatever format the yui component expects.
>>
>> -igor
>>
>> On Fri, Nov 5, 2010 at 9:25 AM, Jan Ferko  wrote:
>>
>>>
>>> Hi,
>>>
>>> Can anyone tell me what is format of map for
>>> AbstractCalendar.configureWidgetProperties(Map map) ? For example I want
>>> to
>>> set navigator property to true, but map.put("navigator", true) doesn't
>>> work.
>>>
>>> thanks for answer
>>> Jan
>>>
>>>
>>
>> -
>> 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



Re: App not responding

2010-11-08 Thread Igor Vaynberg
profile it and see what code takes more then a minute to complete

-igor

On Mon, Nov 8, 2010 at 1:31 PM, Simon van Wingerden  wrote:
> I'm busy to create an application with wicket just for fun and now I've got
> some strange behavior.
> After clinking a couple of times the program hangs and after a while I get
> the error message:
>
> ERROR - RequestCycle - org.apache.wicket.WicketRuntimeException: After 1
> minute the Pagemap null is still locked by: Thread[http-8080-24,5,main]
>
> Can it be that the page is to big or something ?
>
> It's a 3 layer app with Wicket, Spring and Hibernate.
>
> Wicket version 1.4.12 and the server is tomcat 6.
>
>
> Below the code of my HomePage as I think the error is in this page.
> I use Panels that are replaced based on the given parameters.
>
>
> package com.svw;
>
> import com.svw.panels.SinglePagePanel;
> import com.svw.panels.PagePanel;
> import com.svw.panels.NewPagePanel;
> import com.svw.panels.ChangesPanel;
> import com.svw.panels.EditPagePanel;
> import com.svw.panels.NewCategoryPanel;
> import com.svw.model.Category;
> import com.svw.panels.SearchPanel;
> import com.svw.security.SignInPage;
> import com.svw.security.SimWikiSession;
> import com.svw.services.CategoriesService;
> import com.svw.services.PagesService;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.spring.injection.annot.SpringBean;
> import com.svw.services.UsersService;
> import java.util.ArrayList;
> import java.util.List;
> import org.apache.wicket.Component;
> import org.apache.wicket.PageParameters;
> import org.apache.wicket.markup.html.link.BookmarkablePageLink;
> import org.apache.wicket.markup.html.link.Link;
> import org.apache.wicket.markup.html.list.ListItem;
> import org.apache.wicket.markup.html.list.ListView;
> import org.apache.wicket.markup.html.panel.Panel;
>
> /**
>  * Homepage
>  */
> public class HomePage extends WebPage {
>
>    private Panel panel = null;
>    private static final long serialVersionUID = 1L;
>   �...@springbean
>    protected CategoriesService categoryService;
>   �...@springbean
>    protected UsersService userService;
>   �...@springbean
>    protected PagesService pagesService;
>
>    /**
>     * Constructor that is invoked when page is invoked without a session.
>     *
>     * @param parameters
>     *            Page parameters
>     */
>    public HomePage(PageParameters parameters) {
>        String categorieFromParameter = parameters.getString("category");
>        String actionFromParameter = parameters.getString("action");
>        String pageFromParameter = parameters.getString("page");
>
>
>        List listCategories = new ArrayList();
>        for (Category cat : categoryService.getCategories()) {
>            listCategories.add(cat.getName());
>        }
>
>        createSiteMap();
>        createContact();
>
>        createCatories(listCategories);
>
>        Link linkSearch = createSearchPage();
>
>        Link linkChange = createChangesPage();
>
>        Link link = createNewPage();
>        securityOnlyAuthorsAndAdmins(link);
>
>        Link linkNewCategory = createNewCategory();
>        securityOnlyAdmins(linkNewCategory);
>
>
>        Link logoutLink = createLogout();
>        add(getPanel(categorieFromParameter, actionFromParameter,
> pageFromParameter));
>
>
>        authorised();
>
>    }
>
>    private void createCatories(List listCategories) {
>        ListView listview = new ListView("listview", listCategories) {
>
>           �...@override
>            protected void populateItem(ListItem item) {
>                PageParameters pp = new PageParameters();
>                pp.add("category", item.getModelObject().toString());
>                BookmarkablePageLink link = new
> BookmarkablePageLink("CategoryLink", HomePage.class, pp);
>                link.add(new Label("CategoriesCaption", item.getModel()));
>                item.add(link);
>            }
>        };
>        add(listview);
>    }
>
>    private void createContact() {
>        add(new Link("contact") {
>
>           �...@override
>            public void onClick() {
>                Panel newPanel = new HomePanel("panelContainer", "Contact
> us", "mailto:svw...@gmail.com\";>mail creator of this program
> for suggestions or bugs.");
>                panel.replaceWith(newPanel);
>                panel = newPanel;
>            }
>        });
>    }
>
>    private void authorised() {
>        //if not authorised log in
>        if (SimWikiSession.get() == null ||
> !SimWikiSession.get().isAuthenticated()) {
>            setRedirect(true);
>            setResponsePage(SignInPage.class);
>        }
>    }
>
>    // Authentication roles
>    private void securityOnlyAuthorsAndAdmins(Component comp) {
>        if (SimWikiSession.get() != null &&
> SimWikiSession.get().isAuthenticated()) {
>            if (SimWikiSession.get().isReader()) {
>                comp.setVisible(false);
>            

Re: Free wicket from component hierarchy hell

2010-11-08 Thread Igor Vaynberg
On Mon, Nov 8, 2010 at 9:07 AM, Sebastian  wrote:
> ...and that makes the queue method a candidate to replace the add method
> without breaking anything.

not necessarily. while add() adds right away, queue holds componets in
a buffer until after the oninitialize() cascade. so calling
getparent() or walking the hieararchy cannot be done until after
oninitialize() has been called on the parent container. this gives you
no way to traverse and tweak the child hiearachy.

i might move the code so it creates the hierarchy just before the
parent's oninitialize(), post seemed safer at first glance.


-igor

>
> Regards,
>
> Seb
>
> On 08.11.2010 18:03, Igor Vaynberg wrote:
>>
>> On Mon, Nov 8, 2010 at 8:58 AM, Martin Makundi
>>   wrote:
>>>>
>>>> as I understand the readme the queue method basically has only a
>>>> slightly
>>>> different behavior compared to the add method in the way that it either
>>>> adds
>>>> a component as a direct child to the parent or as a sub-child as defined
>>>> in
>>>> the markup. So the markup is only used to determine the child's location
>>>> below a given (code controlled) parent. This means if you replace the
>>>> current add method with the behavior of the queue method, existing code
>>>> will
>>>> still work and we would not have two separate ways to add components.
>>>> That
>>>> sounds like a good solution.
>>>>
>>>> @Martin: please start arguing with the given arguments and stop moaning.
>>>> Thanks.
>>>
>>> I would argue that it is not completely safe to _replace_ add method
>>> with queue method. As Igor pointed out before, we might want to define
>>> security boundaries: componentA must be inside componentB. Such code
>>> should be implemented either traditionally or otherwise the new way of
>>> adding components via queue must implement a security feature that
>>> allows restricting child components inside a certain parent component
>>> in a fluid but robust manner.
>>
>> thats exactly what it does, as my readme file explains in the git
>> branch...
>>
>> -igor
>>
>>>
>>> Plain queue implementation, however, is a very good starting point to
>>> begin studying various ways of imposing security boundaries.
>>>
>>> **
>>> Martin
>>>>
>>>> On 08.11.2010 17:28, Igor Vaynberg wrote:
>>>>>
>>>>> it is not about fixing something that isnt broken, its about making it
>>>>> easier. anyways, i just updated the readme in my experimental branch
>>>>> that explains the solution a bit more:
>>>>> https://github.com/ivaynberg/wicket/tree/component-queuing
>>>>>
>>>>> -igor
>>>>>
>>>>> On Mon, Nov 8, 2010 at 8:23 AM, Vitaly
>>>>> Tsaplin
>>>>>  wrote:
>>>>>>>
>>>>>>> I'm sorry to say, but the whole discussion makes little sense to me
>>>>>>> and
>>>>>>> these attempts to fix something that is not broken actually scares me
>>>>>>> a
>>>>>>> bit.
>>>>>>
>>>>>> +1
>>>>>>
>>>>>> -
>>>>>> 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
>>
>>
>
>
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-08 Thread Igor Vaynberg
On Mon, Nov 8, 2010 at 8:58 AM, Martin Makundi
 wrote:
>> as I understand the readme the queue method basically has only a slightly
>> different behavior compared to the add method in the way that it either adds
>> a component as a direct child to the parent or as a sub-child as defined in
>> the markup. So the markup is only used to determine the child's location
>> below a given (code controlled) parent. This means if you replace the
>> current add method with the behavior of the queue method, existing code will
>> still work and we would not have two separate ways to add components. That
>> sounds like a good solution.
>>
>> @Martin: please start arguing with the given arguments and stop moaning.
>> Thanks.
>
> I would argue that it is not completely safe to _replace_ add method
> with queue method. As Igor pointed out before, we might want to define
> security boundaries: componentA must be inside componentB. Such code
> should be implemented either traditionally or otherwise the new way of
> adding components via queue must implement a security feature that
> allows restricting child components inside a certain parent component
> in a fluid but robust manner.

thats exactly what it does, as my readme file explains in the git branch...

-igor

>
> Plain queue implementation, however, is a very good starting point to
> begin studying various ways of imposing security boundaries.
>
> **
> Martin
>>
>> On 08.11.2010 17:28, Igor Vaynberg wrote:
>>>
>>> it is not about fixing something that isnt broken, its about making it
>>> easier. anyways, i just updated the readme in my experimental branch
>>> that explains the solution a bit more:
>>> https://github.com/ivaynberg/wicket/tree/component-queuing
>>>
>>> -igor
>>>
>>> On Mon, Nov 8, 2010 at 8:23 AM, Vitaly Tsaplin
>>>  wrote:
>>>>>
>>>>> I'm sorry to say, but the whole discussion makes little sense to me and
>>>>> these attempts to fix something that is not broken actually scares me a
>>>>> bit.
>>>>
>>>> +1
>>>>
>>>> -
>>>> 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



Re: Free wicket from component hierarchy hell

2010-11-08 Thread Igor Vaynberg
On Mon, Nov 8, 2010 at 8:51 AM, Sebastian  wrote:
> Vigor,
>
> as I understand the readme the queue method basically has only a slightly
> different behavior compared to the add method in the way that it either adds
> a component as a direct child to the parent or as a sub-child as defined in
> the markup. So the markup is only used to determine the child's location
> below a given (code controlled) parent. This means if you replace the
> current add method with the behavior of the queue method, existing code will
> still work and we would not have two separate ways to add components. That
> sounds like a good solution.

hrm. i was thinking to have queue() in addition to add(). i havent
looked into it enough to be able to say that we can replace add() with
queue() completely and not lose anything. if, however, that is the
case, then i would prefer tweaking add() itself to work like queue().

-igor


>
> @Martin: please start arguing with the given arguments and stop moaning.
> Thanks.
>
> Regards,
> Seb
>
> On 08.11.2010 17:28, Igor Vaynberg wrote:
>>
>> it is not about fixing something that isnt broken, its about making it
>> easier. anyways, i just updated the readme in my experimental branch
>> that explains the solution a bit more:
>> https://github.com/ivaynberg/wicket/tree/component-queuing
>>
>> -igor
>>
>> On Mon, Nov 8, 2010 at 8:23 AM, Vitaly Tsaplin
>>  wrote:
>>>>
>>>> I'm sorry to say, but the whole discussion makes little sense to me and
>>>> these attempts to fix something that is not broken actually scares me a
>>>> bit.
>>>
>>> +1
>>>
>>> -
>>> 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



Re: BUG: Form Bytes getMaxSize

2010-11-08 Thread Igor Vaynberg
can you please open a jira issue so we can track this? thanks.

-igor

On Fri, Nov 5, 2010 at 2:26 PM, richard emberson
 wrote:
> In org/apache/wicket/markup/html/form/Form the method getMaxSize
> always returns a Bytes instance.
>
>
>  public Bytes getMaxSize() {
>    Bytes maxSize = this.maxSize;
>    if (maxSize == null) {
>      maxSize = visitChildren(Form.class, new IVisitor, Bytes>() {
>        public void component(Form component, IVisit visit) {
>          Bytes maxSize = component.getMaxSize();
>          if (maxSize != null) {
>            visit.stop(maxSize);
>          }
>        }
>      });
>    }
>    if (maxSize == null) {
>      return
> getApplication().getApplicationSettings().getDefaultMaximumUploadSize();
>    }
>    return maxSize;
>  }
>
> Because during the visit traversal, the VERY FIRST Form visited returns
> a non-null getMaxSize value. Even it its this.maxSize is null, it
> will then return getDefaultMaximumUploadSize.
>
> I suspect what is needed is a isMaxSizeSet method.
> The inner visit method would then be:
>
>
>    if (component.isMaxSizeSet()) {
>      Bytes maxSize = component.getMaxSize();
>      visit.stop(maxSize);
>    }
>
> With this, then it is only the Form creating and calling the Visitor
> that returns the getDefaultMaximumUploadSize value, and only if
> none of its sub Forms have an explicit value.
>
> Also, should the Visitor actually look for the maximum size value
> of the children and return it rather than returning the first
> value (which may not be the maximum)???
>
> Richard
> --
> Quis custodiet ipsos custodes
>
> -
> 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: Still getting 'Could not find form parent' with 1.4.13 with message box on form validation

2010-11-08 Thread Igor Vaynberg
wicket doesnt have a "message box" so im not sure what you are talking
about. i can also produce the stacktrace you have shown in at least 30
different ways. so, how about showing some actual code so we can
actually help you? :)

-igor

On Mon, Nov 8, 2010 at 3:25 AM, Chris Colman
 wrote:
> I show a message box via the Form.onError override and this works once
> but when the user hits ok and then submit again we get the following
> error:
>
> It looks like there was a similar bug fixed in 1.4.13 but I still see
> this error with 1.4.13.
> WicketMessage: Could not find Form parent for [MarkupContainer
> [Component id = okBtn]]
> Root cause:
> org.apache.wicket.WicketRuntimeException: Could not find Form parent for
> [MarkupContainer [Component id = okBtn]]
>     at
> org.apache.wicket.markup.html.form.FormComponent.getForm(FormComponent.j
> ava:737)
>     at
> org.apache.wicket.markup.html.form.Form$2.component(Form.java:611)
>     at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:899
> )
>     at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
> )
>     at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
> )
>     at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
> )
>     at
> org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:6
> 04)
>     at
> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:899)
>     at
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmi
> tBehavior.java:135)
>     at
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:
> 177)
>     at
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef
> aultAjaxBehavior.java:300)
>     at
> org.apache.wicket.request.target.component.listener.BehaviorRequestTarge
> t.processEvents(BehaviorRequestTarget.java:142)
>     at
> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab
> stractRequestCycleProcessor.java:92)
>     at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
> :1250)
>     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
>     at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>     at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484
> )
>     at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:
> 317)
>

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



Re: Free wicket from component hierarchy hell

2010-11-08 Thread Igor Vaynberg
wtf, srsly?

-igor

On Mon, Nov 8, 2010 at 8:30 AM, Martin Makundi
 wrote:
>>> I'm sorry to say, but the whole discussion makes little sense to me and
>>> these attempts to fix something that is not broken actually scares me a bit.
>>
>> +1
>
> It's maybe not broken for you. For me it's like dabbling in a swamp
> (http://kuvablogi.com/nayta/prev/img1483294.jpg,
> http://www.lansi-savo.fi/Urheilu/9349269.jpg,
> http://www.suopotkupallo.fi/).
>
> But all really depends on your approach. Some people think dabbling in
> a swamp gives you a firm grip. I cosinder it the opposite: swamp has a
> firm grip on you.
>
> **
> 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: Ajax response render as source in the browser

2010-11-08 Thread Igor Vaynberg
well, you do have apache infront of tomcats, which *is* a proxy. i
would write a jmeter script that tried to reproduce this and when you
can run it against tomcat (not going through apache) and see if you
can repro it that way. im guessing its something in your apache config
since you are the only one having this issue.

-igor

On Sun, Nov 7, 2010 at 11:59 PM, Wayne W  wrote:
>> the browser. do you have a proxy between the servlet container and the
>> outside? maybe something is injecting a redirect or something weird.
>
> I did wonder if there was weird redirect issue, but after doing a lot
> of reading yesterday it seems the xmlrequest object *should* handle
> redirects fine. However either way we're not doing anything like that.
> We've got a couple of tomcat instances load balanced through apache,
> routed via a hardware firewall and out of the datacenter, so no
> proxies or anything at least I'm aware of.
>
> Its very frustrating.
>
>
>
> On Sun, Nov 7, 2010 at 9:41 PM, Igor Vaynberg  wrote:
>> the only way i can see that happenning if the url is no longer
>> processed by wicket's ajax support and so the response just ends up in
>> the browser. do you have a proxy between the servlet container and the
>> outside? maybe something is injecting a redirect or something weird.
>>
>> -igor
>>
>> On Sun, Nov 7, 2010 at 8:26 AM, Wayne W  wrote:
>>> thanks Igor,
>>>
>>> I've just spent a few hours stepping though the code and I cannot see
>>> anyway the content type could be set wrong - I see the content type is
>>> set in the final respond(requestCycle) method, so I'm now thinking
>>> this is not a content type issue.
>>>
>>> However we just got another user email with a screen shot showing the
>>> wicket ajax-response in the browser so something is up.
>>>
>>> My javascript knowledge is weak at best so I've not been able to tell
>>> much from the js .
>>>
>>> Any ideas on how we can resolve this or at least get more info?
>>> many thanks
>>>
>>>
>>>
>>>
>>> On Sat, Nov 6, 2010 at 6:40 PM, Igor Vaynberg  
>>> wrote:
>>>> see AjaxRequestTarget class, this is where the response is generated
>>>> on the serverside
>>>>
>>>> wicket-ajax.js is where it is processed on the client side.
>>>>
>>>> -igor
>>>>
>>>> On Sat, Nov 6, 2010 at 2:49 AM, Wayne W  
>>>> wrote:
>>>>> Hi Igor,
>>>>>
>>>>> Whats odd is that one guy was getting it on his iPad consistently and
>>>>> when we asked him to try his desktop he's got the same problem on
>>>>> Firefox on Mac. We initially though it might have been a browser
>>>>> issue. We then got another user who got it only once on Chrome on
>>>>> windows - all in the space of 1 day. We're worried that's it happening
>>>>> more often but users are not reporting the issue.
>>>>>
>>>>> Of course we cannot reproduce the issue, but its definitely happening.
>>>>>
>>>>> So you don;t think the shared resource could effect the threads in any 
>>>>> way?
>>>>>
>>>>> Where can I start looking in the wicket code to understand where ajax
>>>>> requests are serviced etc? Is there any where/docs I can find to get
>>>>> started at looking at this? -  at least to complete more my
>>>>> understanding of how it all works.
>>>>>
>>>>> thanks
>>>>> Wayne
>>>>>
>>>>> On Fri, Nov 5, 2010 at 10:05 PM, Igor Vaynberg  
>>>>> wrote:
>>>>>> it may be a content type issue, but it is still weird because the
>>>>>> response is received by the xml http request object, not the browser
>>>>>> directly. strange indeed.
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Fri, Nov 5, 2010 at 7:51 AM, Wayne W  
>>>>>> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> has anyone had this issue? We're getting emails from our users that
>>>>>>> sometime when clicking on an ajax link the raw wicket ajax response is
>>>>>>> being rendered on the browser - ie the just see all the html source
>>>>>>> code on the page. Its not any particular page.
>>>>>>>
>&g

Re: Free wicket from component hierarchy hell

2010-11-08 Thread Igor Vaynberg
it is not about fixing something that isnt broken, its about making it
easier. anyways, i just updated the readme in my experimental branch
that explains the solution a bit more:
https://github.com/ivaynberg/wicket/tree/component-queuing

-igor

On Mon, Nov 8, 2010 at 8:23 AM, Vitaly Tsaplin  wrote:
>> I'm sorry to say, but the whole discussion makes little sense to me and
>> these attempts to fix something that is not broken actually scares me a bit.
>
> +1
>
> -
> 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: Ajax response render as source in the browser

2010-11-07 Thread Igor Vaynberg
the only way i can see that happenning if the url is no longer
processed by wicket's ajax support and so the response just ends up in
the browser. do you have a proxy between the servlet container and the
outside? maybe something is injecting a redirect or something weird.

-igor

On Sun, Nov 7, 2010 at 8:26 AM, Wayne W  wrote:
> thanks Igor,
>
> I've just spent a few hours stepping though the code and I cannot see
> anyway the content type could be set wrong - I see the content type is
> set in the final respond(requestCycle) method, so I'm now thinking
> this is not a content type issue.
>
> However we just got another user email with a screen shot showing the
> wicket ajax-response in the browser so something is up.
>
> My javascript knowledge is weak at best so I've not been able to tell
> much from the js .
>
> Any ideas on how we can resolve this or at least get more info?
> many thanks
>
>
>
>
> On Sat, Nov 6, 2010 at 6:40 PM, Igor Vaynberg  wrote:
>> see AjaxRequestTarget class, this is where the response is generated
>> on the serverside
>>
>> wicket-ajax.js is where it is processed on the client side.
>>
>> -igor
>>
>> On Sat, Nov 6, 2010 at 2:49 AM, Wayne W  wrote:
>>> Hi Igor,
>>>
>>> Whats odd is that one guy was getting it on his iPad consistently and
>>> when we asked him to try his desktop he's got the same problem on
>>> Firefox on Mac. We initially though it might have been a browser
>>> issue. We then got another user who got it only once on Chrome on
>>> windows - all in the space of 1 day. We're worried that's it happening
>>> more often but users are not reporting the issue.
>>>
>>> Of course we cannot reproduce the issue, but its definitely happening.
>>>
>>> So you don;t think the shared resource could effect the threads in any way?
>>>
>>> Where can I start looking in the wicket code to understand where ajax
>>> requests are serviced etc? Is there any where/docs I can find to get
>>> started at looking at this? -  at least to complete more my
>>> understanding of how it all works.
>>>
>>> thanks
>>> Wayne
>>>
>>> On Fri, Nov 5, 2010 at 10:05 PM, Igor Vaynberg  
>>> wrote:
>>>> it may be a content type issue, but it is still weird because the
>>>> response is received by the xml http request object, not the browser
>>>> directly. strange indeed.
>>>>
>>>> -igor
>>>>
>>>> On Fri, Nov 5, 2010 at 7:51 AM, Wayne W  
>>>> wrote:
>>>>> Hi,
>>>>>
>>>>> has anyone had this issue? We're getting emails from our users that
>>>>> sometime when clicking on an ajax link the raw wicket ajax response is
>>>>> being rendered on the browser - ie the just see all the html source
>>>>> code on the page. Its not any particular page.
>>>>>
>>>>> Anyone seen this or has any ideas?
>>>>>
>>>>>
>>>>> The only thing we have changed recently was adding a non blocking file
>>>>> download using a link and a shared resource which could be related due
>>>>> to the Content Type.
>>>>> In the configureResponse of the shared resource that we set the
>>>>> Content Type for that request. Is there any chance that this is
>>>>> somehow polluting the other threads requests?
>>>>>
>>>>> public class DownloadFileResourceReference extends ResourceReference {
>>>>>        public DownloadFileResourceReference() {
>>>>>                super(DownloadLink.class, "");
>>>>>        }
>>>>>
>>>>>        private static final long serialVersionUID = 1L;
>>>>>
>>>>>        public Resource newResource() {
>>>>>
>>>>>                Resource r =  new Resource() {
>>>>>                        private static final long serialVersionUID = 1L;
>>>>>
>>>>>                        public IResourceStream getResourceStream() {
>>>>>
>>>>>                                        Long id = 
>>>>> getParameters().getLong(DownloadLink.DOCID);
>>>>>                                        // get file
>>>>>
>>>>>                                        return new FileResourceStream(new 
>>>>> File(file.getAbsolutePath()));
>>>>>  

Re: Free wicket from component hierarchy hell

2010-11-06 Thread Igor Vaynberg
here is a proper very rough initial implementation:

https://github.com/ivaynberg/wicket/commit/cbe861f4028120993f5d10d575f12c4ca291fdce

now someone has to mature it to the point where it can be properly evaluated.

-igor

On Sat, Nov 6, 2010 at 6:54 AM, samket  wrote:
>> We need to wait until all components are added so that we can arrange
> them into correct hireracy before rendering.
>
> May I suggest that components are added with help of a builder object, for 
> example:
>
> public MyPanel(String id) {
> super(id);
> Builder b = new Builder(this); // the Builder gets reference to this MyPanel
> b.add(new TextField("name")); // can be child of "form" which is added later
> b.add(new SomeForm("form"));
> b.build(); // after this line this MyPanel contains the components name and 
> form
> }
>
> If MyPanel's super class needs to access the same builder, it can provide a 
> constructor for it. In that case b.build() should be only invoked in 
> MyPanel's constructor.
>
> If a developer uses more than one builder in a constructor, he can restrict 
> moving of components in markup to some extent:
>
> public MyPanel(String id) {
> super(id);
> Builder b1 = new Builder(this);
> b1.add(new TextField("name")); // in markup, "name" can't be put under "form" 
> because it's in a different builder
> b1.build();
> Builder b2 = new Builder(this);
> b2.add(new SomeForm("form");
> b2.build();
> }
>
> Of course this doesn't solve the problem Igor mentioned. For that you'd need 
> the "old-fashioned way":
>
> public MyPanel(String id) {
> super(id);
> SomeForm form = new SomeForm("form");
> form.add(new TextField("name"); // in markup, "name" can't be moved out from 
> "form"
> add(form);
> }
>
> Developers would need to mix different approaches for building hierarchies if 
> security is an issue. On second thought, I should use a broader term than 
> security because there is more than one reason to restrict those pesky 
> designers ;)
>
> -
> 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: ModalWindow show only content

2010-11-06 Thread Igor Vaynberg
You can probably hide all the chrome with css

-igor

On Nov 6, 2010 4:09 AM, "meduolis"  wrote:


Hello, is it possible to show only modal window content without all these
title bar stuff, close button and frames?
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-show-only-content-tp3029858p3029858.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: navomatic example doesnt´t work

2010-11-06 Thread Igor Vaynberg
your page markup does not contain a tag with
wicket:id="navomaticBorder", also your border does not contain a tag
with wicket:id="bodyBorder"

-igor

On Sat, Nov 6, 2010 at 12:59 AM, JayJay  wrote:
>
> I´m using version 1.4.13
>
> NavomaticApplication.java:
>
> public class NavomaticApplication extends WebApplication
> {
>        /**
>         * Constructor.
>         */
>        public NavomaticApplication()
>        {
>        }
>
>        /**
>         * @see org.apache.wicket.Application#getHomePage()
>         */
>       �...@override
>        public Class< ? extends Page> getHomePage()
>        {
>                return Page1.class;
>        }
>
>
> }
>
> NavomaticBorder.html:
>
> http://wicket.apache.org/";>
> 
> Wicket Examples - navomatic
> 
> 
> 
> 
>        
>        
>                
>                        
>                        Navigation Links
>                        
>                                 Page1.html Page1
>                                
>                                 Page2.html Page2
>                                
>                                 Page3.html Page3
>                        
>                        
>                        
>                         
>                        
>                
>        
>        
> 
> 
> 
>
> WicketBorder.java:
>
> public class NavomaticBorder extends Border
> {
>
>        /**
>         * Constructor
>         *
>         * @param id
>         *            The id of this component
>         */
>        public NavomaticBorder(final String id)
>        {
>                super(id);
>                add(new BoxBorder("navigationBorder"));
>                add(new BoxBorder("bodyBorder"));
>        }
> }
>
> Page1.html:
>
> http://wicket.apache.org/";>
> 
>    Wicket Examples - navomatic
>    
> 
> 
>
>                
>                Page 1
>                Welcome to Navomatic.  The navigation links on the left
>                will allow you to navigate between three pages.  Notice that 
> the current
> page
>                (Page1) is displayed in the "Navigation Links" area as 
> italicized text,
>                while the other pages are displayed as clickable links.  Go 
> ahead
>                and click the "Page2" link now.
>                
>
> 
> 
>
> Page1.java:
>
> public class Page1 extends WebPage
> {
>        /**
>         * Constructor
>         */
>        public Page1()
>        {
>                add(new NavomaticBorder("navomaticBorder"));
>        }
> }
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/navomatic-example-doesnt-t-work-tp3029232p3029763.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



Re: Ajax response render as source in the browser

2010-11-06 Thread Igor Vaynberg
see AjaxRequestTarget class, this is where the response is generated
on the serverside

wicket-ajax.js is where it is processed on the client side.

-igor

On Sat, Nov 6, 2010 at 2:49 AM, Wayne W  wrote:
> Hi Igor,
>
> Whats odd is that one guy was getting it on his iPad consistently and
> when we asked him to try his desktop he's got the same problem on
> Firefox on Mac. We initially though it might have been a browser
> issue. We then got another user who got it only once on Chrome on
> windows - all in the space of 1 day. We're worried that's it happening
> more often but users are not reporting the issue.
>
> Of course we cannot reproduce the issue, but its definitely happening.
>
> So you don;t think the shared resource could effect the threads in any way?
>
> Where can I start looking in the wicket code to understand where ajax
> requests are serviced etc? Is there any where/docs I can find to get
> started at looking at this? -  at least to complete more my
> understanding of how it all works.
>
> thanks
> Wayne
>
> On Fri, Nov 5, 2010 at 10:05 PM, Igor Vaynberg  
> wrote:
>> it may be a content type issue, but it is still weird because the
>> response is received by the xml http request object, not the browser
>> directly. strange indeed.
>>
>> -igor
>>
>> On Fri, Nov 5, 2010 at 7:51 AM, Wayne W  wrote:
>>> Hi,
>>>
>>> has anyone had this issue? We're getting emails from our users that
>>> sometime when clicking on an ajax link the raw wicket ajax response is
>>> being rendered on the browser - ie the just see all the html source
>>> code on the page. Its not any particular page.
>>>
>>> Anyone seen this or has any ideas?
>>>
>>>
>>> The only thing we have changed recently was adding a non blocking file
>>> download using a link and a shared resource which could be related due
>>> to the Content Type.
>>> In the configureResponse of the shared resource that we set the
>>> Content Type for that request. Is there any chance that this is
>>> somehow polluting the other threads requests?
>>>
>>> public class DownloadFileResourceReference extends ResourceReference {
>>>        public DownloadFileResourceReference() {
>>>                super(DownloadLink.class, "");
>>>        }
>>>
>>>        private static final long serialVersionUID = 1L;
>>>
>>>        public Resource newResource() {
>>>
>>>                Resource r =  new Resource() {
>>>                        private static final long serialVersionUID = 1L;
>>>
>>>                        public IResourceStream getResourceStream() {
>>>
>>>                                        Long id = 
>>> getParameters().getLong(DownloadLink.DOCID);
>>>                                        // get file
>>>
>>>                                        return new FileResourceStream(new 
>>> File(file.getAbsolutePath()));
>>>                        }
>>>
>>>
>>>                        protected void configureResponse(Response response) {
>>>
>>>                                Long id = 
>>> getParameters().getLong(DownloadLink.DOCID);
>>>
>>>                                // get file
>>>
>>>                                ((WebResponse) 
>>> response).setAttachmentHeader(df.getFileName());
>>>
>>>                                String mimeType = 
>>> ResourceHelper.getContentType(df.getFileName());
>>>                                if (!StringUtils.isEmpty(mimeType)) {
>>>                                        ((WebResponse) 
>>> response).setContentType(mimeType);
>>>                                }
>>>
>>>                        }
>>>
>>>                };
>>>                r.setCacheable(false);
>>>                return r;
>>>        }
>>>
>>> }
>>>
>>> -
>>> 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



Re: Configuration of AbstractCalendar

2010-11-06 Thread Igor Vaynberg
i think its whatever format the yui component expects.

-igor

On Fri, Nov 5, 2010 at 9:25 AM, Jan Ferko  wrote:
> Hi,
>
> Can anyone tell me what is format of map for
> AbstractCalendar.configureWidgetProperties(Map map) ? For example I want to
> set navigator property to true, but map.put("navigator", true) doesn't work.
>
> thanks for answer
> Jan
>

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



Re: strange problem with redirect to buffer and URL encoded query string

2010-11-06 Thread Igor Vaynberg
trace the java side to see what is encoding the url. it may be a
number of things, but since its only happennig to you its probably
something in your environment. also what version of wicket are you
running?

-igor

On Fri, Nov 5, 2010 at 8:01 AM, Joe Hudson  wrote:
> Hi,
>
> I am using a AjaxFallbackButton within a form.  In this case the
> response is saved to a buffer in the session and supposed to be
> retrieved in the next page request.
>
> The problem that I am facing is that the second request is providing
> URL encoded query string and I can't figure out why...  Here is what I
> have tracked down:
>
> The redirect is set by the listener interface request target:
> boolean issueRedirect = (strategy ==
> IRequestCycleSettings.REDIRECT_TO_RENDER || strategy ==
> IRequestCycleSettings.REDIRECT_TO_BUFFER);
> * I am set to REDIRECT_TO_BUFFER
>
> In WebApplication.addBufferedResponse, we are properly adding the
> buffered response to the map with the key of "wicket:interface=:0"
>
> In the BufferedWebResponse, we are calling
> httpServletResponse.sendRedirect(url) with the value of
> "wicket:interface=:0"
> * note: the value is URL encoded but even after encoding does not
> change from "wicket:interface=:0"
>
> On the next call, the query string retreived in WicketFilter (String
> queryString = servletRequest.getQueryString();) is
> "wicket%3Ainterface=%3A0%3A%3A%3A%3A"
>
> This causes the call to webApplication.popBufferedResponse to execute
> with the wrong key which of course finds no buffered response.
> * I have verified at this time that the valid buffered response is
> still there under the key of "wicket:interface=:0"
>
> * I do get a response back except that all component error messages do
> not show up because they were rendered to the buffer.
>
>
> Can anyone please help me understand what is gong on here?  I have
> tried evaluating this in firebug to see where this strange URL
> encoding is coming from but all I see in Firebug when I look at the
> response is "Failed to load source for:
> {context}?wicket:interface=:0:wizard:form::IFormSubmitListener::.  I
> am using Wicket version 1.4.12 on Ubuntu and have tried this in both
> Chrome and FireFox with the same result.
>
> Any help would be greatly appreciated.  Thanks.
>
> Joe
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-05 Thread Igor Vaynberg
On Fri, Nov 5, 2010 at 11:32 PM, Martin Makundi
 wrote:
> Hi!
>
>> Please make sure that it passes all current test cases before submitting the
>> patch.  Also, it would be good to take the examples that have been given to
>> you in this thread and create tests from them that demonstrate that they all
>> work.  Particularly important will be demonstrating the security example
>> that Igor gave above.
>
> The security example is quite extreme and should be implemented in
> traditional way if there is no regression test for it.

there is nothing extreme about it, it is a common use of containers
when implementing visibility/security. just the fact that this
"forces" the traditional approach sounds scarry.

-igor

>
>> I'm telling you all this in advance, not to be mean, but to help you out.
>> In this one thread, you've pulled out more responses from PMC members and
>> committers than any thread in recent memory - and all of them agreed that it
>> was a bad idea, and not likely to be implemented.  So, if you submit a
>> patch, it needs to meet all the above criteria to prove us all wrong.  I'd
>> rather tell you that up front than have you submit a half-working patch and
>> then get shot down in a blaze of glory.  :)
>
> I am planning to take more of a "helper method" approach that is not
> so invasive:
>
> HierarchyUtils.helpMeAddThisComponentToItsParent(panel, component);
>
> **
> Martin
>
>>
>> --
>> Jeremy Thomerson
>> http://wickettraining.com
>> *Need a CMS for Wicket?  Use Brix! http://brixcms.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



Re: Ajax response render as source in the browser

2010-11-05 Thread Igor Vaynberg
it may be a content type issue, but it is still weird because the
response is received by the xml http request object, not the browser
directly. strange indeed.

-igor

On Fri, Nov 5, 2010 at 7:51 AM, Wayne W  wrote:
> Hi,
>
> has anyone had this issue? We're getting emails from our users that
> sometime when clicking on an ajax link the raw wicket ajax response is
> being rendered on the browser - ie the just see all the html source
> code on the page. Its not any particular page.
>
> Anyone seen this or has any ideas?
>
>
> The only thing we have changed recently was adding a non blocking file
> download using a link and a shared resource which could be related due
> to the Content Type.
> In the configureResponse of the shared resource that we set the
> Content Type for that request. Is there any chance that this is
> somehow polluting the other threads requests?
>
> public class DownloadFileResourceReference extends ResourceReference {
>        public DownloadFileResourceReference() {
>                super(DownloadLink.class, "");
>        }
>
>        private static final long serialVersionUID = 1L;
>
>        public Resource newResource() {
>
>                Resource r =  new Resource() {
>                        private static final long serialVersionUID = 1L;
>
>                        public IResourceStream getResourceStream() {
>
>                                        Long id = 
> getParameters().getLong(DownloadLink.DOCID);
>                                        // get file
>
>                                        return new FileResourceStream(new 
> File(file.getAbsolutePath()));
>                        }
>
>
>                        protected void configureResponse(Response response) {
>
>                                Long id = 
> getParameters().getLong(DownloadLink.DOCID);
>
>                                // get file
>
>                                ((WebResponse) 
> response).setAttachmentHeader(df.getFileName());
>
>                                String mimeType = 
> ResourceHelper.getContentType(df.getFileName());
>                                if (!StringUtils.isEmpty(mimeType)) {
>                                        ((WebResponse) 
> response).setContentType(mimeType);
>                                }
>
>                        }
>
>                };
>                r.setCacheable(false);
>                return r;
>        }
>
> }
>
> -
> 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: navomatic example doesnt´t work

2010-11-05 Thread Igor Vaynberg
what version of wicket are you trying this with? and paste the
complete source and markup.

-igor

On Fri, Nov 5, 2010 at 12:12 PM, JayJay  wrote:
>
> Hi,
>
> I´m new to wicket and i tried out the navomatic example.
> I just copied the code to my eclipse engine but it didn´t work.
> I got the following error:
> WicketMessage: Unable to find component with id 'navigationBorder' in
> [NavomaticBorder [Component id = navomaticBorder]]. This means that you
> declared wicket:id=navigationBorder in your markup, but that you either did
> not add the component to your page at all, or that the hierarchy does not
> match.
>
> But in the NavomaticBorder.java constructor looks like that:
>
>        public NavomaticBorder(final String id)
>        {
>                super(id);
>                add(new BoxBorder("navigationBorder"));
>                add(new BoxBorder("bodyBorder"));
>        }
>
> Can anyone help me please.
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/navomatic-example-doesnt-t-work-tp3029232p3029232.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



Re: Free wicket from component hierarchy hell

2010-11-05 Thread Igor Vaynberg
On Fri, Nov 5, 2010 at 1:07 PM, Martin Makundi
 wrote:
>> because the designer delivers only part of the solution - the markup.
>
> I meant software designer.
>
>> 
>>  
>>  
>> 
>>
>> now the developer takes the "salary" div and moves it out of the
>> "for-admins-only" div. guess what, your *designer* has just opened a
>> huge security hole in your application. who would use wicket if such
>> things were so easily possible?
>
> I did not propose that. If hierarchy is parsed from markup the
> visibility rules will remain same at runtime.

the above should have read: now the *designer* (not developer) takes
the "salary" div and moves it out of the

the designer is free to change the hierarchy, oblivious to whatever
behavioral changes that can cause or why the hierarchy was there in
the first place. but i bet the developers will get the blame :)

>>> I believe most are just acustomed to using it as it is. Even more people 
>>> are accustomed using JSF.
>>> That feels more like an excuse to refrain from making Wicket even better.
>>
>> that is why we have no improvement and new feature requests in jira?
>> because everyone is ok with the status quo? is it also the reason why
>> we have not added anything new from 1.0 to 1.5, these have all been
>> bug fix releases?
>
> I'm not standing in the way of this improvement ;)

no, you are just saying that we are against this because we dont want
to improve the framework. which is obviously a bogus statement.

>> anywho, i think the fact that no one has really jumped in and sided
>> with you is a good indication where this is going.
>
> Not so good indication ;) But pretty predictable ;) I think it's just
> fear of change.

i think if you look at the history of conversations we had on this
list you will find that to be the opposite.

-igor



>
> **
> 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
>>
>>
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-05 Thread Igor Vaynberg
On Fri, Nov 5, 2010 at 11:39 AM, Martin Makundi
 wrote:
> Hi!
>
>> its not about the list *items* its about the components you add to them
>>
>> onpopuateitem(item item) {
>>  add(new label("name"));
>>  add(new label("email"));
>> }
>>
>> wont work
>
> Why should it? Won't make it any easier than:
>
> item.add(new label("name"));
> item.add(new label("email"))

right. this is the inconsistency i was talking about. sometimes you
use straight add() and everything works, but sometimes you have to add
to the proper component. this is going to cause headaches.

>>> The developer can choose: using unique wicket:ids or traditional ones.
>>
>> i would not want to support both approaches. it will make things very
>> difficult for us and for developers. we should have one consistent
>> approach.
>
> Thank god nobody said "640k will be enough for everybody".

thank god no one spent millions of dollars designing IEEE1394 to
compete against PCI and USB, otherwise it wouldve been a tremendous
waste.

> Why is there private, friendly, package and public visibility
> confusing java developers?

because without it you wouldnt be able to control visibility. your
proposal does not add any *new* features.

> What about giving more freedom to design effectively according to
> designer's choice?

because the designer delivers only part of the solution - the markup.
the missing part is the behavior and to think that the behavior can be
added in a completely orthogonal manner is foolish because behavior
and markup are tightly coupled on matter whichever way you slice it.
the best we can do is to make the coupling as easy and us unobtrusive
as possible.

the designers are free to move pieces around as long as they do not
cross wicket:id border, after all those borders are there for a reason
- to attach some behavior.

a very simple example is that you have a container that should only be
visible to admins of the application - this container contains
sensitive fields that normal users should not see.


  
  


now the developer takes the "salary" div and moves it out of the
"for-admins-only" div. guess what, your *designer* has just opened a
huge security hole in your application. who would use wicket if such
things were so easily possible?

>> you say its "hell" but let me remind you that you are in a
>> very very vast minority about this. how many threads on this list are
>> about this hell compared to other threads? not many at all, not even
>> 1%. therefore, im not too inclined to change the way the entire
>> framework works for the loud 1%.
>
> I believe most are just acustomed to using it as it is. Even more people are 
> accustomed using JSF.
> That feels more like an excuse to refrain from making Wicket even better.

that is why we have no improvement and new feature requests in jira?
because everyone is ok with the status quo? is it also the reason why
we have not added anything new from 1.0 to 1.5, these have all been
bug fix releases?

 what has always attracted me to wicket is its consistency. once you
 learn how to add components you can use the same method for all
 usecases and it works. it seems like this would take away from that.
>>>
>>> It is consistent yes, but also redundant.

and as with many such things we have to calculate if eliminating
redundancy is worth decreasing consistency.

>> redundant for basic cases, yes. not redundant as soon as you are
>> trying to do something non-trivial. you cant build anything
>> interesting if you only try to use trivial constructs.
>
> Web pages are 80% trivial. Small friction like doing unnecessary
> hierarcy matching is waste of time. 5 min per hour, 40 minutes per
> day, 800 minutes per month, 20 people team 16000 wasted minutes per
> month is 33 days per month wasted only because of wicket hierarchies.

if your web pages are trivial then why do you have hierarchy? you don
thave to have hierarchy in java just because it is in markup...you
dont have to model every single tag in wicket.

anywho, i think the fact that no one has really jumped in and sided
with you is a good indication where this is going.

-igor


>
> **
> 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: Free wicket from component hierarchy hell

2010-11-05 Thread Igor Vaynberg
On Fri, Nov 5, 2010 at 10:24 AM, Martin Makundi
 wrote:
> Hi!
>
>> what bothers me about this is that it wont work for everything. for
>> example, it wont work for repeaters:
>> these are just the two that come up off the top of my head.
>
> What do you mean? Repeaters have unique index, it's not a duplicate.
>
>        public ListItem(final int index, final IModel model)
>        {
>                super(Integer.toString(index).intern(), model);
>                this.index = index;
>        }
>
>> such helpers will no longer be possible because we have forced the
>> panel to have unique wicket ids

its not about the list *items* its about the components you add to them

onpopuateitem(item item) {
  add(new label("name"));
  add(new label("email"));
}

wont work

> The developer can choose: using unique wicket:ids or traditional ones.

i would not want to support both approaches. it will make things very
difficult for us and for developers. we should have one consistent
approach. you say its "hell" but let me remind you that you are in a
very very vast minority about this. how many threads on this list are
about this hell compared to other threads? not many at all, not even
1%. therefore, im not too inclined to change the way the entire
framework works for the loud 1%.

>> what has always attracted me to wicket is its consistency. once you
>> learn how to add components you can use the same method for all
>> usecases and it works. it seems like this would take away from that.
>
> It is consistent yes, but also redundant.

redundant for basic cases, yes. not redundant as soon as you are
trying to do something non-trivial. you cant build anything
interesting if you only try to use trivial constructs.

-igor

>> Keeping the two hierarchies in sync is not really that difficult.
>> I just really don't see the benefit in this.  I've taught tons of people
>> Wicket, and keeping the hierarchy in sync is hardly ever the
>> thing that makes it difficult for people to learn or use.
>
> It is not about being difficult, it's all about being efficient.
> Redundancy is waste. Waste is bad. "Intentional waste" is even worse.
> So let's lean it out ;]
>
> **
> Martin
>
>>
>> On Thu, Nov 4, 2010 at 1:13 PM, Martin Makundi
>>  wrote:
>>> I propose "Free Wicket" from component-hierarchy hell
>>>
>>> We have discussd before that Wicket has unnecessary binding to
>>> wicket:id and component hierarchy
>>> [http://www.mail-archive.com/users@wicket.apache.org/msg53941.html].
>>>
>>> I think I found a simple solution: "wicket:id" should be allowed to be
>>> on any level within given Panel-type element. User has freedom to
>>> position components and change html layout.
>>>
>>> What you think?
>>>
>>> Old wicket applications can be automatically refectored to have unique
>>> ids. Currently the wicket hardcoded component hierarchy slows down
>>> development and is totally unnecessary.
>>>
>>> https://cwiki.apache.org/confluence/display/WICKET/Wicket+1.5+Wish+List
>>>
>>> **
>>> 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
>>
>>
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-05 Thread Igor Vaynberg
this is somewhat possible. in 1.5 we have added features that are
somewhat enabling to this such as oninitializecallback and early
markup availability.

we can make all adds() be flat and at runtime parse the hierarchy from
markup, since it is defined there. if we keep a transient
represenation of the hierarchy on the java side we can still properly
handle things that need it, eg isVisibleInHierarchy().

what bothers me about this is that it wont work for everything. for
example, it wont work for repeaters:



add(new listview("contacts",...) {
  onpopulateitem(item) {
 // this code *has* to add to the item and not to the panel
because unique ids are not possible
  }});

i wonder how many other cases like this will creep up, and at the end
will it be made easier when you have to think: in this case i can just
call add, but in this case i need to maintain the hierarchy somehow.

also right now it is easy to extract methods that do the same thing:

private void populate(WebMarkupContainer parent) {
 parent.add(new Label("foo",...));
 parent add(new Link("bar", parent.getModel()) {...};
}

such helpers will no longer be possible because we have forced the
panel to have unique wicket ids

these are just the two that come up off the top of my head.

in the end we have to figure out if the added simplicity is worth the
headache it brings for more complex usecases. what has always
attracted me to wicket is its consistency. once you learn how to add
components you can use the same method for all usecases and it works.
it seems like this would take away from that.

-igor

On Thu, Nov 4, 2010 at 1:13 PM, Martin Makundi
 wrote:
> I propose "Free Wicket" from component-hierarchy hell
>
> We have discussd before that Wicket has unnecessary binding to
> wicket:id and component hierarchy
> [http://www.mail-archive.com/users@wicket.apache.org/msg53941.html].
>
> I think I found a simple solution: "wicket:id" should be allowed to be
> on any level within given Panel-type element. User has freedom to
> position components and change html layout.
>
> What you think?
>
> Old wicket applications can be automatically refectored to have unique
> ids. Currently the wicket hardcoded component hierarchy slows down
> development and is totally unnecessary.
>
> https://cwiki.apache.org/confluence/display/WICKET/Wicket+1.5+Wish+List
>
> **
> 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: Resource caching, Deployment Mode Re-visited

2010-11-04 Thread Igor Vaynberg
i think the resources they talk about there are markup resources -
wicket only cashes markup and .property files. everything else like
CSS and Javascript should not be cached if modified date changed on
the file.

-igor

On Thu, Nov 4, 2010 at 8:35 AM, Arjun Dhar  wrote:
>
> Hi,
>  I'm trying to understand wickets ability to cache and how to optimize of
> the deployment mode etc.
>
> I wanna keep it in production (DEPLOYMENT MODE). However, when a resource is
> uploaded (like an image or a CSS) I want the system to allow me to refresh
> that particular resource.
>
> Some of the resources are added via the Wicket Code dynamically and some are
> references via the Markup. Is there a difference in how these two are
> treated?
>
> In Reference[2], at the end of the post a guy mentioned about "what about
> activating JMX and clearing the cache with it's help" ..that may be cool?
> ..or even via a API Call.
>
>
> References:
> 1. https://cwiki.apache.org/WICKET/faqs.html#FAQs-Deployment
> 2.
> http://apache-wicket.1842946.n4.nabble.com/Refresh-resources-in-deployment-mode-td1867352.html
>
> Thoughts and further reading appreciated!
>
> Thanks
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Resource-caching-Deployment-Mode-Re-visited-tp3027244p3027244.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



Re: Multi-tenancy with style

2010-11-04 Thread Igor Vaynberg
On Thu, Nov 4, 2010 at 8:27 AM, cretzel  wrote:
>
> We're building a multi-tenant capable application. The basic idea is to
> identify the tenant for a request and put the tenant information into a
> ThreadLocal.
>
> One requirement is to enable 'localization' per tenant, i.e. to allow
> tenant-specific labels, like for example one tenant wants to display the
> term 'client' instead of 'customer'. The first thing that comes to my mind
> is using tenant-specific styles, i.e. to read the properties from files like
> labels_tenant1.properties and labels_tenant2.properties.

that is what style and variation are for.

>
> Any arguments against that? Is there any other multi-tenancy support in
> Wicket?

see above.

-igor

> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Multi-tenancy-with-style-tp3027221p3027221.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



Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-04 Thread Igor Vaynberg
see here

http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc/

-igor

On Wed, Nov 3, 2010 at 11:51 AM, tommy  wrote:
>
> ok thanks, I'll try and put something together tonight. Are you able to
> answer either of those questions?
>
> On Wed, Nov 3, 2010 at 5:56 PM, Igor Vaynberg-2 [via Apache Wicket] <
> ml-node+3025865-1659550532-201...@n4.nabble.com
>> wrote:
>
>> http://wicket.apache.org/start/quickstart.html
>>
>> -igor
>>
>> On Wed, Nov 3, 2010 at 9:03 AM, tommy <[hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3025865&i=0>>
>> wrote:
>>
>> >
>> > Hi
>> > Can you point me to a link that explains what a quickstart is and how I
>> > create one?
>> >
>> > Also maybe you consider these questions
>> >
>> > 1. If I can pass in a RadioGroup object to a Radio() constructor does the
>>
>> > RadioGroup also need to be added to the page and if so, does it matter
>> where
>> > on the page the RadioGroup is rendered, and in both cases: why the need?
>> > given that the Radio objects are now bound to the RadioGroup object
>> > directly.
>> >
>> > 2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
>> > passed in to the Radio() constructor?
>> >
>> > Thanks, Tom
>> >
>> > On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] <
>> > [hidden email] 
>> > <http://user/SendEmail.jtp?type=node&node=3025865&i=1><[hidden
>> email] <http://user/SendEmail.jtp?type=node&node=3025865&i=2>>
>> >> wrote:
>> >
>> >> best way for us to help you is for you to create a quickstart and
>> >> attach it to your email or a jira issue.
>> >>
>> >> -igor
>> >>
>> >> On Wed, Nov 3, 2010 at 4:40 AM, tommy <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3025609&i=0>>
>> >> wrote:
>> >>
>> >> >
>> >> > I asked the following question on stack-overflow but was advised to
>> ask
>> >> here
>> >> > instead.
>> >> >
>> >>
>> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
>> >> >
>> >> > I am using Wicket and would like to create a grid of radio buttons
>> using
>> >> > html as shown below (outer lists will be displayed vertically, inner
>> >> lists
>> >> > will be displayed horizontally).
>> >> >
>> >> > I would like the radio buttons grouped vertically.
>> >> >
>> >> > 
>> >> >  
>> >> >    
>> >> >       
>> >> >       
>> >> >       
>> >> >    
>> >> >  
>> >> >  
>> >> >    
>> >> >       
>> >> >       
>> >> >       
>> >> >    
>> >> >  
>> >> >  
>> >> >    
>> >> >       
>> >> >       
>> >> >       
>> >> >    
>> >> >  
>> >> > 
>> >> >
>> >> > Unfortunately it seems that RadioGroup only allow one to group radio
>> >> buttons
>> >> > according to the grouping defined by their layout.
>> >> >
>> >> > eg RadioGroup group = new RadioGroup("radioGroupA");
>> >> >
>> >> > group.add( new Radio("myradio", new Model(1)) ;
>> >> >
>> >> > Problem with this is that I cannot then layout the way I want.
>> >> >
>> >> > Is there another way? Manually specifying the name and gather results?
>>
>> >> >
>> >> > UPDATE: I notice that Radio can take a RadioGroup as a parameter. So
>> one
>> >> can
>> >> > do something like:
>> >> >
>> >> > // create some groups
>> >> > for (0..n) {
>> >> >  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
>>
>> >> >  groupArray.add(group)
>> >> > }
>> >> >
>> >> > //create a ListView for the RadioGroups so we can attach them to page
>> >> > ListVie

Re: Multiple submit buttons - CompoundPropertyModel not updated

2010-11-03 Thread Igor Vaynberg
You cannot update models without default processing, what If the user typed
"abc"into a text field backed by an integer model? What you can do, however,
is accesses the raw value of the component via getvalue method.

-igor

On Nov 3, 2010 2:37 AM, "Benjamin Lorenz" 
wrote:

Hello,

I have a problem with a form that shall have two submit buttons. One finally
submits the form with all plausibility checks, etc... the other just opens
up a search form, to lookup some data for inclusion in the form. This submit
shall NOT do all the checks on e.g. .setRequired(true), etc..., but it DOES
HAVE to update my CompoundPropertyModel values, to deal with the user's
(partially) entered values so far.

I cannot get this together: setDefaultFormProcessing(false) will not update
my models, setDefaultFormProcessing(true) will finally submit my form, also
calling the form's onSubmit, which is not what I want.

I am using an anonymous form class with the default onSubmit(), and an
additionally attached Button, which has its own onSubmit().

Do you understand what I mean, and can anybody point me to the right
direction? It seems to me like a very basic, fundamental thing to do, two
form buttons, that deal - independently from each other - with the entered
data, but it seems to be tricky nevertheless...

Thanks,
Benjamin



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


Re: SV: How to get other page's localized messages ?

2010-11-03 Thread Igor Vaynberg
Later versions of wicket also support package level bundles stored in
package.properties files

-igor

On Nov 3, 2010 3:43 AM, "Wilhelmsen Tor Iver"  wrote:

> How do I get Page1's specific localized message in Page2 ?
1) Make a superclass for the two pages and put the message in the
superclass' property file

2) Put the property in the Application's property file

In both cases the mechanisms in Wicket will find the message.

- Tor I.

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


Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread Igor Vaynberg
http://wicket.apache.org/start/quickstart.html

-igor

On Wed, Nov 3, 2010 at 9:03 AM, tommy  wrote:
>
> Hi
> Can you point me to a link that explains what a quickstart is and how I
> create one?
>
> Also maybe you consider these questions
>
> 1. If I can pass in a RadioGroup object to a Radio() constructor does the
> RadioGroup also need to be added to the page and if so, does it matter where
> on the page the RadioGroup is rendered, and in both cases: why the need?
> given that the Radio objects are now bound to the RadioGroup object
> directly.
>
> 2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
> passed in to the Radio() constructor?
>
> Thanks, Tom
>
> On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] <
> ml-node+3025609-175919079-201...@n4.nabble.com
>> wrote:
>
>> best way for us to help you is for you to create a quickstart and
>> attach it to your email or a jira issue.
>>
>> -igor
>>
>> On Wed, Nov 3, 2010 at 4:40 AM, tommy <[hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3025609&i=0>>
>> wrote:
>>
>> >
>> > I asked the following question on stack-overflow but was advised to ask
>> here
>> > instead.
>> >
>> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
>> >
>> > I am using Wicket and would like to create a grid of radio buttons using
>> > html as shown below (outer lists will be displayed vertically, inner
>> lists
>> > will be displayed horizontally).
>> >
>> > I would like the radio buttons grouped vertically.
>> >
>> > 
>> >  
>> >    
>> >       
>> >       
>> >       
>> >    
>> >  
>> >  
>> >    
>> >       
>> >       
>> >       
>> >    
>> >  
>> >  
>> >    
>> >       
>> >       
>> >       
>> >    
>> >  
>> > 
>> >
>> > Unfortunately it seems that RadioGroup only allow one to group radio
>> buttons
>> > according to the grouping defined by their layout.
>> >
>> > eg RadioGroup group = new RadioGroup("radioGroupA");
>> >
>> > group.add( new Radio("myradio", new Model(1)) ;
>> >
>> > Problem with this is that I cannot then layout the way I want.
>> >
>> > Is there another way? Manually specifying the name and gather results?
>> >
>> > UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one
>> can
>> > do something like:
>> >
>> > // create some groups
>> > for (0..n) {
>> >  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
>> >  groupArray.add(group)
>> > }
>> >
>> > //create a ListView for the RadioGroups so we can attach them to page
>> > ListView radioListView = ListView("radioGroupList") { populate from
>> > groupArray }
>> > add(radioListView);
>> >
>> > // create our grid of radio buttons
>> > // outer -> rows
>> > for (0..x) {
>> >  // inner -> columns
>> >  for (0..n)
>> >    // supply group from our groupArray
>> >    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
>> >  }
>> > }
>> >
>> > I can then add the Radios and RadioGroups to the form independently of
>> > layout and this has the desired effect in terms of the grouping.
>> >
>> > 
>> >  < span wicket:id="radioGroupList">
>> >     < span wicket:id="radioGroup"/>
>> >  < /span>
>> >  
>> >    
>> >
>> > But now, when I submit I am getting the following error:
>> >
>> > WicketMessage: submitted http post value [radio33] for RadioGroup
>> component
>> >
>> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
>>
>> > is illegal because it does not contain relative path to a Radio
>> componnet.
>> > Due to this the RadioGroup component cannot resolve the selected Radio
>> > component pointed to by the illegal value. A possible reason is that
>> > componment hierarchy changed between rendering and form submission.
>> >
>> > Any idea what this means?
>> >
>> > The spelling mistake 'componment' sugge

Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

2010-11-03 Thread Igor Vaynberg
best way for us to help you is for you to create a quickstart and
attach it to your email or a jira issue.

-igor

On Wed, Nov 3, 2010 at 4:40 AM, tommy  wrote:
>
> I asked the following question on stack-overflow but was advised to ask here
> instead.
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
>
> I am using Wicket and would like to create a grid of radio buttons using
> html as shown below (outer lists will be displayed vertically, inner lists
> will be displayed horizontally).
>
> I would like the radio buttons grouped vertically.
>
> 
>  
>    
>       
>       
>       
>    
>  
>  
>    
>       
>       
>       
>    
>  
>  
>    
>       
>       
>       
>    
>  
> 
>
> Unfortunately it seems that RadioGroup only allow one to group radio buttons
> according to the grouping defined by their layout.
>
> eg RadioGroup group = new RadioGroup("radioGroupA");
>
> group.add( new Radio("myradio", new Model(1)) ;
>
> Problem with this is that I cannot then layout the way I want.
>
> Is there another way? Manually specifying the name and gather results?
>
> UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one can
> do something like:
>
> // create some groups
> for (0..n) {
>  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
>  groupArray.add(group)
> }
>
> //create a ListView for the RadioGroups so we can attach them to page
> ListView radioListView = ListView("radioGroupList") { populate from
> groupArray }
> add(radioListView);
>
> // create our grid of radio buttons
> // outer -> rows
> for (0..x) {
>  // inner -> columns
>  for (0..n)
>    // supply group from our groupArray
>    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
>  }
> }
>
> I can then add the Radios and RadioGroups to the form independently of
> layout and this has the desired effect in terms of the grouping.
>
> 
>  < span wicket:id="radioGroupList">
>     < span wicket:id="radioGroup"/>
>  < /span>
>  
>    
>
> But now, when I submit I am getting the following error:
>
> WicketMessage: submitted http post value [radio33] for RadioGroup component
> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
> is illegal because it does not contain relative path to a Radio componnet.
> Due to this the RadioGroup component cannot resolve the selected Radio
> component pointed to by the illegal value. A possible reason is that
> componment hierarchy changed between rendering and form submission.
>
> Any idea what this means?
>
> The spelling mistake 'componment' suggests it's not seen too often.
>
> I am using wicket 1.4.12.
>
> I found this ticket that looks related too :
> https://issues.apache.org/jira/browse/WICKET-1055
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.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



Re: BrowserInfoPage issues.

2010-11-02 Thread Igor Vaynberg
feel free to create the jira issues, and hopefully provide patches

-igor

2010/11/2 Michał Letyński :
> Hi.
> I found two problems while using wicket BrowserInfoPage.
>
> 1) Browser page can be shown for couple of seconds when page to which it
> redirects is heavy.  Browser page has english hardcoded label
>
> "If you see this, it means that both javascript and meta-refresh are not
> support by  your browser configuration. Please click this link to continue
> to the original destination."
>
> This text is misleading in case when pages are loading quite long. It should
> be fixed:
> a) message should be localized
> b) provide two messages, one when user cannot redirect(original one), second
> when page is redirecting
>
> 2) Browser page is shown when we are getting client info
> (Session#getClientInfo()) for the first time. When on page we have
> AjaxLazyLoadPanel which loads much data its possible that before it finish
> to load original panel, browser page will be shown.
> So when browser page is shown and ajax lazy panel will finish loading we get
> beatiful xml inside our browser with no redirect.
>
> I know how to workaround them: 1) providing own browserpage 2) geting client
> info on page constructor. But its not the case, can i create jirra issues
> for both problems ?
>
> -
> 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-ajax header from url?

2010-11-02 Thread Igor Vaynberg
the url parameter is there only as a workaround for when we cannot set
the header. i think the only usecase is for fileuploads where we have
to set an ajax url on iframe's src attribute. the header is the
preferred way to do this and you can set it yourself i you need or use
wicket's ajax js to perform the request - which will set it for you.

-igor

On Mon, Nov 1, 2010 at 11:59 PM, Frank van Lankvelt
 wrote:
> well, the two kinds of ajax requests differ; the WebRequest#isAjax method
> returns true for wicket-ajax, but false for non-wicket-ajax requests.  The
> 'wicket-ajax' request has the Wicket-Ajax header, the other does not.  So I
> should have said that the first (locking) request was non-wicket-ajax; i.e.
> an ajax request but without the Wicket-Ajax header set.
>
> Some further digging turned up the wicket:ajax request parameter; I guess I
> should simply append it to the URL for the non-wicket-ajax behavior.
>  Perhaps that could happen in the base class AbstractAjaxBehavior?
>
> cheers, Frank
>
> On Tue, Nov 2, 2010 at 1:14 AM, Igor Vaynberg wrote:
>
>> so why is there the non-ajax request?
>>
>> once the page is loaded everything else - communication with ext -
>> should be happening via ajax requests...
>>
>> -igor
>>
>> On Mon, Nov 1, 2010 at 1:20 PM, Frank van Lankvelt
>>  wrote:
>> > it returned false because
>> > a) the locking request was not ajax
>> > b) the current request was ajax
>> > c) they shared the same page version
>> > Page versioning is disabled, though that shouldn't matter.  (that might
>> be a
>> > worthwhile additional check before comparing versions; I'm not very
>> familiar
>> > with versions)
>> >
>> > It's a concurrency issue for one page, with some non-wicket-ajax
>> behaviors,
>> > so it might be pushing what people have seen?
>> >
>> > Both ext-js integration projects I've found have the same basic setup;
>> use
>> > AbstractAjaxBehavior to provide data services, use
>> > AbstractDefaultAjaxBehavior subclasses for listening to Ext events.  So
>> > that's also where my bug occurs; I'm switching between ext components on
>> the
>> > client as the result of some action.  The action leads to a notification
>> to
>> > wicket, the new component starts fetching data.
>> >
>> > thanks, Frank
>> >
>> > On Mon, Nov 1, 2010 at 5:28 PM, Igor Vaynberg > >wrote:
>> >
>> >> did you check why it returns false? ajax requests should not increment
>> >> the page version, so they should always be "current". people have
>> >> built extjs integrations before, you may look into one of those for
>> >> hints.
>> >>
>> >> -igor
>> >>
>> >> On Mon, Nov 1, 2010 at 9:14 AM, Frank van Lankvelt
>> >>  wrote:
>> >> > In my attempts to integrate a javascript client-side framework
>> (ext-js)
>> >> to
>> >> > wicket, I'm running into the problem that the client-side framework
>> >> expects
>> >> > URLs to send requests to, expecting a JSON/XML response.  This is of
>> >> course
>> >> > perfectly natural behavior for a js framework.
>> >> >
>> >> > The documentation I could find suggested to use an
>> AbstractAjaxBehavior.
>> >> >  However, this doesn't quite work.  Concurrent proper wicket-ajax
>> >> requests
>> >> > (abstractdefaultajaxbehavior) are aborted due to
>> >> > WebSession#isCurrentRequestValid returning false.
>> >> >
>> >> > Am I doing something wrong here, or should I simply override the
>> >> > isCurrentRequestValid method to always return true?
>> >> >
>> >> > thanks, Frank
>> >> >
>> >> > PS: I'm using wicket-1.4.9; but couldn't find relevant issues that
>> have
>> >> been
>> >> > fixed since this release
>> >> >
>> >> > --
>> >> > Hippo
>> >> > Europe  •  Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31 (0)20
>> >> 522
>> >> > 4466
>> >> > USA  • San Francisco  185 H Street Suite B  •  Petaluma CA 94952-5100
>> •
>> >>  +1
>> >> > (707) 773 4646
>> >> > Canada    •   Montréal  5369 Boulevard St-Laurent #430 •  Montréal QC
>> H2T
>> >> > 1S5  •  +1 (514) 316 8966
>&

Re: wicket-ajax header from url?

2010-11-01 Thread Igor Vaynberg
so why is there the non-ajax request?

once the page is loaded everything else - communication with ext -
should be happening via ajax requests...

-igor

On Mon, Nov 1, 2010 at 1:20 PM, Frank van Lankvelt
 wrote:
> it returned false because
> a) the locking request was not ajax
> b) the current request was ajax
> c) they shared the same page version
> Page versioning is disabled, though that shouldn't matter.  (that might be a
> worthwhile additional check before comparing versions; I'm not very familiar
> with versions)
>
> It's a concurrency issue for one page, with some non-wicket-ajax behaviors,
> so it might be pushing what people have seen?
>
> Both ext-js integration projects I've found have the same basic setup; use
> AbstractAjaxBehavior to provide data services, use
> AbstractDefaultAjaxBehavior subclasses for listening to Ext events.  So
> that's also where my bug occurs; I'm switching between ext components on the
> client as the result of some action.  The action leads to a notification to
> wicket, the new component starts fetching data.
>
> thanks, Frank
>
> On Mon, Nov 1, 2010 at 5:28 PM, Igor Vaynberg wrote:
>
>> did you check why it returns false? ajax requests should not increment
>> the page version, so they should always be "current". people have
>> built extjs integrations before, you may look into one of those for
>> hints.
>>
>> -igor
>>
>> On Mon, Nov 1, 2010 at 9:14 AM, Frank van Lankvelt
>>  wrote:
>> > In my attempts to integrate a javascript client-side framework (ext-js)
>> to
>> > wicket, I'm running into the problem that the client-side framework
>> expects
>> > URLs to send requests to, expecting a JSON/XML response.  This is of
>> course
>> > perfectly natural behavior for a js framework.
>> >
>> > The documentation I could find suggested to use an AbstractAjaxBehavior.
>> >  However, this doesn't quite work.  Concurrent proper wicket-ajax
>> requests
>> > (abstractdefaultajaxbehavior) are aborted due to
>> > WebSession#isCurrentRequestValid returning false.
>> >
>> > Am I doing something wrong here, or should I simply override the
>> > isCurrentRequestValid method to always return true?
>> >
>> > thanks, Frank
>> >
>> > PS: I'm using wicket-1.4.9; but couldn't find relevant issues that have
>> been
>> > fixed since this release
>> >
>> > --
>> > Hippo
>> > Europe  •  Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31 (0)20
>> 522
>> > 4466
>> > USA  • San Francisco  185 H Street Suite B  •  Petaluma CA 94952-5100 •
>>  +1
>> > (707) 773 4646
>> > Canada    •   Montréal  5369 Boulevard St-Laurent #430 •  Montréal QC H2T
>> > 1S5  •  +1 (514) 316 8966
>> > www.onehippo.com  •  www.onehippo.org  •  i...@onehippo.com
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Hippo
> Europe  •  Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31 (0)20 522
> 4466
> USA  • San Francisco  185 H Street Suite B  •  Petaluma CA 94952-5100 •  +1
> (707) 773 4646
> Canada    •   Montréal  5369 Boulevard St-Laurent #430 •  Montréal QC H2T
> 1S5  •  +1 (514) 316 8966
> www.onehippo.com  •  www.onehippo.org  •  i...@onehippo.com
>

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



Re: Really basic help...

2010-11-01 Thread Igor Vaynberg
it pulls that value out of its model, so check whatever object the
model is pointing to.

-igor

On Mon, Nov 1, 2010 at 7:44 AM, adam.gibbons  wrote:
>
> Hi there!
>
> I'm extreamly new to Whicket, trying to put together my first sample
> application based on the AuthenticatedWebSession example.
>
> I have everything up and running nicely now, but I'd like to make a few
> simple changes.
>
> On the LoginPage, there are feilds for username, password and a check box
> for 'remeber me'.
>
> I want the username feild to be empty, but it always says "support", I can
> not find anywhere in the code where this is set or any way to change it to
> something I want.
>
> In my page's constructor I can get the TextField object for the username
> feild using get("signInPanel:signInForm:username"), but I don't see any
> methods for getting or setting the value...
> I'm sure i'm missing something very obvious!! Any help would be much
> appriciated!!
>
> Kind regards,
> Adam
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Really-basic-help-tp3022249p3022249.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



Re: wicket-ajax header from url?

2010-11-01 Thread Igor Vaynberg
did you check why it returns false? ajax requests should not increment
the page version, so they should always be "current". people have
built extjs integrations before, you may look into one of those for
hints.

-igor

On Mon, Nov 1, 2010 at 9:14 AM, Frank van Lankvelt
 wrote:
> In my attempts to integrate a javascript client-side framework (ext-js) to
> wicket, I'm running into the problem that the client-side framework expects
> URLs to send requests to, expecting a JSON/XML response.  This is of course
> perfectly natural behavior for a js framework.
>
> The documentation I could find suggested to use an AbstractAjaxBehavior.
>  However, this doesn't quite work.  Concurrent proper wicket-ajax requests
> (abstractdefaultajaxbehavior) are aborted due to
> WebSession#isCurrentRequestValid returning false.
>
> Am I doing something wrong here, or should I simply override the
> isCurrentRequestValid method to always return true?
>
> thanks, Frank
>
> PS: I'm using wicket-1.4.9; but couldn't find relevant issues that have been
> fixed since this release
>
> --
> Hippo
> Europe  •  Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31 (0)20 522
> 4466
> USA  • San Francisco  185 H Street Suite B  •  Petaluma CA 94952-5100 •  +1
> (707) 773 4646
> Canada    •   Montréal  5369 Boulevard St-Laurent #430 •  Montréal QC H2T
> 1S5  •  +1 (514) 316 8966
> www.onehippo.com  •  www.onehippo.org  •  i...@onehippo.com
>

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



Re: Wicket Stuff TinyMCE Update?

2010-10-29 Thread Igor Vaynberg
you are in

-igor

On Fri, Oct 29, 2010 at 10:26 AM, Josh Glassman  wrote:
> Ok, will talk to him.  My sf username is joshums.
>
> On Fri, Oct 29, 2010 at 1:14 PM, Igor Vaynberg  
> wrote:
>> whats your sf.net username? i can give you access to svn.
>>
>> as far as builds, Michael O'Cleirigh takes care of those on regular
>> basis. you might want to talk to him if you want more details.
>>
>> -igor
>>
>> On Fri, Oct 29, 2010 at 10:05 AM, Josh Glassman  wrote:
>>> I would be willing to do so, at least temporarily.  How do I get
>>> commit permissions, and how do I get a build created and installed to
>>> the maven repo?
>>>
>>> On Fri, Oct 29, 2010 at 11:44 AM, Igor Vaynberg  
>>> wrote:
>>>> dont think anyone is maintaining the project. you are welcome to take it 
>>>> over.
>>>>
>>>> -igor
>>>>
>>>> On Fri, Oct 29, 2010 at 8:40 AM, Josh Glassman  wrote:
>>>>> Hi All,
>>>>>
>>>>> Who if anyone is in charge of the Wicket Stuff TinyMCE project?
>>>>>
>>>>> I have been having some issues with it and noticed that the TinyMCE
>>>>> files have not been updated since the initial 3.3 release.  I tried
>>>>> simply replacing the tiny_mce folder inside a copy of the
>>>>> tinymce-1.4.12.jar with the latest from the website and my issues are
>>>>> completely gone now.  Is there any chance we could get an updated
>>>>> release with the newer files?
>>>>>
>>>>> Now another question is coming to mind, is there any sort of standard
>>>>> defined for how often an included dependency like this should be
>>>>> updated?  On one hand it would be nice to always have the most
>>>>> up-to-date files available through maven, but on the other hand that
>>>>> could be very time and resource consuming depending on how often the
>>>>> dependency is updated.  Thoughts?  Suggestions?
>>>>>
>>>>> -
>>>>> 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
>
>

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



Re: Wicket Stuff TinyMCE Update?

2010-10-29 Thread Igor Vaynberg
whats your sf.net username? i can give you access to svn.

as far as builds, Michael O'Cleirigh takes care of those on regular
basis. you might want to talk to him if you want more details.

-igor

On Fri, Oct 29, 2010 at 10:05 AM, Josh Glassman  wrote:
> I would be willing to do so, at least temporarily.  How do I get
> commit permissions, and how do I get a build created and installed to
> the maven repo?
>
> On Fri, Oct 29, 2010 at 11:44 AM, Igor Vaynberg  
> wrote:
>> dont think anyone is maintaining the project. you are welcome to take it 
>> over.
>>
>> -igor
>>
>> On Fri, Oct 29, 2010 at 8:40 AM, Josh Glassman  wrote:
>>> Hi All,
>>>
>>> Who if anyone is in charge of the Wicket Stuff TinyMCE project?
>>>
>>> I have been having some issues with it and noticed that the TinyMCE
>>> files have not been updated since the initial 3.3 release.  I tried
>>> simply replacing the tiny_mce folder inside a copy of the
>>> tinymce-1.4.12.jar with the latest from the website and my issues are
>>> completely gone now.  Is there any chance we could get an updated
>>> release with the newer files?
>>>
>>> Now another question is coming to mind, is there any sort of standard
>>> defined for how often an included dependency like this should be
>>> updated?  On one hand it would be nice to always have the most
>>> up-to-date files available through maven, but on the other hand that
>>> could be very time and resource consuming depending on how often the
>>> dependency is updated.  Thoughts?  Suggestions?
>>>
>>> -
>>> 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



Re: Wicket Stuff TinyMCE Update?

2010-10-29 Thread Igor Vaynberg
dont think anyone is maintaining the project. you are welcome to take it over.

-igor

On Fri, Oct 29, 2010 at 8:40 AM, Josh Glassman  wrote:
> Hi All,
>
> Who if anyone is in charge of the Wicket Stuff TinyMCE project?
>
> I have been having some issues with it and noticed that the TinyMCE
> files have not been updated since the initial 3.3 release.  I tried
> simply replacing the tiny_mce folder inside a copy of the
> tinymce-1.4.12.jar with the latest from the website and my issues are
> completely gone now.  Is there any chance we could get an updated
> release with the newer files?
>
> Now another question is coming to mind, is there any sort of standard
> defined for how often an included dependency like this should be
> updated?  On one hand it would be nice to always have the most
> up-to-date files available through maven, but on the other hand that
> could be very time and resource consuming depending on how often the
> dependency is updated.  Thoughts?  Suggestions?
>
> -
> 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 1.5 and GAE

2010-10-27 Thread Igor Vaynberg
storing pages is part of what the new IPageManager interface does. see
DefaultPageManagerProvider and Application.setPageManagerProvider()

-igor

On Wed, Oct 27, 2010 at 1:00 PM, Ben Tilford  wrote:
> Has the extension point for setting your page store changed? I believe
> newSessionStore() has been removed in 1.5
>
>
>
>
> In wicket 1.4 this is what was needed in you Application
>
>
>
> @Override
>        protected void init() {
>                super.init();
>
>                //remove thread monitoring from resource watcher
>                this.getResourceSettings().setResourcePollFrequency(null);
>        }
>
> @Override
>
>
>        protected ISessionStore newSessionStore()
>        {
>                return new HttpSessionStore(this);//            return new
> SecondLevelCacheSessionStore(this, new InMemoryPageStore());
>        }
>
>
> On Wed, Oct 27, 2010 at 12:56 PM, Igor Vaynberg 
> wrote:
>
>> you will need to provide your own page store, everything else will work i
>> think.
>>
>> -igor
>>
>> On Wed, Oct 27, 2010 at 12:52 PM, Alex Objelean 
>> wrote:
>> >
>> > Is there a way to make wicket-1.5 to work with Google App Engine?
>> >
>> > Thanks,
>> > Alex
>> > --
>> > View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-GAE-tp3016185p3016185.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
>>
>>
>

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



Re: Wicket 1.5 and GAE

2010-10-27 Thread Igor Vaynberg
a purely http session based store is something that will be added
sometime soon. do create a jira issue so we wont forget :)

-igor

On Wed, Oct 27, 2010 at 1:05 PM, Alex Objelean  wrote:
>
> I was expecting to have a PageStore already available, instead of
> implementing one from scratch.
> Is it possible to add one to the trunk?
>
> Thanks!
> Alex
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-GAE-tp3016185p3016212.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



Re: Wicket 1.5 and GAE

2010-10-27 Thread Igor Vaynberg
you will need to provide your own page store, everything else will work i think.

-igor

On Wed, Oct 27, 2010 at 12:52 PM, Alex Objelean  wrote:
>
> Is there a way to make wicket-1.5 to work with Google App Engine?
>
> Thanks,
> Alex
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-GAE-tp3016185p3016185.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



Re: Avoid getObject on Model if component not rendered

2010-10-21 Thread Igor Vaynberg
correct. onconfigure() can be used to control visibility - which
includes making an invisible component visible.

-igor

On Thu, Oct 21, 2010 at 1:00 PM, Bas Gooren  wrote:
> AFAIK onConfigure() is _always_ called, also when a Component is invisible;
> If I recall correctly this was done to remove the
> "callOnBeforeRenderIfInvisble()" method and switching visibility in
> onBeforeRender().
>
> Bas
>
> - Original Message - From: "Jeremy Thomerson"
> 
> To: 
> Sent: Thursday, October 21, 2010 9:56 PM
> Subject: Re: Avoid getObject on Model if component not rendered
>
>
>> Or, just set the default value in onConfigure of the dropdownchoice
>> itself,
>> which will not be called if the ddc is not visible.
>>
>> On Thu, Oct 21, 2010 at 2:52 PM, Hans Lesmeister  wrote:
>>
>>> Create and add the DropDownChoice in onInitialize(). If the component is
>>> not rendered then that method will not be called (untested)
>>>
>>> @Override
>>> protected void onInitialize() {
>>>  super.onInitialize();
>>>  final DropDownChoice usersChoice = new
>>>   DropDownChoice("usersList", customUserModel,
>>> usersListModel,
>>> new
>>>     ChoiceRenderer("username"));
>>>  usersChoice.setNullValid(false);
>>>  usersChoice.setModelObject(usersChoice.getChoices().get(0));
>>>  usersChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
>>> ...
>>>
>>> Regards
>>> Hans
>>> ___
>>> WEB.DE DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
>>> gratis Notebook-Flat! http://produkte.web.de/go/DSL_Doppel_Flatrate/2
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Jeremy Thomerson
>> http://wickettraining.com
>> *Need a CMS for Wicket?  Use Brix! http://brixcms.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



Re: Dropdrown mapping from Object to string?

2010-10-21 Thread Igor Vaynberg
do it in the ddc's model

-igor

On Thu, Oct 21, 2010 at 3:14 AM, nino martinez wael
 wrote:
> Thats not the problem... The problem are that the dropdown consists of
> Queue's and the backing model just are a string so I need to somehow convert
> the string from and to a queue..
>
> 2010/10/21 Andrea Del Bene 
>
>> Hi Nino,
>>
>> what kind of Model are you using as backing model? You can try nesting
>> models to extract string property from object
>> For example: >
>> See  IChainingModel for further informations.
>>
>>
>>  Hi
>>>
>>> I have an dropdown which gets feed a Queue list, I have a custom renderer
>>> which then select the name property as displayvalue. Now the property it's
>>> setting on the backing model are just a string which of course will not
>>> take
>>> a queue instance. So should I use a custom converter for this or something
>>> else?
>>>
>>>
>>> regards Nino
>>>
>>>
>>>
>>
>>
>> -
>> 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: Session.attach

2010-10-20 Thread Igor Vaynberg
we started doing that in 1.5. egg see
RequestCycle#register(detachCallback). add an rfe for something like
irequestlistener { onbegin()/onend()}

-igor

On Wed, Oct 20, 2010 at 2:31 PM, James Carman
 wrote:
> Is there any chance, since we can break the API a bit, that we can try
> to introduce a more "listenery" method for stuff like this, rather
> than overriding methods?  Developing frameworks for Wicket is
> difficult because in order to use these "hooks" you have to have your
> custom code installed (such as a request cycle, session, etc.).  What
> if other frameworks want to do the same thing?  They can't live in the
> same webapp.  It would be great if we could just register a listener
> for these kinds of things.
>
> On Wed, Oct 20, 2010 at 2:45 PM, Jeremy Thomerson
>  wrote:
>> On Wed, Oct 20, 2010 at 1:44 PM, jowen.gsb  wrote:
>>
>>>
>>> Since Session.attach() is deprecated, where would the best place be to put
>>> code instead? The current use case is to check that a user has not been
>>> deleted/disabled between request cycles.
>>>
>>>        /**
>>>         * Any attach logic for session subclasses. Called when a session is
>>> set
>>> for the thread.
>>>         *
>>>         * @deprecated will not be available in 1.5+
>>>         */
>>>       �...@deprecated
>>>        protected void attach()
>>>        {
>>>        }
>>>
>>> --
>>> View this message in context:
>>> http://apache-wicket.1842946.n4.nabble.com/Session-attach-tp3004389p3004389.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
>>>
>>>
>> RequestCycle#onBeginRequest?
>>
>> --
>> Jeremy Thomerson
>> http://wickettraining.com
>> *Need a CMS for Wicket?  Use Brix! http://brixcms.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



Re: setEnabled based on Model

2010-10-20 Thread Igor Vaynberg
or better yet, override onconfigure() and call setvisible/enabled from there

-igor

On Wed, Oct 20, 2010 at 10:04 AM, Jeremy Thomerson
 wrote:
> On Wed, Oct 20, 2010 at 12:00 PM, Andrei Razin wrote:
>
>>
>> Sorry for the Type:
>>
>> I meant:
>> My problem is: "setEnabled" does not take iModel as argumet.
>> I'd like to do something like setEnabled(new PropertyModel(doc,
>> "canDelete")
>>
>
> override isVisible instead:
>
> @Override
> public boolean isVisible() {
>  return getModelObject().canDelete();
> }
>
> remember that if you reference doc directly in your isVisible method, it
> will be serialized, so it's better to give the component a
> loadabledetachablemodel and reference it through the model object as shown
> (depending on what doc is - I'm assuming you won't want it serialized, but
> you may not care depending on where this is).
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

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



Re: Using JavaScript to check a field by id, when Wicket will change the id

2010-10-20 Thread Igor Vaynberg
only if you or something else calls setoutputmarkupid(true)

-igor

On Wed, Oct 20, 2010 at 10:30 AM, Jeremy Thomerson
 wrote:
> On Wed, Oct 20, 2010 at 12:26 PM, Arjun Dhar  wrote:
>
>> In my opinion; wicket doesn't mess with the "id" attribute till you tell it
>> to. There are multiple means to change the id. but by default the id is not
>> touched.
>>
>> Note: wicket:id is not the same as "id" of the HTML DOM element. So if you
>> define an "id" in the markup it should stick.
>>
>> As per your quote::
>> "because if the field is controlled by Wicket, the id will change. " -- You
>> can choose what attributes are controlled by wicket. its not like an all or
>> nothing scenario.
>>
>
> Actually, Wicket really does change your markup ID by default.  Try adding a
> field to the page like 'new Label("name", someModel)' and you will end up
> with  or something like that, depending on
> other components on the page, if it's in a repeater, etc.
>
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

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



Re: SSL Links and buttons

2010-10-20 Thread Igor Vaynberg
look at the requests and make sure that the httpsrequestcycleprocessor
is not doing a secure->unsecure redirect which would lose the form
values.

-igor

On Wed, Oct 20, 2010 at 12:05 AM, sonxurxo  wrote:
>
> Hi Igor, thank you for your response.
>
> I tried what you pointed. The action URL in the form is correctly replaced,
> since I can see it with Firebug. And even Wicket receives the request when
> pressing the submit button, but it fails on validating required fields: it
> does not receive the values, neither with theFormField.getInput() (returns
> "") nor theFormField.getDefaultModelObjectAsString() (returns null).
> Just in case it matters, I'm trying it both with Jetty (http port:9090,
> https port:8443) and with Tomcat (http port:80 -with mod_jk, https
> port:443), so I modified the onComponentTag method you post and my
> SecureForm class now looks like:
>
>
> public class SecureForm extends Form {
>
>        public SecureForm(String id) {
>                super(id);
>        }
>
>       �...@override
>        protected void onComponentTag(ComponentTag tag) {
>                super.onComponentTag(tag);
>                String action = tag.getAttribute("action");
>                action = RequestUtils.toAbsolutePath(action);
>                action = "https" + action.substring(4);
>                action = action.replace(MyApplication.get().getHttpPort(),
>                                MyApplication.get().getHttpsPort());
>                tag.put("action", action);
>        }
> }
>
>
> but that modification doesn't seem to be a problem since the action URL
> looks OK in both cases (the port number is well replaced). Debugging with
> Firebug I can see that the field values are correctly sent by POST.
> More possible important info: the form is included in a Page that is NOT
> annotated with @RequireHttps.
>
> Am I missing something? Any ideas? Thank you in advance.
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/SSL-Links-and-buttons-tp3001634p3003364.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



Re: Stuck: Can't get Checkboxes in DataTable to update model

2010-10-19 Thread Igor Vaynberg
i resemble that remark

-igor

On Tue, Oct 19, 2010 at 3:07 PM, James Carman
 wrote:
> That may be true. :)  There's always one in every crowd.
>
> On Tue, Oct 19, 2010 at 6:05 PM, Igor Vaynberg  
> wrote:
>> so you are paying it backward :)
>>
>> -igor
>>
>> On Tue, Oct 19, 2010 at 3:00 PM, James Carman
>>  wrote:
>>> I'm just paying it forward.  I most certainly get more help here than
>>> I give! :)  Glad to help.  Happy Wicketeering!
>>>
>>> On Tue, Oct 19, 2010 at 5:08 PM, leech  wrote:
>>>>
>>>> You Be The Man James!
>>>>
>>>> Thankyou. That did it.
>>>> --
>>>> View this message in context: 
>>>> http://apache-wicket.1842946.n4.nabble.com/Stuck-Can-t-get-Checkboxes-in-DataTable-to-update-model-tp3002773p3002826.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
>>>
>>>
>>
>> -
>> 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



Re: Stuck: Can't get Checkboxes in DataTable to update model

2010-10-19 Thread Igor Vaynberg
so you are paying it backward :)

-igor

On Tue, Oct 19, 2010 at 3:00 PM, James Carman
 wrote:
> I'm just paying it forward.  I most certainly get more help here than
> I give! :)  Glad to help.  Happy Wicketeering!
>
> On Tue, Oct 19, 2010 at 5:08 PM, leech  wrote:
>>
>> You Be The Man James!
>>
>> Thankyou. That did it.
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Stuck-Can-t-get-Checkboxes-in-DataTable-to-update-model-tp3002773p3002826.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
>
>

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



Re: SSL Links and buttons

2010-10-19 Thread Igor Vaynberg
so far i dont think there are any plans to support ssl forms outside
of @RequireHttps

here is something that might work for you though:

class secureform extends form {
  oncomponenttag(tag) {
super.oncomponenttag(tag);
string act=tag.get('action");
act=rqeuestutils.toabsoluteurl(act);
act="https"+act.substring(4);
tag.put("action", act);
  }
}

-igor

On Tue, Oct 19, 2010 at 1:15 AM, sonxurxo  wrote:
>
> Hi all,
> This question applies to Wicket 1.4.9.
> I have an app where I have a Sign-in component (Panel) that is shown in
> (almost) every page of the site. I'd like all the app to work over http, and
> that form to work over https. Since the @RequireHttps annotation only works
> on pages and not Components, how can I achieve that?
> I have some other pages (e.g. registration page) that is fully working over
> https with the mentioned annotation, everything is OK. But I can not get the
> sign-in form (included in quite some http-pages) work over https.
> Any ideas?
> If there's a core developer reading this, is there any plan of "extending"
> the @RequireHttps annotation to other Components rather than just pages?
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/SSL-Links-and-buttons-tp3001634p3001634.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



Re: MarkupContainer's ComponentSourceEntry

2010-10-18 Thread Igor Vaynberg
On Mon, Oct 18, 2010 at 4:13 PM, richard emberson
 wrote:
> If I might ask a couple of follow-up questions?
>
> Is the primary driver for having the ability to
> dehydrate Components:
>    1) Lessening in-memory RAM usage,

yes. certain usecases require for a lot of components that are simple
labels, as such they have a lot of overhead. if a page displays 1000
labels it is a big waste. the idea was that once the page rendered
waht will be stored are the dehydrated versions of these 1000 labels
which will take up a tiny fraction of space.

>    2) Faster serialization,
>    3) Network transmission speed for machine-to-machine
>        transfer of Components, or
>    4) Lessening disk usage when Components are stored on
>        disk?

these are all derivatives of (1)

> Next, regardless of the driver, they are all good goals.
> Was any consideration given to refactoring the Object/Interface
> hierarchy so that 1) MarkupContainer could simply hold
> one type of Object (an IComponent) with an API that supports
> the wet/dry water state of Components (this would simplify
> the MarkupContainer code) and 2) maybe have a higher-level
> hydration interface so that things other than Components
> could support wet/dry states?

i dont think any one of the core developers is actively working on
this, so i dont think we have the cycles to put into analyzing the
possible ways of doing this right now.

the markupcontainer children is already object[] not componet[]. i
think the only piece of code that is missing is an
IComponentSourceProvider interface that components can implement and
functionality in container#detachchildren() that would replace
components with ComponentSourceEntry in the childrens array.

-igor

>
> For example (only):
>
> IHydratable
>  boolean isHydrated()
>  Object hydrated()
>  Object dehydrated()
>
>  IComponent extends IHydratable
>    Component hydrated(Component parent)
>    ComponentSourceEntry dehydrate(Component parent)
>
>    ComponentSourceEntry implements IComponent
>      boolean isHydrated() { return false; }
>      Component hydrated(Component parent) {
>        Component comp = (Component)hydrated()
>        .
>        return comp
>      }
>      ComponentSourceEntry dehydrate(Component parent) { return this;  }
>
>    Component implements IComponent
>      boolean isHydrated() { return true; }
>      Component hydrated(Component parent) { return this; }
>      ComponentSourceEntry dehydrate(Component parent) {
>        ComponentSourceEntry compSE = (ComponentSourceEntry)dehydrated()
>        .
>        return compSE
>      }
>
> Thanks
>
> Richard
>
>
> On 10/14/2010 11:20 AM, Igor Vaynberg wrote:
>>
>> this is an experimental feature that hasnt quiet been finished yet.
>> see IComponentSource.
>>
>> -igor
>>
>> On Thu, Oct 14, 2010 at 10:15 AM, richard emberson
>>   wrote:
>>>
>>> The MarkupContainer's ComponentSourceEntry is a private class with a
>>> private constructor. No where in the MarkupContainer code is an
>>> instance of ComponentSourceEntry created.
>>> Is ComponentSourceEntry something on its way out or some feature
>>> yet to be engaged?
>>>
>>> Richard
>>> --
>>> Quis custodiet ipsos custodes
>>>
>>> -
>>> 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
>>
>>
>
> --
> Quis custodiet ipsos custodes
>

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



Re: Need help with Nested DataTable in Form - finding values in submit method

2010-10-18 Thread Igor Vaynberg
you do this the same way as with all other form components, bind the
checkboxes to some model that stores the values in some field you can
access. AbstractCheckBoxModel may also be useful for this usecase.

-igor

On Mon, Oct 18, 2010 at 10:48 AM, leech  wrote:
>
> I think I posted this message to the wrong forum. So I'm correcting my
> mistake.
>
> I'm just getting started with Wicket.  I've looked at every example I can
> find related to checkboxes in forms but none of them answer my question.
> The wicket examples have nothing in the submit button code to describe how
> to do this.
>
>
> I have a form.  Inside the form is a nested datatable.  In the datatable is
> a column that has a check box
> in it.  I accomplished this by putting a panel in the cell and then a
> checkbox within the panel.  This is working fine. It runs, and the
> checkboxes are displayed properly.
>
> The problems start when I try to figure out what checkboxes were selected.
>
> When the submit button on the form is clicked, I want to know what
> checkboxes were selected.
> I want to do this within the submit button because there will be other
> buttons that do other tasks.
>
> How do I find the values I'm looking for?
>
> Lee
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Need-help-with-Nested-DataTable-in-Form-finding-values-in-submit-method-tp3000718p3000718.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



Re: Link onclick setMarkupId doesn't work.

2010-10-17 Thread Igor Vaynberg
listview.setreuseitems(true)

for what its worth it is better to pull then to push values.

-igor

On Sat, Oct 16, 2010 at 11:10 PM, always_rick  wrote:
>
> What I am trying to do is:
>
> if menu item is selected (onClick), change the markup  id or class.
>
> However, it doesn't seem to work. Am I missing something?
>
> html
>
> 
> 
> #
> 
> 
>
>
> wicket
>
> ListView listView = new ListView( "menuitem", menuItemList ) {
> @Override
> protected void populateItem( ListItem item ) {
>        final MenuItem menuItem = item.getModelObject();
>
>        Link link = new Link( "menuitemLink" ) {
>               �...@override
>                public void onClick() {
>                        MarkupContainer container = getParent();
>                        //System.out.println( "container: "+container );
>                        container.setMarkupId( "selected_menu_item" );
>                        //System.out.println( "container: 
> "+container.getMarkupId() );
>                        container.add( new SimpleAttributeModifier( "id", 
> "selected_menu_item" )
> );
>                        setResponsePage( menuItem.getPage() );
>                }
>        };
>        link.add( new Label( "menuitemName", menuItem.getId() ) );
>        item.add( link );
> }
>
> };
>
>
> Any help is much appreciated.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Link-onclick-setMarkupId-doesn-t-work-tp2998815p2998815.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



Re: MarkupContainer's ComponentSourceEntry

2010-10-14 Thread Igor Vaynberg
this is an experimental feature that hasnt quiet been finished yet.
see IComponentSource.

-igor

On Thu, Oct 14, 2010 at 10:15 AM, richard emberson
 wrote:
> The MarkupContainer's ComponentSourceEntry is a private class with a
> private constructor. No where in the MarkupContainer code is an
> instance of ComponentSourceEntry created.
> Is ComponentSourceEntry something on its way out or some feature
> yet to be engaged?
>
> Richard
> --
> Quis custodiet ipsos custodes
>
> -
> 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: How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-14 Thread Igor Vaynberg
your dropdown should call table.setcurrentpage(0)

-igor

On Thu, Oct 14, 2010 at 10:20 AM, gouthamrv  wrote:
>
> I have found the problem, now it is working as expected. But I am seeing one
> more issue with navigation bar message and numbers that it shows.
>
> First time when I load page, it shows "showing 1 to 10 of 50", now I clicked
> next arrow link and it shows "showing 11 to 20 of 50".
>
> After this, I changed my drop down chioce to get another list from data
> base. I am expecting that my table should display "showing 1 to 10 of 50",
> but instead it is shows "showing 11 to 20 of 50" (this is the last display
> message before changing drop down).
>
> When I log first and count numbers in my iterator(int first, int count)
> method in SortableDataProvider,  first number is not clearing out, it is
> just carrying every time.
>
> How do I solve this problem?
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2995758.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



Re: RequestCycle.getResponsePage and PageReferenceRequestTarget

2010-10-14 Thread Igor Vaynberg
fixed, thanks.

-igor

On Thu, Oct 14, 2010 at 9:07 AM, Alexander Morozov
 wrote:
>
> Hi ppl,
>
> can anybody explain me why RequestCycle.getResponsePage() not handle
> PageReferenceRequestTarget ? Is it by design or is it bug ?
>
>        public final Page getResponsePage()
>        {
>                IRequestTarget target = getRequestTarget();
>                if (target instanceof IPageRequestTarget)
>                {
>                        return ((IPageRequestTarget)target).getPage();
>                }
>                else if (target instanceof BookmarkablePageRequestTarget)
>                {
>                        return 
> ((BookmarkablePageRequestTarget)target).getPage();
>                }
>                return null;
>        }
>
>
> Thanks,
> Alexander
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/RequestCycle-getResponsePage-and-PageReferenceRequestTarget-tp2995603p2995603.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



Re: 1.5 RequestMapper and Form submit

2010-10-14 Thread Igor Vaynberg
make locale mapper the root mapper, that way all url generation and
resolving will run through it

-igor

On Thu, Oct 14, 2010 at 7:53 AM, marco.behler  wrote:
>
> I tried to swap out a tiny part of one of our old legacy (struts)
> applications, which is "clustered" on several servers but is absolutely
> stateless, so no session replication, no sticky sessions, nada. The old
> application reads the locale from the url every time
>
> Even though I'd love to store the locale in my session I'm trying to abuse
> Wicket this time for this particular tiny use case ;)
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/1-5-RequestMapper-and-Form-submit-tp2995427p2995484.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



Re: condition in AbstractAjaxTimerBehavior

2010-10-13 Thread Igor Vaynberg
if (!canrefresh()) { settimeout(  }


-igor

On Wed, Oct 13, 2010 at 4:37 AM, Maris Orbidans  wrote:
> Hi
>
> I need to periodically update a page unless some condition is met.
> I wrote javascript function canRefresh() and added like this:
>
> add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
> �...@override
>  protected void onTimer(final AjaxRequestTarget target) {
>    updateSessionConfigPanel(target);
>   }
>
>   @Override
>    protected CharSequence getCallbackScript() {
>      return "if (!canRefresh()) {"+ super.getCallbackScript()+"};";
>      }
>  });
>
> This is generated javascript.
>
> ]]>*/
>
> The problem is that once canRefresh() returns false timer stops. Is it
> possible to restart it?  Or a better way to implement conditional
> update?
>
>
> Maris
>
> -
> 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: MinimumValidator and Long problem

2010-10-12 Thread Igor Vaynberg
its not a syntax problem. you cant have code outside a method unless
its in a static {} block.

-igor

On Tue, Oct 12, 2010 at 3:25 PM, Jeremy Thomerson
 wrote:
> On Tue, Oct 12, 2010 at 5:07 PM, Zeldor  wrote:
>
>>
>> Changing it to :
>>
>> private TextField hire_worker_1 = new
>> TextField("hire_worker_1",
>> new Model());
>>             {
>>            hire_worker_1.setType(Long.class);
>>            }
>>
>> Does not change anything. And is it normal that Eclipse does not let me add
>> anything without enclosing in { }?
>>
>
> Seems like you have a syntax error perhaps a problem with an anonymous
> inner class.  You can use Pastebin to paste entire file and we can attempt
> to help.
>
>
>> BTW, is there any easy way to convert nulls to 0 when you submit empty
>> TextFields?
>>
>
> Create an IConverter and override getConverter
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

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



Re: wicket 1.5, resource gives error in log?

2010-10-12 Thread Igor Vaynberg
no, that shouldnt be there. file a bug please.

-igor

On Tue, Oct 12, 2010 at 3:49 AM, nino martinez wael
 wrote:
> Hi
>
> I have something where I reference an image directly in html, wicket has no
> idea what it should do with it so it passes the request to the servlet
> container.. And it works as I wanted, but should it give an error message?
> Or am I doing something wrong?
>
> html:
>  
>
> Log:
> ERROR [org.apache.wicket.request.cycle.RequestCycle]  - Unable to execute
> request. No suitable RequestHandler found.
> URL=images/icons/arrow_down_end.png
>
> regards Nino
>

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



<    5   6   7   8   9   10   11   12   13   14   >