Change page versioning query parameter

2017-11-10 Thread Marcel Barbosa Pinto
Hi,

How can I customize the parameter name for page versioning?

The default is like that: "mypage?0=", "mypage?1="
I'd like to have: "mypage?v=0", "mypage?v=1"

That's because by having the name "v" I can add filters for google
analytics data.
I am using the Wicket 8.

Thanks.

-- 

Marcel Barbosa Pinto


Wicket 8 - IChoiceRenderer

2017-10-12 Thread Marcel Barbosa Pinto
Hi guys,

Do we have Lambda support for the IChoiceRenderer in Wicket 8?

Would be nice to have this possibility:

DropDownChoice orderByChoice = new DropDownChoice<>(
"orderBy",
LambdaModel.of(filter::getOrderBy),
orderByChoiceList,
ChoiceRenderer.of(SelectOption::getValue, SelectOption:getKey)
    )
-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Adding confirmation to DropDownSelect

2017-10-10 Thread Marcel Barbosa Pinto
Hi, take a look at this example:

https://cwiki.apache.org/confluence/display/WICKET/Getting+user+confirmation

Cheers

Em 10 de out de 2017 13:49, "Nigel W"  escreveu:

> Hi,
>
> I am seeking some advice on how to address the following need:
>
> I have a DropDownSelect component which also has an
> AjaxComponentUpdatingBehavior attached which updates the underlying model
> when the selection changes.  I would like to be able to include a
> Confirmation dialog to enable the user to confirm that they want to make
> the new selection before the model is updated.
>
> I would appreciate any ideas or guidance on how I might go about this.
>
> Thanks,
>
> Nigel
>


Re: 302 Redirects triggered by Wicket when URL is same

2017-09-01 Thread Marcel Barbosa Pinto
Hi,

Are you using X-Forwarded headers sent by your balancer?

You can to override this method in you WicketApplication class to try to
debug the redirect:

@Override
protected WebResponse newWebResponse(final WebRequest webRequest, final
HttpServletResponse httpServletResponse) {

return new ServletWebResponse((ServletWebRequest) webRequest,
httpServletResponse) {
@Override
public String encodeRedirectURL(CharSequence url) {
String encodedUrl = super.encodeRedirectURL(url);
if (webRequest.getUrl().getProtocol() == "https") {
 //https
}
return encodedUrl;
}
};
}


On Fri, Sep 1, 2017 at 10:20 AM, tomask79 <tomas.klou...@embedit.cz> wrote:

> After some investigation this seems to be happening
> when HeapUsage at the affected node is almost 100%...
>
> Memory statistics by org.apache.wicket.protocol.
> http.requests.RequestLogger
> few moments before the mentioned redirect looping:
>
>
>
> I'm confused by the following:
>
> 1) Why wicket things that URL is changing when it's not!(response handler
> is
> RequestSettingRequestHandler)...
>
> 2) What triggers these requests...It has to be Wicket, because
> RequestSettingRequestHandler is response.
>
> Thanks for any kind of hint or help.
>
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-
> f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: How to use Apache Wicket to send a post request via Curl

2017-07-15 Thread Marcel Barbosa Pinto
They have an Android lib, maybe you can use it as a normal Java lib too:

https://developers.simplepay.ng/plugins/#android_repository_-_jcenter_and_mavencentral

Otherwise you would have to parse the json response all by yourself:

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

JsonObject postJson = buildJson(chargeDTO);
Entity payload = Entity.json(postJson.toString());

Client client = ClientBuilder.newClient();
Response response = client.target("https://checkout.simplepay.ng/;)
.path("v2/payments/card/charge/")
.queryParam("someparam", "somevalue")
.request(MediaType.APPLICATION_JSON_TYPE)
.header("Content-Type", "application/json")
.header("Authorization", getAuthorizationTokenHeader())
.post(payload);

if (response.getStatus() != 200) {
//error
}
else{
String jsonResponse = response.readEntity(String.class);
//parse the json
}





On Sat, Jul 15, 2017 at 7:52 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi,
>
> Wicket is not a swiss army knife.
> There are other libraries for making HTTP calls - HttpUrlConnection, Apache
> HttpComponents, OkHttp, ...
> Any of them can easily make POST calls.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Sat, Jul 15, 2017 at 11:04 AM, gasper <kunlethomps...@gmail.com> wrote:
>
> > Hello Wicketers,
> >
> > how can i make this work and get the response using Apache Wicket 6.x
> > It has been storming my head for days 
> > A working code sample will help a lot...
> >
> > Thanks
> >
> > POST https://checkout.simplepay.ng/v2/payments/card/charge/
> >
> > curl "https://checkout.simplepay.ng/v2/payments/card/charge/; \
> >  -d token= 'tk_iKdhkLxPZEaGoNodfWoEFW' \
> >  -d amount= '11' \
> >  -d amount_currency= 'NGN' \
> >  -u test_pr_demo: ‘test_pr_demo’'
> >
> > RESPONSE FORMAT
> >
> > {
> > u'customer':
> > {
> > u'address_city': u'',
> > u'address_postal': u'110001',
> > u'address': u'17 Da Silva St, Lekki, Lagos, Nigeria',
> >  u'email': u'jos...@simplepay.ng',
> >  u'phone': u'+2347035706380',
> >  u'address_state': None,
> >  u'address_country': u'NG',
> >  u'id': u'cus_CKX7mSkCFgkyiz4oHDY2mW'
> >  },
> >  u'created': 1494677790,
> >  u'response_code': 2,
> >  u'livemode': False,
> >  u'currency': u'NGN',
> >  u'source':
> >  {
> >  u'exp_month': 12,
> >  u'funding': u'credit',
> >  u'brand': u'VISA',
> >  u'object': u'card',
> >  u'last4': u'',
> >  u'exp_year': 2018,
> >  u'id': u'card_2aP8nZNtHDp9dkNPrbKsYc',
> >  u'is_recurrent': False
> >  },
> >  u'amount': 600, (amount in cents)
> >  u'payment_reference': u'1850877790146606',
> >  u'id': u'trans_67UQe4iSZQr6NdXjgBT57R',
> >  u'captured': True
> >  }
> >
> > 'response_code': 2,  Signifies a verified payment
> >
> >
> > --
> > View this message in context: http://apache-wicket.1842946.
> > n4.nabble.com/How-to-use-Apache-Wicket-to-send-a-post-
> > request-via-Curl-tp4678242.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
> >
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Enable CORS in Wicket Rest

2017-06-27 Thread Marcel Barbosa Pinto
Hi,

I think you could use this:

getCurrentWebResponse().addHeader("Access-Control-Allow-Origin", "
http://localhost:8080;);


On Tue, Jun 27, 2017 at 8:24 AM, Noven <noven_...@yahoo.com.invalid> wrote:

> Hello,
> Does anyone here face an issue about CORS when consuming wicket rest from
> javascript ajax?
>
> The sample errors are :
>
> Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
> remote resource at http://localhost:8080/api/statust. (Reason: CORS
> header ‘Access-Control-Allow-Origin’ missing).
> I am looking for solution to set the ‘Access-Control-Allow-Origin’ value
> in Wicket Rest.
>
> In SpringBoot REST, we can set the value like this :
>
>   @CrossOrigin(origins = "http://localhost:8080;)
> @GetMapping("/greeting")
> public Greeting greeting(@RequestParam(required=false,
> defaultValue="World") String name) {
> return new Greeting(counter.incrementAndGet(),
> String.format(template, name));
> }
>
> I really need this solution, since I have to do it in Wicket way.
>
> Thank you.
>
>


-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Balancer + HTTPS

2017-05-15 Thread Marcel Barbosa Pinto
Hi Martin,

The #sendRedirect sends a relative URL and them the servlet generates the
Location header with the original location with HTTP instead the
X-Forwarded-Proto scheme.
The balancer also sends a X-Host header, so I had to concatenate the host
and scheme to the URL before the #sendRedirect call.

Thanks.

On Mon, May 15, 2017 at 11:21 AM, Marcel Barbosa Pinto <
marcel.po...@gmail.com> wrote:

> Hi Martin,
>
> I've found something that could be related, at this line below, a new Url
> instance is created without being configured with the protocol. Is this URL
> relative or absolute?
>
> https://github.com/apache/wicket/blob/9e42a9548adb0da540e4e87d491f58
> 24e778537e/wicket-core/src/main/java/org/apache/wicket/
> core/request/mapper/PageInstanceMapper.java#L129
>
> I'll will try to debug the code later.
> Thanks.
>
>
>
>
> On Mon, May 15, 2017 at 3:56 AM, Martin Grigorov <mgrigo...@apache.org>
> wrote:
>
>> Hi,
>>
>> Put a breakpoint at org.apache.wicket.request.Url#getProtocol() and see
>> what it returns.
>> I guess the redirect is an absolute url and that's why it breaks.
>> See org.apache.wicket.protocol.http.servlet.ServletWebResponse#s
>> endRedirect
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Mon, May 15, 2017 at 5:01 AM, Marcel Barbosa Pinto <
>> marcel.po...@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > I am using a balancer which sends the X-Forwarded-Proto header to my
>> Wicket
>> > application.
>> >
>> > I`ve added the following filters:
>> >
>> >  getFilterFactoryManager()
>> > > .addSecuredRemoteAddressRequestWrapperFactory(null)
>> > > .addXForwardedRequestWrapperFactory(null);
>> > >
>> >
>> > And the HttpsMapper:
>> >
>> > setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
>> > > HttpsConfig())
>> > >
>> >
>> >
>> > And the following init-param into web.xml
>> >
>> > 
>> > >   protocolHeader
>> > >   X-Forwarded-Proto
>> > >  
>> > >
>> >
>> >
>> > When I debug I can see that the header is working inside a
>> > RequestCycleListener
>> >
>> > HttpServletRequest req = (HttpServletRequest)
>> > > cycle.getRequest().getContainerRequest();
>> > > System.out.println("-->" + req.getScheme() + " ==" +
>> > > req.getHeader("X-Forwarded-Proto");
>> > >
>> >
>> >
>> > The problem occurs when some versioned page is created and wicket
>> redirect
>> > it to the same URL but with the HTTP:// instead, for example:
>> >
>> > *https://*www.wicket.com/statefullPage
>> > -> Response header: 302 (Location: *http://*www.wicket.com/
>> > statefullPage*?1*
>> > )
>> >
>> > If I change it back to HTTPS it works:
>> >
>> > *https://*www.wicket.com/statefullPage
>> > *?1*
>> > *-> *Response 200 OK
>> >
>> > I believe that in some redirection logic the original schema is being
>> lost
>> > somehow, during page versioning.
>> > This problem only occurs when using the "X-Forwarded-Proto" header
>> >
>> > Using Wicket 7.6.0
>> > Any suggestions?
>> >
>> > Thanks!
>> >
>>
>
>
>
> --
>
> Marcel Barbosa Pinto
> 55 11 98255 8288
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Balancer + HTTPS

2017-05-15 Thread Marcel Barbosa Pinto
Hi Martin,

I've found something that could be related, at this line below, a new Url
instance is created without being configured with the protocol. Is this URL
relative or absolute?

https://github.com/apache/wicket/blob/9e42a9548adb0da540e4e87d491f5824e778537e/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/PageInstanceMapper.java#L129

I'll will try to debug the code later.
Thanks.




On Mon, May 15, 2017 at 3:56 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi,
>
> Put a breakpoint at org.apache.wicket.request.Url#getProtocol() and see
> what it returns.
> I guess the redirect is an absolute url and that's why it breaks.
> See org.apache.wicket.protocol.http.servlet.ServletWebResponse#
> sendRedirect
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, May 15, 2017 at 5:01 AM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi,
> >
> > I am using a balancer which sends the X-Forwarded-Proto header to my
> Wicket
> > application.
> >
> > I`ve added the following filters:
> >
> >  getFilterFactoryManager()
> > > .addSecuredRemoteAddressRequestWrapperFactory(null)
> > > .addXForwardedRequestWrapperFactory(null);
> > >
> >
> > And the HttpsMapper:
> >
> > setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
> > > HttpsConfig())
> > >
> >
> >
> > And the following init-param into web.xml
> >
> > 
> > >   protocolHeader
> > >   X-Forwarded-Proto
> > >  
> > >
> >
> >
> > When I debug I can see that the header is working inside a
> > RequestCycleListener
> >
> > HttpServletRequest req = (HttpServletRequest)
> > > cycle.getRequest().getContainerRequest();
> > > System.out.println("-->" + req.getScheme() + " ==" +
> > > req.getHeader("X-Forwarded-Proto");
> > >
> >
> >
> > The problem occurs when some versioned page is created and wicket
> redirect
> > it to the same URL but with the HTTP:// instead, for example:
> >
> > *https://*www.wicket.com/statefullPage
> > -> Response header: 302 (Location: *http://*www.wicket.com/
> > statefullPage*?1*
> > )
> >
> > If I change it back to HTTPS it works:
> >
> > *https://*www.wicket.com/statefullPage
> > *?1*
> > *-> *Response 200 OK
> >
> > I believe that in some redirection logic the original schema is being
> lost
> > somehow, during page versioning.
> > This problem only occurs when using the "X-Forwarded-Proto" header
> >
> > Using Wicket 7.6.0
> > Any suggestions?
> >
> > Thanks!
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Balancer + HTTPS

2017-05-14 Thread Marcel Barbosa Pinto
Hi,

I am using a balancer which sends the X-Forwarded-Proto header to my Wicket
application.

I`ve added the following filters:

 getFilterFactoryManager()
> .addSecuredRemoteAddressRequestWrapperFactory(null)
> .addXForwardedRequestWrapperFactory(null);
>

And the HttpsMapper:

setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
> HttpsConfig())
>


And the following init-param into web.xml


>   protocolHeader
>   X-Forwarded-Proto
>  
>


When I debug I can see that the header is working inside a
RequestCycleListener

HttpServletRequest req = (HttpServletRequest)
> cycle.getRequest().getContainerRequest();
> System.out.println("-->" + req.getScheme() + " ==" +
> req.getHeader("X-Forwarded-Proto");
>


The problem occurs when some versioned page is created and wicket redirect
it to the same URL but with the HTTP:// instead, for example:

*https://*www.wicket.com/statefullPage
-> Response header: 302 (Location: *http://*www.wicket.com/statefullPage*?1*
)

If I change it back to HTTPS it works:

*https://*www.wicket.com/statefullPage
*?1*
*-> *Response 200 OK

I believe that in some redirection logic the original schema is being lost
somehow, during page versioning.
This problem only occurs when using the "X-Forwarded-Proto" header

Using Wicket 7.6.0
Any suggestions?

Thanks!


Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-23 Thread Marcel Barbosa Pinto
That is really good!

On Thu, Mar 23, 2017 at 5:47 AM, Andrea Del Bene <an.delb...@gmail.com>
wrote:

> Great!
>
> On Wed, Mar 22, 2017 at 11:28 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > "New" does not mean better. :-)
> >
> > kind regards
> >
> > Tobias
> >
> > > Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <
> > martijn.dasho...@gmail.com>:
> > >
> > > WOW
> > >
> > >> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <
> mgrigo...@apache.org>
> > wrote:
> > >> Hi,
> > >>
> > >> Somehow Wicket finished at 3rd position at the last preview run of
> > >> TechEmpower framework tests :-)
> > >> https://www.techempower.com/benchmarks/previews/round14/#
> > section=data-r14=ph=json
> > >>
> > >> At plaintext test we are at #18:
> > >> https://www.techempower.com/benchmarks/previews/round14/#
> > section=data-r14=ph=plaintext
> > >>
> > >> Too bad that the new MySQL JDBC driver v.6 failed at their servers,
> > >> otherwise I'd expect good results there too.
> > >> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
> > >>
> > >> Wicket 7.6.0 performs ~300% better than Round 13!
> > >> https://www.techempower.com/benchmarks/previews/round14/
> > r13-vs-r14p1.html
> > >>
> > >> The improvements come from
> > >> https://github.com/TechEmpower/FrameworkBenchmarks/commit/
> > 54152ceb735cf63351537556aa316dfd29202af4
> > >> - custom root request mapper
> > >> - reduced the response size to the minimum
> > >>
> > >>
> > >> Once again the reactive frameworks are slower than the good old
> Wicket!
> > :-)
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >> https://twitter.com/mtgrigorov
> > >
> > >
> > >
> > > --
> > > Become a Wicket expert, learn from the best: http://wicketinaction.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
> >
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Manually expire a page

2017-03-10 Thread Marcel Barbosa Pinto
Thanks Martin, I'll try it.

On Fri, Mar 10, 2017 at 7:04 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi,
>
> See org.apache.wicket.DefaultPageManagerProvider#get().
> You will need to extend org.apache.wicket.page.PageStoreManager and create
> a getter for the passed org.apache.wicket.pageStore.IPageStore.
> Then in your code you could do something like:
>
> ((MyPageManager)
> getSession().getPageManager()).getPageStore().removePage(
> getSession().getId(),
> getPage().getPageId())
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Mar 10, 2017 at 10:41 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi,
> >
> > When the user submits a form, I save the data in #onSubmit() and then
> > redirect it to another page.
> > If the user hits the back button, I need that this versioned page becomes
> > expired.
> >
> > How can I achieve this?
> >
> > --
> >
> > Marcel Barbosa Pinto
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Manually expire a page

2017-03-10 Thread Marcel Barbosa Pinto
Hi,

When the user submits a form, I save the data in #onSubmit() and then
redirect it to another page.
If the user hits the back button, I need that this versioned page becomes
expired.

How can I achieve this?

--

Marcel Barbosa Pinto


Re: Stateless search page use-case

2017-03-07 Thread Marcel Barbosa Pinto
Hi Sven, thank you. This worked.

On Tue, Mar 7, 2017 at 11:16 AM, Sven Meier <s...@meiers.net> wrote:

> Hi,
>
> move your search from #onInitialize() to #onConfigure() - there you can
> take
> the filters into consideration.
> #search() can just accept (and check) the new filters, but don't let it do
> the any actual search.
>
> Hope this helps
> Sven
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Stateless-search-page-use-case-tp4677258p4677259.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
>
>


-- 

Marcel Barbosa Pinto
55 11 98255 8288


Stateless search page use-case

2017-03-07 Thread Marcel Barbosa Pinto
Hi guys,

I have a stateless search page, when the user first enters the page, all
results must be returned.
Then the user can submit a filter form and then the filtered result must be
shown.

In the page's onInitialize I have a search() method which calls search()
method.

I have a form which has a CompoundPropertyModel attached with the page
model.
In onSubmit method, seach() is invoked to perform the search with the
filtered values.

The problem is, since the page is stateless the onInitialize is called and
then the onSubmit method is called when I post the form.

So I am searching twice. How would be the correct approach to this case?

I was thinking in just check if the request method is a Post and ignore the
onInitialize call...

Thanks in advance.

-- 

Marcel


Re: Java Wickets Delete and Checkbox

2017-02-07 Thread Marcel Barbosa Pinto
Check here:

http://examples7x.wicket.apache.org/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.CheckGroupPage
;



On Tue, Feb 7, 2017 at 4:15 PM, ASHU_JAVA <ashu@gmail.com> wrote:

> Hello All,
>
> I'm a newbie to Java Wickets and want to implement following
> functionality:-
>
> <http://apache-wicket.1842946.n4.nabble.com/file/n4677014/sample_2.png>
>
> I want to use checkbox to select one, multiple or all rows and on "Delete"
> button click, the users entry from Database Table gets removed and table
> gets updated with remaining rows.
>
> Can you please share some code samples to provide more insights to achieve
> this functionality.
>
> Thanks in advance.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Java-Wickets-Delete-and-Checkbox-tp4677014.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
>
>


-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Idea for a template component

2017-01-16 Thread Marcel Barbosa Pinto
Hi Martin,

I made this quickstart for testing the possibilities:
https://github.com/mbppower/wicketTemplateMarkupComponent

The implementation classes are located at
https://github.com/mbppower/wicketTemplateMarkupComponent/tree/master/src/main/java/org/apache/wicket/markup/html

I think this is indeed really simple, but would be nice to have it
available, since it requires some knowledge that may not be clear for new
users.
It's up to you man, just wanted to show this ;)





On Mon, Jan 16, 2017 at 5:48 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi Marcel,
>
> Thank you for your suggestion but I think it doesn't worth it to be part of
> wicket-core.
> It is as simple as
>
> @Override public void onComponentTagBody(final MarkupStream markupStream,
> final ComponentTag openTag) {
>replaceComponentTagBody(markupStream, tag, interpolate(body));
> }
>
> Same could be achieved with CompoundPropertyModel (+ component queueing if
> the hierachy should be changed frequently).
>
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Jan 13, 2017 at 2:42 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi guys,
> >
> > I had an idea last night and decided to implement it.
> >
> > On my wicket app I have a lot of labels that is used just to display the
> > model values to the user.
> > So my code was some thing like this:
> >
> > WebMarkupContainer container = new WebMarkupContainer("container", new
> > CompoundPropertyModel(myModel));
> > container.add(
> > new Label("prop1");
> > new Label("prop2.name");
> > new Label("prop2.lastname")
> > );
> > add(container);
> >
> > html was like this:
> > 
> > Prop1: 
> > Prop2 name: 
> > Prop2 lastname: 
> > 
> >
> > So I decided to try to simplify the HTML code and created a
> > TemplateMarkupComponent which basically uses the VariableInterpolator
> class
> > and PropertyResolver:
> >
> > java looks like this:
> >
> > TemplateMarkupContainer container = new
> > TemplateMarkupContainer("container", myModel);
> > add(container);
> >
> > Html code:
> >
> > 
> > Prop1: ${prop1}
> > Prop2 name: ${prop2.name}
> > Prop2 lastname:  ${prop2.lastname}
> > 
> >
> > To display the values the component apply the PropertyConverter, so
> fields
> > are displayed with the correct format.
> > It uses the same expressions that PropertyModel uses to get its
> properties.
> > I think this could be used to render scripts as well.
> >
> > You can just remove the expression tag from HTML without having to change
> > the java code.
> > You can choose if and Exception should be raised if the Model doesn't
> > contains the property, like the MapVariableInterpolator does.
> >
> > These two I am still thinking about:
> > You can override the onValue(String expression, Object value) in order to
> > modify the value that is rendered
> > If you pass a Model with is not an Object with properties, like just a
> > String or Int, you can render it by using ${this}
> >
> > It is just two classes:
> > ModelVariableInterpolator.java
> > TemplateMarkupContainer.java
> >
> >
> > Do you think that this could be useful?
> > What problems could be raised by this approach?
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Idea for a template component

2017-01-13 Thread Marcel Barbosa Pinto
Hi guys,

I had an idea last night and decided to implement it.

On my wicket app I have a lot of labels that is used just to display the
model values to the user.
So my code was some thing like this:

WebMarkupContainer container = new WebMarkupContainer("container", new
CompoundPropertyModel(myModel));
container.add(
new Label("prop1");
new Label("prop2.name");
new Label("prop2.lastname")
);
add(container);

html was like this:

Prop1: 
Prop2 name: 
Prop2 lastname: 


So I decided to try to simplify the HTML code and created a
TemplateMarkupComponent which basically uses the VariableInterpolator class
and PropertyResolver:

java looks like this:

TemplateMarkupContainer container = new
TemplateMarkupContainer("container", myModel);
add(container);

Html code:


Prop1: ${prop1}
Prop2 name: ${prop2.name}
Prop2 lastname:  ${prop2.lastname}


To display the values the component apply the PropertyConverter, so fields
are displayed with the correct format.
It uses the same expressions that PropertyModel uses to get its properties.
I think this could be used to render scripts as well.

You can just remove the expression tag from HTML without having to change
the java code.
You can choose if and Exception should be raised if the Model doesn't
contains the property, like the MapVariableInterpolator does.

These two I am still thinking about:
You can override the onValue(String expression, Object value) in order to
modify the value that is rendered
If you pass a Model with is not an Object with properties, like just a
String or Int, you can render it by using ${this}

It is just two classes:
ModelVariableInterpolator.java
TemplateMarkupContainer.java


Do you think that this could be useful?
What problems could be raised by this approach?


-- 

Marcel Barbosa Pinto


Re: What else do we want to do before 8.0.0 final ?

2016-11-10 Thread Marcel Barbosa Pinto
Another idea.

Reactive programing is trending now, frameworks like Spring (v5) are
rewriting it's core using the project reactor and rxJava. Java 9 will also
add support for it.
I was just wondering if Wicket could use reactive patterns for things like
behaviours, events, components, models, request cycle etc.

I don't know how complex would be to implement it, what do you guys think
(Maybe for Wicket 9)?





On Thu, Nov 10, 2016 at 10:52 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi Peter,
>
>
> On Thu, Nov 10, 2016 at 1:44 PM, Peter Henderson <
> peter.hender...@starjar.com> wrote:
>
> > Hi
> >
> > > What other improvements do we need in 8.x/master before promoting it to
> >
> > > > 8.0.0 final ?
> > >
> >
> > A bit late. But one idea I've had in the back of my mind for a long
> while.
> > (I may well be barking up the wrong tree here..)
> >
> >
> > Break IPageStore.
> > Replace the simple int pageId identifier with a bit more detail.
> >
> > When pages are mounted to a path the path should be considered when
> getting
> > pages from the page store.
> > e.g
> > User A is looking at page
> > www.example.com/pageA?5
> >
> >
> > User B is looking at page
> > www.example.com/pageB?5
> >
> > User A emails their url to B. When B clicks on the link he incorrectly
> sees
> > pageB because that page has the same pageId
> >
>
> This is not the current behavior.
> Currently if User A sends www.example.com/pageA?5 to User B then Wicket
> will detect that page with id=5 is not from type PageA and won't render it.
> Instead Wicket will create a new instance ot PageA and show it.
>
>
> >
> >
> >
> >
> >
> > > >
> > > > At https://cwiki.apache.org/confluence/display/WICKET/Ideas+for
> > > +Wicket+8.0
> > > > we still have:
> > > >
> > > > - new DateTime APIs for wicket-datetime *WICKET-6105
> > > > <https://issues.apache.org/jira/browse/WICKET-6105>* - I'll give
> this
> > > one
> > > > more try but the problem is that I don't believe this is the proper
> way
> > > and
> > > > this demotivates me.
> > > > If someone else wants to give it a try - please assign it to
> yourself!
> > > >
> > > > - Better SEO for stateful pages - the only way I see this is by using
> > > > ServiceWorker to add the pageId as a request header to all requests
> > > (normal
> > > > & Ajax)
> > > >
> > > >
> > > > Recently I wondered whether Redux.js could be in use for Wicket.
> > > > I don't have much experience with it, but both React and AngularJs
> > > > communities use it to manage the state for their components.
> > > > There are some Java impls, even a standard is coming:
> > > https://github.com/
> > > > jvm-redux/jvm-redux-api
> > > >
> > > > What else ?
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > >
> >
> >
> >
> > --
> > Peter Henderson
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Form Validation / Field visibility

2016-11-03 Thread Marcel Barbosa Pinto
Got it. Thank you!

Em 3 de nov de 2016 20:35, "Sven Meier" <s...@meiers.net> escreveu:

> Hi,
>
> your *IForm*Validator complains about some of its dependent components
> being invisible. So no need to remove any validators.
>
> Your IFormValidator's getDependentFormComponents() should only return
> visible components.
>
> Have fun
> Sven
>
>
> Am 03.11.2016 um 21:40 schrieb Marcel Barbosa Pinto:
>
>> Hello,
>>
>> I have a form which has some fields with validation attached to them.
>> When the user authenticates I hide some form elements.
>>
>> When the form is submitted I receive a Warn log entry:
>>
>> o.a.wicket.markup.html.form.Form - IFormValidator in form `form` depends
>> on
>> a component that has been removed from the page or is no longer visible.
>> Offending component id `email`.
>>
>> Should I always manually remove the validators from the components when
>> hiding them?
>>
>> Thanks.
>>
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Form Validation / Field visibility

2016-11-03 Thread Marcel Barbosa Pinto
Hello,

I have a form which has some fields with validation attached to them.
When the user authenticates I hide some form elements.

When the form is submitted I receive a Warn log entry:

o.a.wicket.markup.html.form.Form - IFormValidator in form `form` depends on
a component that has been removed from the page or is no longer visible.
Offending component id `email`.

Should I always manually remove the validators from the components when
hiding them?

Thanks.


-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: What else do we want to do before 8.0.0 final ?

2016-10-31 Thread Marcel Barbosa Pinto
For adding components we usually write some thing like this:

Form f = new Form();
add(f);
RepeatingView imageList;
f.add(imageList = new RepeatingView("imageList"));

or

Form f = new Form();
add(f);
RepeatingView imageList = new RepeatingView("imageList");
f.add(imageList);

You think this could be useful?

Form f = new Form().addTo(this);
new RepeatingView("imageList").addTo(f);

Adding:

Component.addTo(targetComponent);
Component.replaceFrom(targetComponent);
Component.removeFrom(targetComponent);

Cheers.


On Mon, Oct 31, 2016 at 11:48 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Forwarding to users@wicket.apache.org
>
> GMail autosuggest tricked me to send it to us...@isis.apache.org.
>
> On Mon, Oct 31, 2016 at 2:41 PM, Martin Grigorov <mgrigo...@apache.org>
> wrote:
>
> > Hi,
> >
> > What other improvements do we need in 8.x/master before promoting it to
> > 8.0.0 final ?
> >
> > At https://cwiki.apache.org/confluence/display/WICKET/
> Ideas+for+Wicket+8.0
> > we still have:
> >
> > - new DateTime APIs for wicket-datetime *WICKET-6105
> > <https://issues.apache.org/jira/browse/WICKET-6105>* - I'll give this
> one
> > more try but the problem is that I don't believe this is the proper way
> and
> > this demotivates me.
> > If someone else wants to give it a try - please assign it to yourself!
> >
> > - Better SEO for stateful pages - the only way I see this is by using
> > ServiceWorker to add the pageId as a request header to all requests
> (normal
> > & Ajax)
> >
> >
> > Recently I wondered whether Redux.js could be in use for Wicket.
> > I don't have much experience with it, but both React and AngularJs
> > communities use it to manage the state for their components.
> > There are some Java impls, even a standard is coming:
> https://github.com/
> > jvm-redux/jvm-redux-api
> >
> > What else ?
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Result of vote at twitter

2016-10-31 Thread Marcel Barbosa Pinto
I confess I didn't used it yet. I will use it and see if I can contribute
with some ideas.


On Mon, Oct 31, 2016 at 11:35 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> On Mon, Oct 31, 2016 at 2:27 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi,
> >
> > I mean by order the parent/child relation. Like for adding the child
> you've
> > to have a parent already added to the page right?
> >
> > I took this from the docs:
> >
> > queue(new Form("customer"));
> > queue(new TextField("first"));
> > queue(new TextField("last"));
> >
> > WebMarkupContainer child=new WebMarkupContainer("child");
> > queue(child);
> > child.queue(new TextField("first"));
> > child.queue(new TextField("last"));
> > child.queue(new TextField("dob"));
> >
> >
> > By a different approach we could do:
> >
> > queue(new TextField("customer.first"));
> > queue(new TextField("customer.last"));
> > queue(new Form("customer"));
> >
>
> This works now!
> Your assumption is not correct.
>
> The only requirement is that all those components are in the same markup
> container with associated markup (aka IMarkupRegion), i.e. in SomePage.html
> or in SomePanel.html.
>
>
> >
> > queue(new TextField("child.first"));
> > queue(new TextField("child.last"));
> > queue(new TextField("child.dob"));
> >
> > WebMarkupContainer child=new WebMarkupContainer("child");
> > queue(child);
> >
> > For this to work, I believe we had to have a "shadow hierarchy" between
> the
> > template and the java code that would orchestrate all the adds/queue etc
> > and them validate the final result.
> >
> > This would allow something like this:
> >
> > 
> > 
> > 
> >
> > add(new TextField("container.input"));
> >
> > //the container would be added as a logic-less WebMarkupContainer
> > get("container").add(new AttributeModifier("class", "active"));
> > replace("container", new CustomComponent());
> >
> > get("container.input", TextField.class).setRequired(true);
> >
> > The standard wicket approach could be combined with this "path hierarchy"
> > or maybe do some like this, instead of using the component id as a path.
> >
> > add("container", new TextField("input"));
> >
> > LOL, this is just a brainstorm, just to try to give some ideas.
> >
> >
> > On Mon, Oct 31, 2016 at 10:30 AM, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> > > I am not sure I follow you.
> > > What order do you mean ?
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Mon, Oct 31, 2016 at 1:10 PM, Marcel Barbosa Pinto <
> > > marcel.po...@gmail.com> wrote:
> > >
> > > > Yes I know, queue is great, but if you use queue you need to respect
> > the
> > > > correct order when invoking each queue.
> > > > I think this is not as simple, because you always have to "think" in
> > > order
> > > > to add the components.
> > > > For long trees the code gets clean, but if you change the order of
> some
> > > > thing the code can break.
> > > > In my opinion its not very practical as literally write the component
> > > path.
> > > > "container.container.1.secondMessage".
> > > > Simple empty logic-less containers could be added automatically by
> the
> > > > framework, and could be retrieved also by Its path.
> > > >
> > > > Cheers.
> > > >
> > > >
> > > >
> > > >
> > > > On Mon, Oct 31, 2016 at 9:52 AM, Martin Grigorov <
> mgrigo...@apache.org
> > >
> > > > wrote:
> > > >
> > > > > On Mon, Oct 31, 2016 at 12:47 PM, Marcel Barbosa Pinto <
> > > > > marcel.po...@gmail.com> wrote:
> > > > >
> > > > > > Would be possible to compute the hierarchy from the template it
> > self?
> > > > > >
> > > > >
> > > > > This is how the component queueing works in Wicket 7.
> > > > > The only difference is that you need to use Mar

Re: Result of vote at twitter

2016-10-31 Thread Marcel Barbosa Pinto
Hi,

I mean by order the parent/child relation. Like for adding the child you've
to have a parent already added to the page right?

I took this from the docs:

queue(new Form("customer"));
queue(new TextField("first"));
queue(new TextField("last"));

WebMarkupContainer child=new WebMarkupContainer("child");
queue(child);
child.queue(new TextField("first"));
child.queue(new TextField("last"));
child.queue(new TextField("dob"));


By a different approach we could do:

queue(new TextField("customer.first"));
queue(new TextField("customer.last"));
queue(new Form("customer"));

queue(new TextField("child.first"));
queue(new TextField("child.last"));
queue(new TextField("child.dob"));

WebMarkupContainer child=new WebMarkupContainer("child");
queue(child);

For this to work, I believe we had to have a "shadow hierarchy" between the
template and the java code that would orchestrate all the adds/queue etc
and them validate the final result.

This would allow something like this:





add(new TextField("container.input"));

//the container would be added as a logic-less WebMarkupContainer
get("container").add(new AttributeModifier("class", "active"));
replace("container", new CustomComponent());

get("container.input", TextField.class).setRequired(true);

The standard wicket approach could be combined with this "path hierarchy"
or maybe do some like this, instead of using the component id as a path.

add("container", new TextField("input"));

LOL, this is just a brainstorm, just to try to give some ideas.


On Mon, Oct 31, 2016 at 10:30 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> I am not sure I follow you.
> What order do you mean ?
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Oct 31, 2016 at 1:10 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Yes I know, queue is great, but if you use queue you need to respect the
> > correct order when invoking each queue.
> > I think this is not as simple, because you always have to "think" in
> order
> > to add the components.
> > For long trees the code gets clean, but if you change the order of some
> > thing the code can break.
> > In my opinion its not very practical as literally write the component
> path.
> > "container.container.1.secondMessage".
> > Simple empty logic-less containers could be added automatically by the
> > framework, and could be retrieved also by Its path.
> >
> > Cheers.
> >
> >
> >
> >
> > On Mon, Oct 31, 2016 at 9:52 AM, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> > > On Mon, Oct 31, 2016 at 12:47 PM, Marcel Barbosa Pinto <
> > > marcel.po...@gmail.com> wrote:
> > >
> > > > Would be possible to compute the hierarchy from the template it self?
> > > >
> > >
> > > This is how the component queueing works in Wicket 7.
> > > The only difference is that you need to use MarkupContainer#queue()
> > instead
> > > of #add().
> > >
> > >
> > > >
> > > > html
> > > >
> > > > 
> > > >  
> > > >  
> > > >   
> > > >  
> > > >  
> > > >   
> > > >  
> > > > 
> > > >
> > > > java
> > > >
> > > > {
> > > >
> > > > add(new WebMarkupContainer("container"));
> > > > add(new TextField("container.input"));
> > > > add(new Label("container.container.message", Model.of("Hello")));
> > > > add(new Label("container.container.1.secondMessage",
> Model.of("Second
> > > > hello")));
> > > >
> > > > }
> > > >
> > > > Maybe this could work with the existing hierarchy, just changing the
> > > > notation.
> > > > This should the changed for compound models that uses the bean name
> as
> > > the
> > > > component name. Maybe LambdaModel could deal with it..
> > > >
> > > > Just my 2 cents..
> > > >
> > > >
> > > >
> > > > On Mon, Oct 31, 2016 at 9:29 AM, Tobias Soloschenko <
> > > > tobiassolosche...@googlemail.com> wrote:
> > > >
> > > > > Hi Martin,
> > > > >
&g

Re: Result of vote at twitter

2016-10-31 Thread Marcel Barbosa Pinto
Yes I know, queue is great, but if you use queue you need to respect the
correct order when invoking each queue.
I think this is not as simple, because you always have to "think" in order
to add the components.
For long trees the code gets clean, but if you change the order of some
thing the code can break.
In my opinion its not very practical as literally write the component path.
"container.container.1.secondMessage".
Simple empty logic-less containers could be added automatically by the
framework, and could be retrieved also by Its path.

Cheers.




On Mon, Oct 31, 2016 at 9:52 AM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> On Mon, Oct 31, 2016 at 12:47 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Would be possible to compute the hierarchy from the template it self?
> >
>
> This is how the component queueing works in Wicket 7.
> The only difference is that you need to use MarkupContainer#queue() instead
> of #add().
>
>
> >
> > html
> >
> > 
> >  
> >  
> >   
> >  
> >  
> >   
> >  
> > 
> >
> > java
> >
> > {
> >
> > add(new WebMarkupContainer("container"));
> > add(new TextField("container.input"));
> > add(new Label("container.container.message", Model.of("Hello")));
> > add(new Label("container.container.1.secondMessage", Model.of("Second
> > hello")));
> >
> > }
> >
> > Maybe this could work with the existing hierarchy, just changing the
> > notation.
> > This should the changed for compound models that uses the bean name as
> the
> > component name. Maybe LambdaModel could deal with it..
> >
> > Just my 2 cents..
> >
> >
> >
> > On Mon, Oct 31, 2016 at 9:29 AM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> > > Hi Martin,
> > >
> > > yes that's true, but if someone dislike something there might be
> reasons
> > > which can be changed. :-)
> > >
> > > Example:
> > >
> > > It is hard to deal with a component hierarchy: Solution component
> > queuing.
> > > (yes I know - you think that it's a failure - but it is an example)
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > > > Am 31.10.2016 um 11:12 schrieb Martin Grigorov <mgrigo...@apache.org
> >:
> > > >
> > > > How exactly ?
> > > >
> > > > Bruno is JavaEE evangelist at Oracle and most of the people following
> > him
> > > > are JavaEE fans. They prefer JSF and JSP...
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Mon, Oct 31, 2016 at 8:44 AM, Tobias Soloschenko <
> > > > tobiassolosche...@googlemail.com> wrote:
> > > >
> > > >> Hi,
> > > >>
> > > >> as I saw here:
> > > >>
> > > >> https://mobile.twitter.com/brunoborges/status/79132793984116
> > > >>
> > > >> there are a lot of "dislikes" as a result of the vote. I think it
> > would
> > > be
> > > >> great to get some feedback what to improve and what you don't like.
> > > >>
> > > >> kind regards
> > > >>
> > > >> Tobias
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Result of vote at twitter

2016-10-31 Thread Marcel Barbosa Pinto
Would be possible to compute the hierarchy from the template it self?

html


 
 
  
 
 
  
 


java

{

add(new WebMarkupContainer("container"));
add(new TextField("container.input"));
add(new Label("container.container.message", Model.of("Hello")));
add(new Label("container.container.1.secondMessage", Model.of("Second
hello")));

}

Maybe this could work with the existing hierarchy, just changing the
notation.
This should the changed for compound models that uses the bean name as the
component name. Maybe LambdaModel could deal with it..

Just my 2 cents..



On Mon, Oct 31, 2016 at 9:29 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi Martin,
>
> yes that's true, but if someone dislike something there might be reasons
> which can be changed. :-)
>
> Example:
>
> It is hard to deal with a component hierarchy: Solution component queuing.
> (yes I know - you think that it's a failure - but it is an example)
>
> kind regards
>
> Tobias
>
> > Am 31.10.2016 um 11:12 schrieb Martin Grigorov <mgrigo...@apache.org>:
> >
> > How exactly ?
> >
> > Bruno is JavaEE evangelist at Oracle and most of the people following him
> > are JavaEE fans. They prefer JSF and JSP...
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Oct 31, 2016 at 8:44 AM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> as I saw here:
> >>
> >> https://mobile.twitter.com/brunoborges/status/79132793984116
> >>
> >> there are a lot of "dislikes" as a result of the vote. I think it would
> be
> >> great to get some feedback what to improve and what you don't like.
> >>
> >> kind regards
> >>
> >> Tobias
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Wicket vs JS frameworks.

2016-10-15 Thread Marcel Barbosa Pinto
I am working on a complex and demanding Angular 2 project for marketing
analytics, and I can tell that with Typescript the development process is
exponentially improved.

First we need to understand that the Angular project came from the GWT
project. The Google devs realized at that time that they could speed up the
development process by skipping the Java compilation to Javascript. This
was not something that they could do in the past because the web platform
was not evolved to support complex frontend applications. Now they can
leverage all the js tools, like npm and typescript, web components, etc. So
Google put a lot of workforce in Angular. Now they are dropping GWT
applications like Google analytics in favor of Angular.

The next thing they are planning is Angular Universal, they already have
versions for PHP and .Net Core and a version for Java will be available
soon.

Angular server side will enable the pre rendering of pages in the server
and the client router will communicate with the server side router enabling
a faster startup time.

I am using wicket by 4 years now. Indeed components based apps are a good
choice to go. Maybe Wicket should evolve with the web components
specification. In wicket the view (html) is logic less. But this is the
wicket approach. With Angular you put all the view logic in html using the
crazy Angular attributes and components tags. This can be messy but it
greatly speeds up things, as you also don't have to follow an hierarchy
which is required by Wicket. And I know this is a Wicket solution for the
view, and can enabled better testing of components.

I believe that the browser it self became a real platform for applications.
Would be nice to have a material design implemented also in Wicket, like
the React version,
www.material-ui.com
there is also Angular 1
material.angularjs.org
and Angular 2
material.angular.io

And some investigation in the reactive streams program model. I think this
can be applied to many aspects of component hierarchy and models. In
Angular 2 supports rxjs for form validation and many other things.

Wicket is a very good framework letting you choose between stateless or
statefull or both! You can't use just Angular, you also need a server
counterpart and for this wicket is a good choice because it is simple and
intuitive to maintain, but if you need performance that the servlet can't
deliver. You need to go for Netty/Akka based frameworks.

Em 15 de out de 2016 07:42, "Andrea Del Bene" 
escreveu:

> IMHO things are quite simple. JS base app are told to be highly scalable
> because they rely on a REST, stateless architecture. So scaling is just a
> matter of adding servers without worrying of replicating a user session.
> This is true until you need to log a user into your app. At this point
> someone, somewhere (usually in a oauth server) has to "remember" your
> logged in users somehow, which means that you are no more stateless :-).
> When Wicket was born people didn't use to care about been stateless at any
> cost, and unfortunately for many years Wicket was labeled as stateful
> framework. This is absolutely wrong as "by default" a Wicket app is
> stateless. The user guide explain in details such concept. With the last
> release we also made an additional effort to keep AJAX features
> stateless-friendly.
>
> The bottom line: no matter which framework you use. if you want to be
> scalable be stateless. If you can't, keep user session the smallest you
> can. :-)
>
>
> On 15/10/2016 02:57, fzb wrote:
>
>>  From the posts so far this is what i understand..
>>
>> 1. JS based apps are best suited for high scale applications.. It is worth
>> the effort you take to build and maintain such apps..
>>
>> 2. Wicket can scale only to certain extent based on the server capacity ?
>> If
>> so how to quantify ?
>> (What about load balancing ? What about stateless pages ? Why it does not
>> scale ?)
>>
>> 3. JS based apps resource availability is plenty.. So for new projects
>> better to go with these ?
>>   - What if the maintaining these apps becomes tedious due the cons of
>> these
>> JS discussed earlier.
>>
>> May be some more insights will help us all understand, how to choose what
>> depending on the scenarios in hand.
>>
>> - fzb
>>
>>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.n
>> 4.nabble.com/Wicket-vs-JS-frameworks-tp4675771p4675796.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: Component level cache

2016-08-19 Thread Marcel Barbosa Pinto
Ok guys I'll follow the model approach.

On Fri, Aug 19, 2016 at 1:39 AM, Matt Pavlovich <mattr...@gmail.com> wrote:

> +1 agreed.  Caching the data (models) coming from data providers and/or
> services is the best approach
>
>
>
> On 8/17/16 3:50 AM, Martin Grigorov wrote:
>
>> Hi,
>>
>> I am not aware of such component.
>> Usually the caching is done in the service layer, not in the UI.
>> But if you prefer to do it with Wicket then do it in a Model that caches
>> the DB results.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Tue, Aug 16, 2016 at 6:03 PM, Marcel Barbosa Pinto <
>> marcel.po...@gmail.com> wrote:
>>
>> Hi,
>>>
>>> I was just wondering if there is some component to instead of let the a
>>> given component to render itself, check if there is a cache and display
>>> its
>>> rendered markup, thus avoiding unnecessary rendering, this could be
>>> useful
>>> for stateless components that need to display some list of categories
>>> from
>>> the database etc.
>>>
>>> Something like this:
>>>
>>> class Header extends Panel{
>>>  add(new ExpensiveCategoryListView());
>>> }
>>>
>>> class Home extends Page{
>>>  add(new CachedComponent("headerContainer", Header.class))
>>> }
>>>
>>> The CachedComponent would first check if there is an already rendered
>>> Header instance (could check in an in-memory store like, infinispan or
>>> hezelcast)
>>>
>>> What do you guys think?
>>>
>>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 

Marcel Barbosa Pinto
55 11 98255 8288


Component level cache

2016-08-16 Thread Marcel Barbosa Pinto
Hi,

I was just wondering if there is some component to instead of let the a
given component to render itself, check if there is a cache and display its
rendered markup, thus avoiding unnecessary rendering, this could be useful
for stateless components that need to display some list of categories from
the database etc.

Something like this:

class Header extends Panel{
add(new ExpensiveCategoryListView());
}

class Home extends Page{
add(new CachedComponent("headerContainer", Header.class))
}

The CachedComponent would first check if there is an already rendered
Header instance (could check in an in-memory store like, infinispan or
hezelcast)

What do you guys think?


Re: URL Mapping with dynamic params

2016-01-13 Thread Marcel Barbosa Pinto
OK, thank you.
Em 13 de jan de 2016 3:21 PM, "Martin Grigorov" <mgrigo...@apache.org>
escreveu:

> I am not sure.
> I think the id should be also dynamic:
> id = parameters.get(parameters.getIndexedCount() - 1);
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 13, 2016 at 6:17 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hmm, cool... this will work for me as the last index will always be the
> > ${id}, tks!
> >
> >
> >
> >
> >
> > On Wed, Jan 13, 2016 at 3:08 PM, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > Mount just "page" and use PageParameters indexed parameters to
> read/write
> > > the categories.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Wed, Jan 13, 2016 at 6:04 PM, Marcel Barbosa Pinto <
> > > marcel.po...@gmail.com> wrote:
> > >
> > > > Hi guys,
> > > >
> > > > I have to mount a page with an URL that contains zero or more
> > > "categories".
> > > >
> > > > /page/${id}
> > > > /page/vahicles/${id}
> > > > /page/vahicles/cars/${id}
> > > > /page/vahicles/cars/honda/${id}
> > > >
> > > >
> > > > The "/page" is fixed while the others vehicles, cars and honda is
> like
> > a
> > > > category tree only for SEO needs.
> > > >
> > > > In a rewrite framework I can create a regex for these params.
> > > > How can I achieve this in Wicket without fixing the parameters?
> > > >
> > > > Instead of that:
> > > >
> > > > /page/${cat0}/${id}
> > > > /page/${cat0}/${cat1}/${id}
> > > > /page/${cat0}/${cat1}/${cat2}/${id}
> > > >
> > > > I would like to do something like this pseudo regex:
> > > >
> > > > /page/#{(.+/)?(.+/)?(.+/)?}/${id}
> > > >
> > > >
> > > > Thanks;
> > > >
> > >
> >
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>


Re: URL Mapping with dynamic params

2016-01-13 Thread Marcel Barbosa Pinto
Hmm, cool... this will work for me as the last index will always be the
${id}, tks!





On Wed, Jan 13, 2016 at 3:08 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi,
>
> Mount just "page" and use PageParameters indexed parameters to read/write
> the categories.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 13, 2016 at 6:04 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi guys,
> >
> > I have to mount a page with an URL that contains zero or more
> "categories".
> >
> > /page/${id}
> > /page/vahicles/${id}
> > /page/vahicles/cars/${id}
> > /page/vahicles/cars/honda/${id}
> >
> >
> > The "/page" is fixed while the others vehicles, cars and honda is like a
> > category tree only for SEO needs.
> >
> > In a rewrite framework I can create a regex for these params.
> > How can I achieve this in Wicket without fixing the parameters?
> >
> > Instead of that:
> >
> > /page/${cat0}/${id}
> > /page/${cat0}/${cat1}/${id}
> > /page/${cat0}/${cat1}/${cat2}/${id}
> >
> > I would like to do something like this pseudo regex:
> >
> > /page/#{(.+/)?(.+/)?(.+/)?}/${id}
> >
> >
> > Thanks;
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


URL Mapping with dynamic params

2016-01-13 Thread Marcel Barbosa Pinto
Hi guys,

I have to mount a page with an URL that contains zero or more "categories".

/page/${id}
/page/vahicles/${id}
/page/vahicles/cars/${id}
/page/vahicles/cars/honda/${id}


The "/page" is fixed while the others vehicles, cars and honda is like a
category tree only for SEO needs.

In a rewrite framework I can create a regex for these params.
How can I achieve this in Wicket without fixing the parameters?

Instead of that:

/page/${cat0}/${id}
/page/${cat0}/${cat1}/${id}
/page/${cat0}/${cat1}/${cat2}/${id}

I would like to do something like this pseudo regex:

/page/#{(.+/)?(.+/)?(.+/)?}/${id}


Thanks;


Re: Testing for an IEvent

2015-12-15 Thread Marcel Barbosa Pinto
Hello,

Question for the experts:

I have a search page that has a POJO as a model. It uses this model to
filter a search through a form component.
Now I have another page (let's say quick search) that needs to send (post)
this POJO model to this search page, in order to do the search filtering.
As PageParameters can't(?) be used to send this "complex model", how the
search page can receive it from another page? May I have to use Events?

Thank you guys.


Send model to another Page

2015-12-15 Thread Marcel Barbosa Pinto
Hello,

Question for the experts:

I have a search page that has a POJO as a model. It uses this model to
filter a search through a form component.
Now I have another page (let's say quick search) that needs to send (post)
this POJO model to this search page, in order to do the search filtering.
As PageParameters can't(?) be used to send this "complex model", how the
search page can receive it from another page? May I have to use Events?

Thank you guys.


Re: Send model to another Page

2015-12-15 Thread Marcel Barbosa Pinto
Thank you guys, I'll do that.

On Tue, Dec 15, 2015 at 4:39 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi,
>
> On Tue, Dec 15, 2015 at 7:31 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi,
> >
> > Your first solution seems good to me.
> >
> > I will do something like this:
> >
> > IModel model = Model.of(new POJO());
> > new Form("form", model){
> >   @Override
> >   public void onSubmit(){
> > setResponsePage(new SearchPage(getDefaultModel()));
> >   }
> > }
> >
> > Is this a good solution for Wicket's point of view?
> >
>
> Yes, it is.
> If you do not insist to keep the page stateless then this is the best
> solution.
>
>
> >
> > Thanks.
> >
> >
> > On Tue, Dec 15, 2015 at 4:12 PM, Mihir Chhaya <mihir.chh...@gmail.com>
> > wrote:
> >
> > > I am not expert; but following are some of the possible options (not
> > > necessarily best approach):
> > >
> > > 1. Create POJO model and pass that as constructor parameter to the
> target
> > > (quick search) page.
> > > 2. Or, set the model into session (customer session model) and then get
> > > that into target page.
> > > 3. Set POJO model into current page as default model. Get current
> page's
> > > reference into quick search and get the default model object.
> > > 4. Assuming your quick search is not exact replica of full search,
> create
> > > linear Page Parameters and get into the target page.
> > >
> > > Thanks,
> > > -Mihir.
> > >
> > >
> > > On Tue, Dec 15, 2015 at 12:19 PM, Marcel Barbosa Pinto <
> > > marcel.po...@gmail.com> wrote:
> > >
> > > > Hello,
> > > >
> > > > Question for the experts:
> > > >
> > > > I have a search page that has a POJO as a model. It uses this model
> to
> > > > filter a search through a form component.
> > > > Now I have another page (let's say quick search) that needs to send
> > > (post)
> > > > this POJO model to this search page, in order to do the search
> > filtering.
> > > > As PageParameters can't(?) be used to send this "complex model", how
> > the
> > > > search page can receive it from another page? May I have to use
> Events?
> > > >
> > > > Thank you guys.
> > > >
> > >
> >
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Send model to another Page

2015-12-15 Thread Marcel Barbosa Pinto
Hi,

Your first solution seems good to me.

I will do something like this:

IModel model = Model.of(new POJO());
new Form("form", model){
  @Override
  public void onSubmit(){
setResponsePage(new SearchPage(getDefaultModel()));
  }
}

Is this a good solution for Wicket's point of view?

Thanks.


On Tue, Dec 15, 2015 at 4:12 PM, Mihir Chhaya <mihir.chh...@gmail.com>
wrote:

> I am not expert; but following are some of the possible options (not
> necessarily best approach):
>
> 1. Create POJO model and pass that as constructor parameter to the target
> (quick search) page.
> 2. Or, set the model into session (customer session model) and then get
> that into target page.
> 3. Set POJO model into current page as default model. Get current page's
> reference into quick search and get the default model object.
> 4. Assuming your quick search is not exact replica of full search, create
> linear Page Parameters and get into the target page.
>
> Thanks,
> -Mihir.
>
>
> On Tue, Dec 15, 2015 at 12:19 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hello,
> >
> > Question for the experts:
> >
> > I have a search page that has a POJO as a model. It uses this model to
> > filter a search through a form component.
> > Now I have another page (let's say quick search) that needs to send
> (post)
> > this POJO model to this search page, in order to do the search filtering.
> > As PageParameters can't(?) be used to send this "complex model", how the
> > search page can receive it from another page? May I have to use Events?
> >
> > Thank you guys.
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: ThreadLocal usage for managing session in Wicket

2015-10-20 Thread Marcel Barbosa Pinto
santhosh, here is something I did a while ago.

Maybe it can help you.

Add the listener:
https://github.com/mbppower/scalaWicket/blob/master/src/main/scala/com/mbppower/WicketApplication.scala

RequestListener:
https://github.com/mbppower/scalaWicket/blob/master/src/main/scala/com/mbppower/JpaRequestCycle.scala

Cheers

On Tue, Oct 20, 2015 at 12:30 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi,
>
> I am not aware of such documentation.
> It is an implementation detail. And it may change at any release as far as
> it preserves the same behavior.
> It is just a simple combination of how Servlet containers work and
> ThreadLocal usage.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Oct 20, 2015 at 11:05 AM, santhosh <chandrasantho...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Can you prescribe me some references from where i can learn and explore
> > more
> > about all this.
> >
> > Whatever you have explained me (reg: thread usage in managing
> > requests/sessions), i couldn't find them in Wicket in Action book or
> > anywhere else over the internet.
> >
> >
> > Thanks in Advance,
> > Santhosh
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/ThreadLocal-usage-for-managing-session-in-Wicket-tp4672215p4672306.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
> >
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: wicketstuff-core jars

2015-10-16 Thread Marcel Barbosa Pinto
Hi Martin

By adding the artifact to my pom, maven tries to download from this URL
http://repo1.maven.apache.org/maven2/org/wicketstuff/wicketstuff-core/7.0.0/wicketstuff-core-7.0.0.jar

Here is the artifact that I got from
http://mvnrepository.com/artifact/org.wicketstuff/wicketstuff-core:


org.wicketstuff
wicketstuff-core
7.0.0


But there is no jar in there. I am missing some thing?

Thanks


On Fri, Oct 16, 2015 at 6:30 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> This looks like the parent pom of the project.
> Check in one folder above.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Oct 16, 2015 at 11:27 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi Guys,
> >
> > I've just tried to download this dependency from maven, but it seams to
> be
> > missing the jars from the repo:
> >
> > http://repo1.maven.org/maven2/org/wicketstuff/wicketstuff-core/7.0.0/
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: wicketstuff-core jars

2015-10-16 Thread Marcel Barbosa Pinto
You are totally right. I was missing that. I've found exactly the packages
that I wanted. Sorry about that.

On Fri, Oct 16, 2015 at 6:48 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> WicketStuff is a project with many sub-projects.
> The Maven dependency you add to your project is the Maven parent pom (see
>
> https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance
> ).
> I guess you need to use just one/few of the sub-projects. Check
> https://github.com/wicketstuff/core/wiki#participating-projects
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Oct 16, 2015 at 11:45 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi Martin
> >
> > By adding the artifact to my pom, maven tries to download from this URL
> >
> >
> http://repo1.maven.apache.org/maven2/org/wicketstuff/wicketstuff-core/7.0.0/wicketstuff-core-7.0.0.jar
> >
> > Here is the artifact that I got from
> > http://mvnrepository.com/artifact/org.wicketstuff/wicketstuff-core:
> >
> > 
> > org.wicketstuff
> > wicketstuff-core
> > 7.0.0
> > 
> >
> > But there is no jar in there. I am missing some thing?
> >
> > Thanks
> >
> >
> > On Fri, Oct 16, 2015 at 6:30 PM, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> > > This looks like the parent pom of the project.
> > > Check in one folder above.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Fri, Oct 16, 2015 at 11:27 PM, Marcel Barbosa Pinto <
> > > marcel.po...@gmail.com> wrote:
> > >
> > > > Hi Guys,
> > > >
> > > > I've just tried to download this dependency from maven, but it seams
> to
> > > be
> > > > missing the jars from the repo:
> > > >
> > > >
> http://repo1.maven.org/maven2/org/wicketstuff/wicketstuff-core/7.0.0/
> > > >
> > > >
> > > > --
> > > >
> > > > Marcel Barbosa Pinto
> > > > 55 11 98255 8288
> > > >
> > >
> >
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Wicket.Ajax on static pages loading stateful components.

2015-10-15 Thread Marcel Barbosa Pinto
Hi guys,

I am developing a heavy traffic web site entirely in Wicket 7 and I have
some questions about page caching.

The approach I took was to generate the product page HTML from Wicket
statically saving these files to be served direct to the user as a Wicket
Resource.

These pages has a Wicket contact form panel witch are dynamically loaded
using my own ajax that calls the mounted form panel from and manually
updates the HTML the the form panel generated markup.

//pseudo code ^^

//normal wicket form panel
mount("ad/contact")

//static page page
mount("/ad/page{#id}", Resource("/static/produtc-details-{#id}.html"))

This is working, but is not a good solution as I could only manage to get
the entire form html.
Inside the contact form I have a captcha that has an ajax link to refresh
its image.

I would like to have a #formContainer at the static page then using the
Wicket.Ajax be able to refresh the container HTML (ad/contact) and when the
captcha needs the refresh, only the captcha has to be updated, so the user
doesn't loose the form text he could have inserted.

It is possible to load the contact form from the static generated HTML
using the Wicket.Ajax and have the ajax component update working?

If you guys have a better approach to this problem, please let me know.
Thanks

-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Wicket.Ajax on static pages loading stateful components.

2015-10-15 Thread Marcel Barbosa Pinto
Hi Martin,

I am generating the static html in order to save out the database, as this
page has a lot of queries. But I am not sure if that was the right choice.

Maybe a better solution would be have this page rendered by wicket and
stored in Redis, so all the access to this page, would get its contents
from Redis, saving the database.
So this would prevent the same content to be rendered for every request.

I'll take a look at Stateless stuff, by the way.

Thanks for your help.

On Thu, Oct 15, 2015 at 4:30 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi,
>
> You can try WicketStuff-Stateless project with its StatelessAjaxLink as
> quick solution.
>
> But your setup is rather strange. As far as I understand you want to keep
> the application stateless and that's why you do all this magic, right?
> I'd use stateless page served by Wicket on every request. No need to store
> it as static html, it will be fast enough.
> For the captcha I'd use some other solution, not Wicket-Extensions.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Oct 15, 2015 at 4:45 PM, Marcel Barbosa Pinto <
> marcel.po...@gmail.com> wrote:
>
> > Hi guys,
> >
> > I am developing a heavy traffic web site entirely in Wicket 7 and I have
> > some questions about page caching.
> >
> > The approach I took was to generate the product page HTML from Wicket
> > statically saving these files to be served direct to the user as a Wicket
> > Resource.
> >
> > These pages has a Wicket contact form panel witch are dynamically loaded
> > using my own ajax that calls the mounted form panel from and manually
> > updates the HTML the the form panel generated markup.
> >
> > //pseudo code ^^
> >
> > //normal wicket form panel
> > mount("ad/contact")
> >
> > //static page page
> > mount("/ad/page{#id}", Resource("/static/produtc-details-{#id}.html"))
> >
> > This is working, but is not a good solution as I could only manage to get
> > the entire form html.
> > Inside the contact form I have a captcha that has an ajax link to refresh
> > its image.
> >
> > I would like to have a #formContainer at the static page then using the
> > Wicket.Ajax be able to refresh the container HTML (ad/contact) and when
> the
> > captcha needs the refresh, only the captcha has to be updated, so the
> user
> > doesn't loose the form text he could have inserted.
> >
> > It is possible to load the contact form from the static generated HTML
> > using the Wicket.Ajax and have the ajax component update working?
> >
> > If you guys have a better approach to this problem, please let me know.
> > Thanks
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Drop Down Choice default value

2015-05-12 Thread Marcel Barbosa Pinto
Another way is to provide a value on your .properties file.

For instance:

nullValid=Please choose
myFieldId.nullValid=Please choose a value for ${label}

On Tue, May 12, 2015 at 8:26 AM, Sven Meier s...@meiers.net wrote:

 Hi,

 you have to override #getNullValidDisplayValue(),
 #getNullKeyDisplayValue() is for cases where null is *not* valid.

 Regards
 Sven



 On 12.05.2015 12:44, Chris wrote:

 Hi all,

 I have a Drop down choice field and would like to override the default
 select value.

 I have made following settings but the default value is empty. Is there
 sth missing?

 setNullValid(true);
 @Override
 protected String getNullKeyDisplayValue() {
  return Please choose;
 }
 Thanks, Chris



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




-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: measure time user stays on page

2015-05-11 Thread Marcel Barbosa Pinto
You  can create a pixel image and compare a session time on the server..
Most likely the solution used by Google Analytics...
Em 11/05/2015 13:38, Christoph Läubrich lae...@googlemail.com escreveu:

 If you are really eager to do so (in fact this is some kind of user
 tracking that might be problematic as well as you users might try to block
 it ...) you can fire an AJAX call in the domReady and one in the close
 callback or when clicking a link. In fact you can only GUESS the time a
 user stays on page...

 Am 11.05.2015 16:51, schrieb Chris:

 Hi Martin,

 Safari by default has turned cache on and therefore when clicking
 browser-back the page is loaded from the browser’s cache.
 Is there a way to circumvent this issue so that I can measure the time
 users spent on a current page somehow?

 best regards, Chris





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




Re: measure time user stays on page

2015-05-10 Thread Marcel Barbosa Pinto
You could override the onRender method that is executed every time the page
is rendered on the browser.
Em 10/05/2015 17:43, Chris chris...@gmx.at escreveu:

 Hi all,

 I would like to measure the time the user stays at a certain page. I would
 do this by querying the system’s time when loading the page (in the page
 constructor) and the system time when clicking on a link that refers the
 user to the next page.
 However, if the user hits the browser back button, the last version of the
 page is displayed without loading the page via its constructor.

 What would be the best solution to measure the time spent on a page?

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




Re: measure time user stays on page

2015-05-10 Thread Marcel Barbosa Pinto
Hmm, it can be a browser cache issue,  or the Wicket cache.. Try call the
setVersioned(false)
Em 10/05/2015 18:09, Chris chris...@gmx.at escreveu:

 Thanks but the methods such as onBeforeRender seem not be called on
 browser back.

 Chris


  Am 10.05.2015 um 22:54 schrieb Marcel Barbosa Pinto 
 marcel.po...@gmail.com:
 
  You could override the onRender method that is executed every time the
 page
  is rendered on the browser.
  Em 10/05/2015 17:43, Chris chris...@gmx.at escreveu:
 
  Hi all,
 
  I would like to measure the time the user stays at a certain page. I
 would
  do this by querying the system’s time when loading the page (in the page
  constructor) and the system time when clicking on a link that refers the
  user to the next page.
  However, if the user hits the browser back button, the last version of
 the
  page is displayed without loading the page via its constructor.
 
  What would be the best solution to measure the time spent on a page?
 
  Thanks, Chris
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




Re: Drop Down Choice

2015-05-10 Thread Marcel Barbosa Pinto
Hi.. If you want only the selected value, you could create a hidden field
to mirror the dropdown's value.
Em 10/05/2015 14:48, Sebastien seb...@gmail.com escreveu:

 Hi Chris,

 AFAIK no. I don't know if such request feature has already been
 discussed...

 Otherwise, I think this could be integrated in wicket-kendo-ui
 http://demos.telerik.com/kendo-ui/dropdownlist/index

 If you are interested with, please open a ticket here:
 https://github.com/sebfz1/wicket-jquery-ui/issues

 Thanks  best regards,
 Sebastien.


 On Sun, May 10, 2015 at 7:10 PM, Chris chris...@gmx.at wrote:

  Hi all,
 
  is it possible to have a drop-down box without a list of choices (the
 list
  is directly coded in html as select and only the selected value should
 be
  read)?
 
  Thanks, Chris
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



NashornResourceReference

2015-05-10 Thread Marcel Barbosa Pinto
I've been working on an unusual app, it's main purpose is to allow to write
a page using Javascript/Nashorn JVM capabilities as a Wicket
ResourceReference.

https://github.com/mbppower/scalaWicket

Maybe it can be useful to someone.