Re: Repainting only newly-created repeater items via ajax

2011-12-13 Thread vineet semwal
Hi Arjun,
i am glad repeating view worked for you :)
btw in the listiview code,you only need the new item to render at a time so
it should be target.add(li)

though not the problem currently,your js code should be less dependent
on wicket js ,it will be good in the long run
as wicket js might change in the new versions..

On Tue, Dec 13, 2011 at 10:30 AM, Arjun Dhar dhar...@yahoo.com wrote:
 ok, its official. using ListView in this situation is a major
 *Pain_In_The_A*

 Using RepeatingView it was smooth.

 However, as far as I got with using ListView (for the sake of
 documentation); .. is that the script will need to be modified. I think the
 li adds one more level of abstraction. When I replaced prepend with
 append the tr showed up but was blank. (No innerHTML).

 Thanks Vineet, you  great help in both your suggestions.



 -
 Software documentation is like sex: when it is good, it is very, very good; 
 and when it is bad, it is still better than nothing!
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Repainting-only-newly-created-repeater-items-via-ajax-tp4186028p4188835.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




-- 
thank you,

regards,
Vineet Semwal

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



ResourceResponse to return error status code but also JSON error message

2011-12-13 Thread Serban Balamaci
Hello,
I'm using an AbstractResource to return JSON entities.

Problem is that it seems you cannot also return an error code and also the
JSON string with detailed message in case of error.
response.setWriteCallback(new WriteCallback()
{
@Override
public void writeData(final Attributes attributes) {
   
((WebResponse)attributes.getResponse()).write(errorResponse);
((WebResponse)attributes.getResponse()).sendError(503,
Logical Error);
}
}

Because sendError begins with a checkHeader() method that throws a Header
was already written to response! error

Any ideas how I can get this working?
Thanks.

-
http://balamaci.wordpress.com 
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceResponse-to-return-error-status-code-but-also-JSON-error-message-tp4189792p4189792.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



Update ajax target on onmouseover, but just once

2011-12-13 Thread Gregor Kaczor

Hi!

I have a link of which I show only the file name, the href attribute is 
empty.


On an onmouseover event I would like to update the link via ajax to show 
it completely with href attribute.


To avoid unnecessary load on the server this should happen just once per 
link on the page.


If the page gets reloaded the link will be again shown only by name with 
emptry href -attribute.


Any ideas?

Gregor
--
How to find files on the Internet? FindFiles.net http://findfiles.net!


Re: ResourceResponse to return error status code but also JSON error message

2011-12-13 Thread Martin Grigorov
You cannot have both response body and error.
If you realize that an error should be returned then do:
requestCycle.scheduleRequestHandlerAfterCurrent(new
org.apache.wicket.request.http.handler.ErrorCodeRequestHandler.ErrorCodeRequestHandler(int,
String))

On Tue, Dec 13, 2011 at 12:03 PM, Serban Balamaci
serban.balam...@asf.ro wrote:
 Hello,
 I'm using an AbstractResource to return JSON entities.

 Problem is that it seems you cannot also return an error code and also the
 JSON string with detailed message in case of error.
        response.setWriteCallback(new WriteCallback()
        {
            @Override
            public void writeData(final Attributes attributes) {

 ((WebResponse)attributes.getResponse()).write(errorResponse);
                    ((WebResponse)attributes.getResponse()).sendError(503,
 Logical Error);
 }
 }

 Because sendError begins with a checkHeader() method that throws a Header
 was already written to response! error

 Any ideas how I can get this working?
 Thanks.

 -
 http://balamaci.wordpress.com
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ResourceResponse-to-return-error-status-code-but-also-JSON-error-message-tp4189792p4189792.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Refresh a textField

2011-12-13 Thread nunurs
Hello,

I have this TextField linked with the attribute codeAgent of my object
comment : 
*final* TextFieldString codeAgent = *new* TextFieldString(codeAgent,
new PropertyModelString(  comment, codeAgent));

I want to change in java the value of codeAgent, can you tell me, if it is
possible, how also changed the value displayed by this textField on my web
page ?

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refresh-a-textField-tp4190022p4190022.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: Update ajax target on onmouseover, but just once

2011-12-13 Thread Martin Grigorov
Hi,

You will need to add some JavaScript logic to the button.
For example: if there is attribute with name data-href then use it
and don't make the Ajax call, otherwise make the call and save the
returned href in data-href to reuse it for the next mouseovers.

See IAjaxCallDecorator.

On Tue, Dec 13, 2011 at 12:18 PM, Gregor Kaczor gkac...@gmx.de wrote:
 Hi!

 I have a link of which I show only the file name, the href attribute is
 empty.

 On an onmouseover event I would like to update the link via ajax to show it
 completely with href attribute.

 To avoid unnecessary load on the server this should happen just once per
 link on the page.

 If the page gets reloaded the link will be again shown only by name with
 emptry href -attribute.

 Any ideas?

 Gregor
 --
 How to find files on the Internet? FindFiles.net http://findfiles.net!



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Refresh a textField

2011-12-13 Thread Martin Grigorov
Hi,

You can change comment's codeAgent. The next time the text field is
rendered it will show the new value.

On Tue, Dec 13, 2011 at 12:56 PM, nunurs magicbea...@gmail.com wrote:
 Hello,

 I have this TextField linked with the attribute codeAgent of my object
 comment :
 *final* TextFieldString codeAgent = *new* TextFieldString(codeAgent,
 new PropertyModelString(      comment, codeAgent));

 I want to change in java the value of codeAgent, can you tell me, if it is
 possible, how also changed the value displayed by this textField on my web
 page ?

 Thanks



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Refresh-a-textField-tp4190022p4190022.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Refresh a textField

2011-12-13 Thread nunurs
In fact i put this textField into a table with an id like this : 
table style=margin-left: 30px; bwicket:id=commentZone*
   tr
  tdComment/td
  td
 textarea wicket:id=codeAgent/textarea
  /td
   /tr
   
/table

On the same web page i have an AjaxButton, which allows to search, into a
list of object, the object with the codeAgent set at the value of the
textfield below and fill the others component of my table.

The java code looks like : 

add (new AjaxButton(Search) {
   @Override
   protected void onSubmit(AjaxRequestTarget target, Form? form) {
  // research code and set to comment the object found
  [...]
  // update the commentZone
  target.add(commentZone);
   }
});

The research code works fine but passed the update of the commentZone, all
the component stays empty even if my object comment contains data...

sorry for my english :s



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refresh-a-textField-tp4190022p4190930.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: abstract column property column

2011-12-13 Thread ridaa
sorry...
but still i am not clear.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/abstract-column-property-column-tp4186596p4190968.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: check all checkbox to select all in data table

2011-12-13 Thread Andrea Del Bene

See component CheckboxMultipleChoiceSelector

Hi..

I have included a check box panel as a column in datatable.Now i want a
checkAll/uncheckAll checkbox which will check/uncheck the checkbox
column.Please provide me with some idea .



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/check-all-checkbox-to-select-all-in-data-table-tp4190985p4190985.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: Restartable Self Updating Timer Behavior

2011-12-13 Thread sudeivas
I think the issue is because even after the timer is stopped, in the next
cycle a call is going to 

AbstractDefaultAjaxBehavior -  onRequest()

and because of that its throwing ListenerInvocationNotAllowedException. 

In AbstractAjaxRestartableTimerBehavior.java given in JIRA, the stop()
method just sets the stopped flag to true. 

Also I am not able to override onRequest() in
AbstractDefaultAjaxBehavior.java as it is a final method. Do I need to do
anything else in stop() method?

Thanks,
Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Restartable-Self-Updating-Timer-Behavior-tp4188179p4191100.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: abstract column property column

2011-12-13 Thread Martin Grigorov
Check their source and how they are used.

On Tue, Dec 13, 2011 at 6:16 PM, ridaa ridaa...@yahoo.com wrote:
 sorry...
 but still i am not clear.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/abstract-column-property-column-tp4186596p4190968.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Restartable Self Updating Timer Behavior

2011-12-13 Thread Martin Grigorov
You need to tweak behavior's #isEnabled()

On Tue, Dec 13, 2011 at 6:50 PM, sudeivas sureshkumar@gmail.com wrote:
 I think the issue is because even after the timer is stopped, in the next
 cycle a call is going to

 AbstractDefaultAjaxBehavior -  onRequest()

 and because of that its throwing ListenerInvocationNotAllowedException.

 In AbstractAjaxRestartableTimerBehavior.java given in JIRA, the stop()
 method just sets the stopped flag to true.

 Also I am not able to override onRequest() in
 AbstractDefaultAjaxBehavior.java as it is a final method. Do I need to do
 anything else in stop() method?

 Thanks,
 Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Restartable-Self-Updating-Timer-Behavior-tp4188179p4191100.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Restartable Self Updating Timer Behavior

2011-12-13 Thread sudeivas
I tried to call the stop() in AjaxRestartableSelfUpdatingTimerBehavior.java
when the page starts. But after 30 secs( timer interval), the stopped
flagged reverts back to the default value i.e false. So isEnabled() always
returns true. I am not sure whether this a bug. 

As a temporary fix, I have set the initial value of stopped flag in
AjaxRestartableSelfUpdatingTimerBehavior.java to true. And everytime I get
the org.apache.wicket.request.handler.ListenerInvocationNotAllowedException,
I just catch the exception and refresh the page. I am getting this exception
when I try to stop the timer.


Thanks,
Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Restartable-Self-Updating-Timer-Behavior-tp4188179p4191274.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: Spring + MongoDb

2011-12-13 Thread Uwe Schäfer

On 12/13/2011 05:28 AM, Jeff Schneller wrote:

As Martijn suggested I could just use the mongodb without the spring-data 
layer.  Will I run into problems in the future if I go this route?


you could also use morphia with/or without spring

cu uwe

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



PagingNavigator container instead of link for previous and next

2011-12-13 Thread infiniter
I extended Pagingavigator and the markup for the previous (and next) button
looks like this:

Enabled state (current page  0)

li class=previous-on button
 # Prev 
/li

Disabled state (current page == 0)

li class=previous-off button
 # Prev 
/li
 
PagingNavigator creates a link using newPagingNavigationLink and adds it on
onBeforeRender(). Since I need to vary the class name in the li element I
would have to place that link inside a container or a fragment; however I
cannot do that since the onBeforeRender() already adds the link to the
PagingNavigator panel, and trying to override onBeforeRender() to add the
link inside a container may not be a great idea because I still need to call
super.onBeforeRender(), and I know of no way to call
super.super.onBeforeRender()... To avoid calling super.OnBeforeRender() I
cannot just copy-paste the instructions in Component.onBeforeRender()
because onBeforeRenderChildren() is not accessible outside its package, so
there are some NASTY options: 
-create my PagingNavigator subclass under the same package of Component and
use the just-mentioned approach
-Overriding onBeforeRender() and remove the just added previous and next
links
-create a whole new navigator and forget extending from PagingNavigator

But, is there a nice solution? (Wicket version: 1.4.15)


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PagingNavigator-container-instead-of-link-for-previous-and-next-tp4192293p4192293.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: Spring + MongoDb

2011-12-13 Thread Jeff Schneller
How stable is morphia?  is it ready for production use?  Have you used it with 
wicket?

--  
Jeff Schneller
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, December 13, 2011 at 3:31 PM, Uwe Schäfer wrote:

 On 12/13/2011 05:28 AM, Jeff Schneller wrote:
  As Martijn suggested I could just use the mongodb without the spring-data 
  layer. Will I run into problems in the future if I go this route?
  
  
 you could also use morphia with/or without spring
  
 cu uwe
  
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org 
 (mailto:users-unsubscr...@wicket.apache.org)
 For additional commands, e-mail: users-h...@wicket.apache.org 
 (mailto:users-h...@wicket.apache.org)
  
  




Re: PagingNavigator container instead of link for previous and next

2011-12-13 Thread Per Newgro

Add an attributemodifier to component created in

newPagingNavigationLink


Cheers
Per

Am 13.12.2011 23:06, schrieb infiniter:

I extended Pagingavigator and the markup for the previous (and next) button
looks like this:

Enabled state (current page  0)

 li class=previous-on button
  # Prev
 /li

Disabled state (current page == 0)

 li class=previous-off button
  # Prev
 /li

PagingNavigator creates a link using newPagingNavigationLink and adds it on
onBeforeRender(). Since I need to vary the class name in the li element I
would have to place that link inside a container or a fragment; however I
cannot do that since the onBeforeRender() already adds the link to the
PagingNavigator panel, and trying to override onBeforeRender() to add the
link inside a container may not be a great idea because I still need to call
super.onBeforeRender(), and I know of no way to call
super.super.onBeforeRender()... To avoid calling super.OnBeforeRender() I
cannot just copy-paste the instructions in Component.onBeforeRender()
because onBeforeRenderChildren() is not accessible outside its package, so
there are some NASTY options:
-create my PagingNavigator subclass under the same package of Component and
use the just-mentioned approach
-Overriding onBeforeRender() and remove the just added previous and next
links
-create a whole new navigator and forget extending from PagingNavigator

But, is there a nice solution? (Wicket version: 1.4.15)


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PagingNavigator-container-instead-of-link-for-previous-and-next-tp4192293p4192293.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