Re: wicket osgi (not Pax)

2010-10-12 Thread kugaprakash

Hi,
I have multiple Wicket Applications running on different servers, each of
them runs on OSGI/Jetty, and a Master Wicket Application also runs on
OSGI/Jetty. Master wicket application, has its own server, where it gets the
data from the sub servers.

Do you recommend Pax Wicket for such architechture?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-osgi-not-Pax-tp1893713p2991185.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket osgi (not Pax)

2010-10-12 Thread David Leangen

If you're already using Wicket successfully in OSGi, then I don't see what 
benefit using pax-wicket will add for you.

pax-wicket is useful to help get you going in OSGi, since the class loading / 
serialization stuff can be tricky. Sounds like you're doing ok, though.


=David



On Oct 12, 2010, at 3:09 PM, kugaprakash wrote:

 
 Hi,
 I have multiple Wicket Applications running on different servers, each of
 them runs on OSGI/Jetty, and a Master Wicket Application also runs on
 OSGI/Jetty. Master wicket application, has its own server, where it gets the
 data from the sub servers.
 
 Do you recommend Pax Wicket for such architechture?
 -- 
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-osgi-not-Pax-tp1893713p2991185.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: DropDownChoice loses Selection in Disabled Panels

2010-10-12 Thread vov

Can you write your code?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-loses-Selection-in-Disabled-Panels-tp2989677p2991210.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: Page Expired page with PatternDateConverter

2010-10-12 Thread Altuğ Bilgin Altıntaş
quickstart

11 Ekim 2010 16:00 tarihinde Hemant Shah prot...@gmail.com yazdı:

  Yes, it works fine if we do not override the getConverter method. In which
 case it behaves like a normal AjaxEditableLabel, as would be expected, and
 we are using AjaxEditableLabel instances in many places in our application.


 - Hemant


 On 10/11/2010 6:24 AM, Altuğ Bilgin Altıntaş wrote:

 if you don't override IConverter then everything works fine ?

 2010/10/11 Hemant Shahprot...@gmail.com

   Altuğ, thanks for responding.

 There are no errors reported in the log. All the classes in the project
 are
 serializable.

 Could this be a bug?

 Regards,


 Hemant



 On 10/10/2010 5:03 PM, Altuğ Bilgin Altıntaş wrote:

  Did you look at Wicket's logs ?

 Be sure serialization is done correctly.

 2010/10/10 Hemant Shahprot...@gmail.com

   I am new to the Wicket framework and I hope I can get some help with a

 problem I am facing.

 I am using version 1.4.12.

 I am overriding the AjaxEditableLabel class and its overridden
 getConverter
 method is at follows:

@Override
public IConverter. getConverter(Class type) {
return new PatternDateConverter(MM/dd/, true);
}

 However, the first time in a session the component is updated, I get
 the
 Page Expired message.  The error results only when the getConverter
 method
 is called.

 Note that this happens only the first time I access it in a session. If
 I
 go to the home page and from there back to the page which contains the
 component, it works without any problems.

 I am not sure how to overcome this problem. I hope you guys can help.
 Thanks.


 - Hemant






How to trigger server-side method when user clicks on a Table Row

2010-10-12 Thread duncan787

I am implementing a DataView using an HTML Table and I need to allow the user
to select a row in the table to tell the Server Side which row they
selected.  I could implement this by using AjaxFallbackLink, but this would
only link the text in the row, the user needs to be able to click anywhere
in the row, so I need the ability to detect when the user clicks anywhere in
the row, like an onclick event on the TR element (or the TD elements). 
Is there a way to tell the server side when this happens?  Here is my markup
and I'm implementing DataView:

div wicket:id=projectListDataViewContainer
table
tr wicket:id=siteProjectList
td /td
td class=projectDesc/td
/tr
/table
/div

Thank you
duncan787
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991576.html
Sent from the Users forum mailing list archive at Nabble.com.

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



wicket 1.5, resource gives error in log?

2010-10-12 Thread nino martinez wael
Hi

I have something where I reference an image directly in html, wicket has no
idea what it should do with it so it passes the request to the servlet
container.. And it works as I wanted, but should it give an error message?
Or am I doing something wrong?

html:
 img src=/images/icons/arrow_down_end.png/

Log:
ERROR [org.apache.wicket.request.cycle.RequestCycle]  - Unable to execute
request. No suitable RequestHandler found.
URL=images/icons/arrow_down_end.png

regards Nino


submit or refresh form via ajax from javascript ?

2010-10-12 Thread Maris Orbidans


Is it possible to submit a form from javascript ?



Maris

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



RE: Getting client IP address

2010-10-12 Thread Maris Orbidans


 -Original Message-
 From: Josh Kamau [mailto:joshnet2...@gmail.com]
 Sent: 06 October 2010 12:31
 To: users@wicket.apache.org
 Subject: Re: Getting client IP address
 
 Thanks guys, I got the IP address. Is it possible to get the client
 computer
 name?

nope

Maris


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



Re: DropDownChoice loses Selection in Disabled Panels

2010-10-12 Thread splitshade

Hi,

we just upgraded from 1.4.9 to 1.4.10 and the error seems fixed, although i
cant find something in the release notes, but thank you for your help!

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-loses-Selection-in-Disabled-Panels-tp2989677p2991641.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: How to trigger server-side method when user clicks on a Table Row

2010-10-12 Thread James Carman
Have you tried attaching your AjaxFallbackLink to your tr elements?

On Tue, Oct 12, 2010 at 6:27 AM, duncan787 duncan...@gmail.com wrote:


 I am implementing a DataView using an HTML Table and I need to allow the
 user
 to select a row in the table to tell the Server Side which row they
 selected.  I could implement this by using AjaxFallbackLink, but this would
 only link the text in the row, the user needs to be able to click anywhere
 in the row, so I need the ability to detect when the user clicks anywhere
 in
 the row, like an onclick event on the TR element (or the TD elements).
 Is there a way to tell the server side when this happens?  Here is my
 markup
 and I'm implementing DataView:

div wicket:id=projectListDataViewContainer
table
tr wicket:id=siteProjectList
td /td
td class=projectDesc/td
/tr
/table
/div

 Thank you
 duncan787
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991576.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: Getting client IP address

2010-10-12 Thread James Carman
ServletRequest.getRemoteHost():

Returns the fully qualified name of the client or the last proxy that
sent the request. If the engine cannot or chooses not to resolve the
hostname (to improve performance), this method returns the
dotted-string form of the IP address. For HTTP servlets, same as the
value of the CGI variable REMOTE_HOST.

On Tue, Oct 12, 2010 at 7:14 AM, Maris Orbidans maris.orbid...@ingg.com wrote:


  -Original Message-
  From: Josh Kamau [mailto:joshnet2...@gmail.com]
  Sent: 06 October 2010 12:31
  To: users@wicket.apache.org
  Subject: Re: Getting client IP address
 
  Thanks guys, I got the IP address. Is it possible to get the client
  computer
  name?

 nope

 Maris


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


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



RE: Getting client IP address

2010-10-12 Thread Maris Orbidans
Yes, hostname.
Sorry, I thought about something else.

 -Original Message-
 From: jcar...@carmanconsulting.com
[mailto:jcar...@carmanconsulting.com]
 On Behalf Of James Carman
 Sent: 12 October 2010 12:25
 To: users@wicket.apache.org
 Subject: Re: Getting client IP address
 
 ServletRequest.getRemoteHost():
 
 Returns the fully qualified name of the client or the last proxy that
 sent the request. If the engine cannot or chooses not to resolve the
 hostname (to improve performance), this method returns the
 dotted-string form of the IP address. For HTTP servlets, same as the
 value of the CGI variable REMOTE_HOST.
 
 On Tue, Oct 12, 2010 at 7:14 AM, Maris Orbidans
maris.orbid...@ingg.com
 wrote:
 
 
   -Original Message-
   From: Josh Kamau [mailto:joshnet2...@gmail.com]
   Sent: 06 October 2010 12:31
   To: users@wicket.apache.org
   Subject: Re: Getting client IP address
  
   Thanks guys, I got the IP address. Is it possible to get the
client
   computer
   name?
 
  nope
 
  Maris
 
 
 
-
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 _
 This e-mail has been scanned for viruses by MessageLabs.

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



Re: Getting client IP address

2010-10-12 Thread James Carman
It's not terribly reliable from what I remember, but if it works, it works. :)

On Tue, Oct 12, 2010 at 7:50 AM, Maris Orbidans maris.orbid...@ingg.com wrote:
 Yes, hostname.
 Sorry, I thought about something else.

 -Original Message-
 From: jcar...@carmanconsulting.com
 [mailto:jcar...@carmanconsulting.com]
 On Behalf Of James Carman
 Sent: 12 October 2010 12:25
 To: users@wicket.apache.org
 Subject: Re: Getting client IP address

 ServletRequest.getRemoteHost():

 Returns the fully qualified name of the client or the last proxy that
 sent the request. If the engine cannot or chooses not to resolve the
 hostname (to improve performance), this method returns the
 dotted-string form of the IP address. For HTTP servlets, same as the
 value of the CGI variable REMOTE_HOST.

 On Tue, Oct 12, 2010 at 7:14 AM, Maris Orbidans
 maris.orbid...@ingg.com
 wrote:
 
 
   -Original Message-
   From: Josh Kamau [mailto:joshnet2...@gmail.com]
   Sent: 06 October 2010 12:31
   To: users@wicket.apache.org
   Subject: Re: Getting client IP address
  
   Thanks guys, I got the IP address. Is it possible to get the
 client
   computer
   name?
 
  nope
 
  Maris
 
 
 
 -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 

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


 _
 This e-mail has been scanned for viruses by MessageLabs.

 -
 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: repaint a fragment

2010-10-12 Thread fachhoch

I am confused , 

I have an Item with a fragment .

to repaint  this fragment I should just add this item to target and no need
of calling item.replaceWith(new Freagment()) ?

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



AjaxLazyLoadPanel in WiQuery Accordion

2010-10-12 Thread Reinout van Schouwen
Hi all,

When I use an AjaxLazyLoadPanel within a WiQuery Accordion widget, the
panel that replaces the loading placeholder doesn't get the correct
CSS class attributes.
What's the right way to set the class attributes of the lazyloadcomponent?

Thanks,

-- 
Reinout van Schouwen
http://vanschouwen.info/

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



Re: AjaxLazyLoadPanel in WiQuery Accordion

2010-10-12 Thread julien roche AKA indiana_jules
Hi Reinout,

Can you post your HTML code please ? Because I think the better way with an
ajaxLazyLoadPanel will be like this:

div wicket:id=accordion
h3a href=#First header/a/h3
divdiv wicket:id=lazy/div/div
h3a href=#Second header/a/h3
divSecond content/div
/div

Where lazy is a child of the Accordion section, not the Accordion section.
Otherwise, jQuery UI will inject the CSS classes but the Ajax request will
replace the Div and so, erase the injected CSS.

Regards

Julien Roche


On Tue, Oct 12, 2010 at 3:01 PM, Reinout van Schouwen rein...@gmail.comwrote:

 Hi all,

 When I use an AjaxLazyLoadPanel within a WiQuery Accordion widget, the
 panel that replaces the loading placeholder doesn't get the correct
 CSS class attributes.
 What's the right way to set the class attributes of the lazyloadcomponent?

 Thanks,

 --
 Reinout van Schouwen
 http://vanschouwen.info/

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




Re: submit or refresh form via ajax from javascript ?

2010-10-12 Thread jcgarciam

Simple javascript:

var theForm = document.getElementById(formId);
theForm.submit();




On Tue, Oct 12, 2010 at 7:53 AM, Maris Orbidans [via Apache Wicket] 
ml-node+2991613-1252635351-65...@n4.nabble.comml-node%2b2991613-1252635351-65...@n4.nabble.com
 wrote:



 Is it possible to submit a form from javascript ?



 Maris

 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2991613i=0
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2991613i=1



 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991613.html
 To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991835.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: How to trigger server-side method when user clicks on a Table Row

2010-10-12 Thread duncan787

Its already attached to the DataView, see the relevant/simplified Java code
added below.  Would it best practice be to assign a WebMarkupContainer to
the TR element and add both an AjaxFallbackLink and a DataView to the
container?

DataViewSiteProject projectListDataView = 
new DataViewSiteProject(siteProjectList, getDataProvider(), 100)
{
@Override
protected void populateItem(final ItemSiteProject item)
{
SiteProject siteProject = item.getModelObject();
item.add(new Label(ProjectDesc,
siteProject.getProjectDesc()));
}
};

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991852.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



robots.txt wicket urls

2010-10-12 Thread Jeffrey Schneller
How can I add an entry to robots.txt for a page of my site that is not
currently mounted and cannot be made bookmarkable.  The url is the
wicket url of ?wicket:interface.

I guess I could say block everything that contains ?wicket:interface
but that seems kind of brute force.  

 

I tried using IndexedHybridUrlCodingStrategy and HybridUrlCodingStrategy
to mount the page as a named page.  This works but then if someone
changes the number after the . in the url, they may request a page out
of the pagemap and an exception is thrown and we show our error page.
Is this the only way to do it?

 

Thanks.

 



Can i execute an inline-javascript added to head for replaced panel on ajax-response?

2010-10-12 Thread Per Newgro

 Hi *,

i would like to exchange a panel on another panel. The newly added panel 
has an AbstractBehavior which adds the script:


public ReplacementPanel(String id) {
super(id);
final Label component;
add(component = new Label(lblReplaced, Done));
add(new AbstractBehavior() {
@Override
public void renderHead(IHeaderResponse response) {
String js = $(function() 
{$(document.getElementById(\ + component.getMarkupId() + 
\).style.color=\red\);});;

response.renderJavascript(js, replaced);
super.renderHead(response);
}
});
}

But if i replace the panel and refresh it's parent on requestTarget, no 
red style is added to my label.


public MainPanel(String id) {
super(id);
add(new WebMarkupContainer(replaceMe));
add(new AjaxLinkVoid(doReplace) {
@Override
public void onClick(AjaxRequestTarget target) {
MainPanel.this.addOrReplace(new 
ReplacementPanel(replaceMe));

target.addComponent(MainPanel.this);
}
});
setOutputMarkupId(true);
}

Is it possible to execute my script in the ajax response?

Thanks for help
Per


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



Re: robots.txt wicket urls

2010-10-12 Thread Igor Vaynberg
in your robots.txt put the url without the ., that way a new version
of the page will get created.

-igor

On Tue, Oct 12, 2010 at 8:30 AM, Jeffrey Schneller
jeffrey.schnel...@envisa.com wrote:
 How can I add an entry to robots.txt for a page of my site that is not
 currently mounted and cannot be made bookmarkable.  The url is the
 wicket url of ?wicket:interface.

 I guess I could say block everything that contains ?wicket:interface
 but that seems kind of brute force.



 I tried using IndexedHybridUrlCodingStrategy and HybridUrlCodingStrategy
 to mount the page as a named page.  This works but then if someone
 changes the number after the . in the url, they may request a page out
 of the pagemap and an exception is thrown and we show our error page.
 Is this the only way to do it?



 Thanks.





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



RE: robots.txt wicket urls

2010-10-12 Thread Jeffrey Schneller
So using the HybridUrlCodingStrategy is correct and if users want to muck with 
the URL they can and they may just get an error?  Then for the robots.txt I 
just say to block XYZ without the ..  For example I have a page called 
Login that is mounted with the HybridUrlCodingStrategy.  So the url to the user 
is Login.1 or Login.7 depending on how many times they hit the page.  In the 
robots.txt I just need to say to ignore the url of Login

Can I set the pagemap to only store N number of pages per session?  I tried 
using: getSessionSettings().setMaxPageMaps(1) but what does this really do?  Is 
it 1 page per session or 1 of each page per session.  

Thanks.



-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Tuesday, October 12, 2010 12:21 PM
To: users@wicket.apache.org
Subject: Re: robots.txt  wicket urls

in your robots.txt put the url without the ., that way a new version
of the page will get created.

-igor

On Tue, Oct 12, 2010 at 8:30 AM, Jeffrey Schneller
jeffrey.schnel...@envisa.com wrote:
 How can I add an entry to robots.txt for a page of my site that is not
 currently mounted and cannot be made bookmarkable.  The url is the
 wicket url of ?wicket:interface.

 I guess I could say block everything that contains ?wicket:interface
 but that seems kind of brute force.



 I tried using IndexedHybridUrlCodingStrategy and HybridUrlCodingStrategy
 to mount the page as a named page.  This works but then if someone
 changes the number after the . in the url, they may request a page out
 of the pagemap and an exception is thrown and we show our error page.
 Is this the only way to do it?



 Thanks.





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


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



Re: PropertyModel Not Refreshing

2010-10-12 Thread Igor Vaynberg
here are the tweaks you need to make this work:

selectedRecordAModel = new PropertyModelRecordA(this, selectedRecordA);

recordAText = new RequiredTextField(recordAText,
new PropertyModel(selectedRecordAModel, name));

 recordBs.setModel(new PropertyModel(selectedRecordAModel, recordB));

have fun

-igor

On Tue, Oct 12, 2010 at 9:03 AM, Shelli Orton shelli.or...@sjrb.ca wrote:
 I've been able to create a sample application that exhibits the
 same/similar problems to mine.  The sample makes use of an in-memory
 list for the data versus accessing a database and so there's some
 differences.  However, I believe the problems that this sample exhibits
 have the same root cause as my project (which I believe have something
 to do with how my models are set up...).

 Issues this sample exhibits:

 1. Choose to edit an existing record, then cancel the edit.  Choose
 another/the same record to edit and the selected record is null (error
 message You must select a record to edit is displayed).  Must
 close/open session to reset.

 2. Choose to edit an existing record and save the edit.  Choose
 another/the same record to edit and you get a NPE:

    WicketMessage: Method onFormSubmitted of interface
 org.apache.wicket.markup.html.form.IFormSubmitListener targeted at
 component [MarkupContainer [Component id = selectForm]] threw an
 exception

    Root cause:

    java.lang.NullPointerException
    at
 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.convertCho
 iceIdToChoice(AbstractSingleSelectChoice.java:247)

 3. Create a new record and try to save it and get
 WicketRuntimeException:

    WicketMessage: Attempted to set property value on a null object.
 Property expression: name Value: New One

    Root cause:

    org.apache.wicket.WicketRuntimeException: Attempted to set property
 value on a null object. Property expression: name Value: New One
    at
 org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.j
 ava:125)

 4. Create a new record and then cancel the add, Choose an existing
 record to edit and the selected record is null (error message You must
 select a record to edit is displayed).  Must close/open session to
 reset.

 As always, all help is greatly appreciated as I am stumped.

 Thanks,
 Shelli

 -Original Message-
 From: jcgarciam [mailto:jcgarc...@gmail.com]
 Sent: Friday, October 08, 2010 1:41 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing


 The attachment didn't make it,

 Can you try to extract out the relevant part and creates a quickstart
 project that actually reproduces your issue?


 On Fri, Oct 8, 2010 at 1:41 PM, Shelli Orton [via Apache Wicket] 
 ml-node+2968688-305091622-65...@n4.nabble.comml-node%2B2968688-30509162
 2-65...@n4.nabble.com
 wrote:

 Hi,

 I have been trying different things to see if I could get my code to
 work
 (and understand Wicket models better), but am still stuck.  I have a
 attached the (latest) panel class code which I hope is sufficient to
 help.

 I was reading about different models (both online and the Wicket in
 Action
 book) and thought that perhaps using a CompoundPropertyModel was more
 appropriate and may help with my issues.  Originally, I only declared
 selectedRecordA (line 40) but didn't instantiate it.  The select group
 displayed properly but when I chose a record from the list and tried
 to edit
 it, this exception was thrown:

     WicketMessage: Attempted to set property value on a null object.
 Property expression: recordA Value: Name=A-One
     Root cause:

     org.apache.wicket.WicketRuntimeException: Attempted to set
 property
 value on a null object. Property expression: recordA Value: Name=A-One
         at

 org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.j
 ava:125)

         at

 org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractProperty
 Model.java:169)

         at
 org.apache.wicket.Component.setDefaultModelObject(Component.java:3125)
         

 I set breakpoints on the getSelectedRecordA and setSelectedRecordA
 methods,
 but these aren't called when during the request cycle when the edit
 button
 is clicked.

 I then changed the class so that selectedRecordA is initialized to an
 empty
 instance of RecordA. This got rid of the above error.  However, I
 cannot
 save the edit changes because the selectedRecordA is still the empty
 instance that was created in the initialization and the persistence
 layer
 throws an exception.  This same problem exists if I try to add a new
 RecordA
 or try to delete an existing one.

 If I choose to cancel the edit and then select another record to edit,
 I
 get the message You must select a record to edit (line 131).  This
 is
 because the cancel onSubmit sets selectedRecordA to null and choosing
 the
 record from the DDC is not setting it to the chosen record.

 Clearly I am not setting up this CompoundPropertyModel properly so
 that the
 selectedARecord is set by the 

Re: robots.txt wicket urls

2010-10-12 Thread Igor Vaynberg
the url to the user is still /Login, its just that when they go to it
they are redirected to /Login.n

in your robots.txt if you want to reference the page use /Login - this
is the url the robot has to hit to get to /Login.n

also when the user tweaks the n they should simply get a new
instance of the page, not an error.

-igor

On Tue, Oct 12, 2010 at 9:32 AM, Jeffrey Schneller
jeffrey.schnel...@envisa.com wrote:
 So using the HybridUrlCodingStrategy is correct and if users want to muck 
 with the URL they can and they may just get an error?  Then for the 
 robots.txt I just say to block XYZ without the ..  For example I have a 
 page called Login that is mounted with the HybridUrlCodingStrategy.  So the 
 url to the user is Login.1 or Login.7 depending on how many times they hit 
 the page.  In the robots.txt I just need to say to ignore the url of Login

 Can I set the pagemap to only store N number of pages per session?  I tried 
 using: getSessionSettings().setMaxPageMaps(1) but what does this really do?  
 Is it 1 page per session or 1 of each page per session.

 Thanks.



 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Tuesday, October 12, 2010 12:21 PM
 To: users@wicket.apache.org
 Subject: Re: robots.txt  wicket urls

 in your robots.txt put the url without the ., that way a new version
 of the page will get created.

 -igor

 On Tue, Oct 12, 2010 at 8:30 AM, Jeffrey Schneller
 jeffrey.schnel...@envisa.com wrote:
 How can I add an entry to robots.txt for a page of my site that is not
 currently mounted and cannot be made bookmarkable.  The url is the
 wicket url of ?wicket:interface.

 I guess I could say block everything that contains ?wicket:interface
 but that seems kind of brute force.



 I tried using IndexedHybridUrlCodingStrategy and HybridUrlCodingStrategy
 to mount the page as a named page.  This works but then if someone
 changes the number after the . in the url, they may request a page out
 of the pagemap and an exception is thrown and we show our error page.
 Is this the only way to do it?



 Thanks.





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


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



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



Re: Can i execute an inline-javascript added to head for replaced panel on ajax-response?

2010-10-12 Thread Igor Vaynberg
use renderondomreadyjavascript

-igor

On Tue, Oct 12, 2010 at 9:09 AM, Per Newgro per.new...@gmx.ch wrote:
  Hi *,

 i would like to exchange a panel on another panel. The newly added panel has
 an AbstractBehavior which adds the script:

    public ReplacementPanel(String id) {
        super(id);
        final Label component;
        add(component = new Label(lblReplaced, Done));
        add(new AbstractBehavior() {
           �...@override
            public void renderHead(IHeaderResponse response) {
                String js = $(function() {$(document.getElementById(\ +
 component.getMarkupId() + \).style.color=\red\);});;
                response.renderJavascript(js, replaced);
                super.renderHead(response);
            }
        });
    }

 But if i replace the panel and refresh it's parent on requestTarget, no red
 style is added to my label.

    public MainPanel(String id) {
        super(id);
        add(new WebMarkupContainer(replaceMe));
        add(new AjaxLinkVoid(doReplace) {
           �...@override
            public void onClick(AjaxRequestTarget target) {
                MainPanel.this.addOrReplace(new
 ReplacementPanel(replaceMe));
                target.addComponent(MainPanel.this);
            }
        });
        setOutputMarkupId(true);
    }

 Is it possible to execute my script in the ajax response?

 Thanks for help
 Per


 -
 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: Can i execute an inline-javascript added to head for replaced panel on ajax-response?

2010-10-12 Thread Igor Vaynberg
call setoutputmarkupid(true) on your label

-igor


On Tue, Oct 12, 2010 at 10:14 AM, Per Newgro per.new...@gmx.ch wrote:
  Thanks Igor,

 but it didn't work. It seems that my label has no id in the response and
 thus the script can't find the element.

 div
 spanDone/span
 /div

 This should be lblReplaced3 after the ajax-refresh. Do i have to do
 something special for using replace with ajax?

 Thanks
 Per


 Here is the response
 *INFO: *focus set on doReplace2
 *INFO: *Using XMLHttpRequest transport
 *INFO: *
 *INFO: *Initiating Ajax GET request on
 ?wicket:interface=:0:main:doReplace::IBehaviorListener:0:random=0.27541138352960803
 *INFO: *Invoking pre-call handler(s)...
 *INFO: *Received ajax response (1202 characters)
 *INFO: *
 ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution
 encoding=wicket1 ![CDATA[head
 xmlns:wicket=http://wicket.apache.org;script type=text/javascript
 src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script
 script type=text/javascript
 src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script
 script type=text/javascript
 src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script
 script type=text/javascript
 id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/
 wicketAjaxDebugEnable=true;
 /*--]^]^*//script

 /head]]/header-contributioncomponent id=main1  encoding=wicket1
![CDATA[div id=main1
 div
 spanDone/span
 /div
 a id=doReplace2 href=# onclick=var
 wcall=wicketAjaxGet('?wicket:interface=:0:main:doReplace::IBehaviorListener:0:-1',function()
 { }.bind(this),function() { }.bind(this), function() {return
 Wicket.$('doReplace2') != null;}.bind(this));return !wcall;[Link]^/a
 /div]]/componentevaluate![CDATA[document.getElementById(lblReplaced3).style.color=red;]]/evaluate/ajax-response
 *INFO: *Response parsed. Now invoking steps...
 *INFO: *returned focused element: http://localhost:8080/#
 *INFO: *returned focused element: http://localhost:8080/#
 *ERROR: *Wicket.Ajax.Call.processEvaluation: Exception evaluating
 javascript: TypeError: document.getElementById(lblReplaced3) is null
 *INFO: *Response processed successfully.
 *INFO: *Invoking post-call handler(s)...
 *INFO: *Calling focus on doReplace2
 *INFO: *focus set on doReplace2
 *INFO: *focus removed from doReplace2
 *INFO: *focus set on wicketDebugLink
 *INFO: *focus removed from wicketDebugLink


 use renderondomreadyjavascript

 -igor




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



RE: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
Thanks for the help.  Your changes got rid of the errors and I can delete 
records now (and the list is updated).  

However, once a record has been selected for edit and either saved or 
cancelled, that same record is always displayed in the edit group when I choose 
another record to edit or even when I try to create a new one.  I can even 
delete the chosen record and it still displays in the edit group.

Shelli

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Tuesday, October 12, 2010 10:38 AM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

here are the tweaks you need to make this work:

selectedRecordAModel = new PropertyModelRecordA(this, selectedRecordA);

recordAText = new RequiredTextField(recordAText,
new PropertyModel(selectedRecordAModel, name));

 recordBs.setModel(new PropertyModel(selectedRecordAModel, recordB));

have fun

-igor

On Tue, Oct 12, 2010 at 9:03 AM, Shelli Orton shelli.or...@sjrb.ca wrote:
 I've been able to create a sample application that exhibits the
 same/similar problems to mine.  The sample makes use of an in-memory
 list for the data versus accessing a database and so there's some
 differences.  However, I believe the problems that this sample exhibits
 have the same root cause as my project (which I believe have something
 to do with how my models are set up...).

 Issues this sample exhibits:

 1. Choose to edit an existing record, then cancel the edit.  Choose
 another/the same record to edit and the selected record is null (error
 message You must select a record to edit is displayed).  Must
 close/open session to reset.

 2. Choose to edit an existing record and save the edit.  Choose
 another/the same record to edit and you get a NPE:

    WicketMessage: Method onFormSubmitted of interface
 org.apache.wicket.markup.html.form.IFormSubmitListener targeted at
 component [MarkupContainer [Component id = selectForm]] threw an
 exception

    Root cause:

    java.lang.NullPointerException
    at
 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.convertCho
 iceIdToChoice(AbstractSingleSelectChoice.java:247)

 3. Create a new record and try to save it and get
 WicketRuntimeException:

    WicketMessage: Attempted to set property value on a null object.
 Property expression: name Value: New One

    Root cause:

    org.apache.wicket.WicketRuntimeException: Attempted to set property
 value on a null object. Property expression: name Value: New One
    at
 org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.j
 ava:125)

 4. Create a new record and then cancel the add, Choose an existing
 record to edit and the selected record is null (error message You must
 select a record to edit is displayed).  Must close/open session to
 reset.

 As always, all help is greatly appreciated as I am stumped.

 Thanks,
 Shelli

 -Original Message-
 From: jcgarciam [mailto:jcgarc...@gmail.com]
 Sent: Friday, October 08, 2010 1:41 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing


 The attachment didn't make it,

 Can you try to extract out the relevant part and creates a quickstart
 project that actually reproduces your issue?


 On Fri, Oct 8, 2010 at 1:41 PM, Shelli Orton [via Apache Wicket] 
 ml-node+2968688-305091622-65...@n4.nabble.comml-node%2B2968688-30509162
 2-65...@n4.nabble.com
 wrote:

 Hi,

 I have been trying different things to see if I could get my code to
 work
 (and understand Wicket models better), but am still stuck.  I have a
 attached the (latest) panel class code which I hope is sufficient to
 help.

 I was reading about different models (both online and the Wicket in
 Action
 book) and thought that perhaps using a CompoundPropertyModel was more
 appropriate and may help with my issues.  Originally, I only declared
 selectedRecordA (line 40) but didn't instantiate it.  The select group
 displayed properly but when I chose a record from the list and tried
 to edit
 it, this exception was thrown:

     WicketMessage: Attempted to set property value on a null object.
 Property expression: recordA Value: Name=A-One
     Root cause:

     org.apache.wicket.WicketRuntimeException: Attempted to set
 property
 value on a null object. Property expression: recordA Value: Name=A-One
         at

 org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.j
 ava:125)

         at

 org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractProperty
 Model.java:169)

         at
 org.apache.wicket.Component.setDefaultModelObject(Component.java:3125)
         

 I set breakpoints on the getSelectedRecordA and setSelectedRecordA
 methods,
 but these aren't called when during the request cycle when the edit
 button
 is clicked.

 I then changed the class so that selectedRecordA is initialized to an
 empty
 instance of RecordA. This got rid of the above error.  However, I
 cannot
 save the edit changes because the 

Re: PropertyModel Not Refreshing

2010-10-12 Thread Igor Vaynberg
On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton shelli.or...@sjrb.ca wrote:
 Thanks for the help.  Your changes got rid of the errors and I can delete 
 records now (and the list is updated).

 However, once a record has been selected for edit and either saved or 
 cancelled, that same record is always displayed in the edit group when I 
 choose another record to edit or even when I try to create a new one.  I can 
 even delete the chosen record and it still displays in the edit group.

works fine here, meaning you did not completely/propery apply my
changes. below is the complete file.

-igor

public class RecordAPanel extends Panel
{
private static final long serialVersionUID = 1L;

RecordAService recordAService;
RecordBService recordBService;

RecordA selectedRecordA = new RecordA();
IModelRecordA selectedRecordAModel;
String unmodifiedRecordA;

boolean isNew = false;

WebMarkupContainer selectGroup;
WebMarkupContainer editGroup;

Form selectForm;
Form editForm;

DropDownChoiceRecordA recordAs;
DropDownChoiceRecordB recordBs;

Button add;
Button edit;
Button save;
Button delete;
Button cancel;

Label editLegendLabel;
String editLegend;
Label recordALabel;
Label recordBLabel;

RequiredTextField recordAText;

@SuppressWarnings({ rawtypes, unchecked })
public RecordAPanel(String id)
{
super(id);

recordAService = ((Application)
RequestCycle.get().getApplication()).getRecordAService();
recordBService = ((Application)
RequestCycle.get().getApplication()).getRecordBService();

selectedRecordAModel = new PropertyModelRecordA(this,
selectedRecordA);
this.setDefaultModel(selectedRecordAModel);

// * Select  Group *

selectGroup = new WebMarkupContainer(selectGroup);
selectForm = new Form(selectForm);

recordAs = new DropDownChoiceRecordA(recordAs);
recordAs.setModel(selectedRecordAModel);
recordAs.setChoices(recordAsModel);
recordAs.setChoiceRenderer(new RecordARenderer());

//recordAs = (DropDownChoiceRecordA) new
DropDownChoiceRecordA(recordAs,
//new PropertyModelRecordA(this,
selectedRecordA),
//recordAsModel,
//new RecordARenderer());

recordAs.setNullValid(false);

selectForm.add(recordAs);

add = new Button(add)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
setSelectedRecordA(new RecordA());
isNew = true;
editLegend = New;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
};

selectForm.add(add);

edit = new Button(edit)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to edit.);
}
else
{
unmodifiedRecordA = selectedRecordA.getName();
isNew = false;
editLegend = Edit;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
}
};

selectForm.add(edit);

delete = new Button(delete)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to delete.);
}
else
{
// Delete the selected record
unmodifiedRecordA = selectedRecordA.getName();
recordAService.delete(selectedRecordA.getName());
selectedRecordA = null;
info(Deleted ' + unmodifiedRecordA + ');

// Force refresh of records list
RecordAPanel.this.recordAsModel.detach();
}
}
};

// Add confirmation dialog box
delete.add(new SimpleAttributeModifier(onclick,
if (!confirm('Please confirm you want to delete this
record') ){ return false; }));

selectForm.add(delete);
selectGroup.add(selectForm);

this.add(selectGroup);

// * Edit Group *

editGroup = new WebMarkupContainer(editGroup);

editLegendLabel = new Label(editLegend, new PropertyModel(this,
editLegend));

editGroup.add(editLegendLabel);

editForm = new Form(editForm);

recordALabel = new Label(recordALabel, Record A);

Re: Can i execute an inline-javascript added to head for replaced panel on ajax-response?

2010-10-12 Thread Per Newgro
 Jeeehhaa. Thanks alot Igor. That did it. Both tips together work as 
expected.


Cheers
Per

call setoutputmarkupid(true) on your label

-igor


On Tue, Oct 12, 2010 at 10:14 AM, Per Newgroper.new...@gmx.ch  wrote:

  Thanks Igor,

but it didn't work. It seems that my label has no id in the response and
thus the script can't find the element.

div
spanDone/span
/div

This should be lblReplaced3 after the ajax-refresh. Do i have to do
something special for using replace with ajax?

Thanks
Per


Here is the response
*INFO: *focus set on doReplace2
*INFO: *Using XMLHttpRequest transport
*INFO: *
*INFO: *Initiating Ajax GET request on
?wicket:interface=:0:main:doReplace::IBehaviorListener:0:random=0.27541138352960803
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (1202 characters)
*INFO: *
?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution
encoding=wicket1![CDATA[head
xmlns:wicket=http://wicket.apache.org;script type=text/javascript
src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script
script type=text/javascript
src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script
script type=text/javascript
src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script
script type=text/javascript
id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/
wicketAjaxDebugEnable=true;
/*--]^]^*//script

/head]]/header-contributioncomponent id=main1  encoding=wicket1

![CDATA[div id=main1

div
spanDone/span
/div
a id=doReplace2 href=# onclick=var
wcall=wicketAjaxGet('?wicket:interface=:0:main:doReplace::IBehaviorListener:0:-1',function()
{ }.bind(this),function() { }.bind(this), function() {return
Wicket.$('doReplace2') != null;}.bind(this));return !wcall;[Link]^/a
/div]]/componentevaluate![CDATA[document.getElementById(lblReplaced3).style.color=red;]]/evaluate/ajax-response
*INFO: *Response parsed. Now invoking steps...
*INFO: *returned focused element: http://localhost:8080/#
*INFO: *returned focused element: http://localhost:8080/#
*ERROR: *Wicket.Ajax.Call.processEvaluation: Exception evaluating
javascript: TypeError: document.getElementById(lblReplaced3) is null
*INFO: *Response processed successfully.
*INFO: *Invoking post-call handler(s)...
*INFO: *Calling focus on doReplace2
*INFO: *focus set on doReplace2
*INFO: *focus removed from doReplace2
*INFO: *focus set on wicketDebugLink
*INFO: *focus removed from wicketDebugLink


use renderondomreadyjavascript

-igor




-
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: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
Hi,

Thanks for file.  Your first email was missing these changes: 

IModelRecordA selectedRecordAModel;  (I had set mine to 
PropertyModelRecordA selectedRecordAModel;)
recordAs.setModel(selectedRecordAModel)

However, even with those changes applied, I still get the same issue of the 
selected record not updating in the edit group.  

I am deploying in Glassfish v3.  Could that have anything to do with my 
problems?

Shelli

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Tuesday, October 12, 2010 11:35 AM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton shelli.or...@sjrb.ca wrote:
 Thanks for the help.  Your changes got rid of the errors and I can delete 
 records now (and the list is updated).

 However, once a record has been selected for edit and either saved or 
 cancelled, that same record is always displayed in the edit group when I 
 choose another record to edit or even when I try to create a new one.  I can 
 even delete the chosen record and it still displays in the edit group.

works fine here, meaning you did not completely/propery apply my
changes. below is the complete file.

-igor

public class RecordAPanel extends Panel
{
private static final long serialVersionUID = 1L;

RecordAService recordAService;
RecordBService recordBService;

RecordA selectedRecordA = new RecordA();
IModelRecordA selectedRecordAModel;
String unmodifiedRecordA;

boolean isNew = false;

WebMarkupContainer selectGroup;
WebMarkupContainer editGroup;

Form selectForm;
Form editForm;

DropDownChoiceRecordA recordAs;
DropDownChoiceRecordB recordBs;

Button add;
Button edit;
Button save;
Button delete;
Button cancel;

Label editLegendLabel;
String editLegend;
Label recordALabel;
Label recordBLabel;

RequiredTextField recordAText;

@SuppressWarnings({ rawtypes, unchecked })
public RecordAPanel(String id)
{
super(id);

recordAService = ((Application)
RequestCycle.get().getApplication()).getRecordAService();
recordBService = ((Application)
RequestCycle.get().getApplication()).getRecordBService();

selectedRecordAModel = new PropertyModelRecordA(this,
selectedRecordA);
this.setDefaultModel(selectedRecordAModel);

// * Select  Group *

selectGroup = new WebMarkupContainer(selectGroup);
selectForm = new Form(selectForm);

recordAs = new DropDownChoiceRecordA(recordAs);
recordAs.setModel(selectedRecordAModel);
recordAs.setChoices(recordAsModel);
recordAs.setChoiceRenderer(new RecordARenderer());

//recordAs = (DropDownChoiceRecordA) new
DropDownChoiceRecordA(recordAs,
//new PropertyModelRecordA(this,
selectedRecordA),
//recordAsModel,
//new RecordARenderer());

recordAs.setNullValid(false);

selectForm.add(recordAs);

add = new Button(add)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
setSelectedRecordA(new RecordA());
isNew = true;
editLegend = New;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
};

selectForm.add(add);

edit = new Button(edit)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to edit.);
}
else
{
unmodifiedRecordA = selectedRecordA.getName();
isNew = false;
editLegend = Edit;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
}
};

selectForm.add(edit);

delete = new Button(delete)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to delete.);
}
else
{
// Delete the selected record
unmodifiedRecordA = selectedRecordA.getName();
recordAService.delete(selectedRecordA.getName());
selectedRecordA = null;
info(Deleted ' + unmodifiedRecordA + ');

// Force refresh of records list
RecordAPanel.this.recordAsModel.detach();
}
}
};

// Add confirmation dialog box
   

Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
No dont think so.. Please provide a quickstart.. I have had property models
working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 Hi,

 Thanks for file.  Your first email was missing these changes:

IModelRecordA selectedRecordAModel;  (I had set mine to
 PropertyModelRecordA selectedRecordAModel;)
recordAs.setModel(selectedRecordAModel)

 However, even with those changes applied, I still get the same issue of the
 selected record not updating in the edit group.

 I am deploying in Glassfish v3.  Could that have anything to do with my
 problems?

 Shelli

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:35 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton shelli.or...@sjrb.ca
 wrote:
  Thanks for the help.  Your changes got rid of the errors and I can delete
 records now (and the list is updated).
 
  However, once a record has been selected for edit and either saved or
 cancelled, that same record is always displayed in the edit group when I
 choose another record to edit or even when I try to create a new one.  I can
 even delete the chosen record and it still displays in the edit group.

 works fine here, meaning you did not completely/propery apply my
 changes. below is the complete file.

 -igor

 public class RecordAPanel extends Panel
 {
private static final long serialVersionUID = 1L;

RecordAService recordAService;
RecordBService recordBService;

RecordA selectedRecordA = new RecordA();
IModelRecordA selectedRecordAModel;
String unmodifiedRecordA;

boolean isNew = false;

WebMarkupContainer selectGroup;
WebMarkupContainer editGroup;

Form selectForm;
Form editForm;

DropDownChoiceRecordA recordAs;
DropDownChoiceRecordB recordBs;

Button add;
Button edit;
Button save;
Button delete;
Button cancel;

Label editLegendLabel;
String editLegend;
Label recordALabel;
Label recordBLabel;

RequiredTextField recordAText;

@SuppressWarnings({ rawtypes, unchecked })
public RecordAPanel(String id)
{
super(id);

recordAService = ((Application)
 RequestCycle.get().getApplication()).getRecordAService();
recordBService = ((Application)
 RequestCycle.get().getApplication()).getRecordBService();

selectedRecordAModel = new PropertyModelRecordA(this,
 selectedRecordA);
this.setDefaultModel(selectedRecordAModel);

// * Select  Group *

selectGroup = new WebMarkupContainer(selectGroup);
selectForm = new Form(selectForm);

recordAs = new DropDownChoiceRecordA(recordAs);
recordAs.setModel(selectedRecordAModel);
recordAs.setChoices(recordAsModel);
recordAs.setChoiceRenderer(new RecordARenderer());

//recordAs = (DropDownChoiceRecordA) new
 DropDownChoiceRecordA(recordAs,
//new PropertyModelRecordA(this,
 selectedRecordA),
//recordAsModel,
//new RecordARenderer());

recordAs.setNullValid(false);

selectForm.add(recordAs);

add = new Button(add)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
setSelectedRecordA(new RecordA());
isNew = true;
editLegend = New;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
};

selectForm.add(add);

edit = new Button(edit)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to edit.);
}
else
{
unmodifiedRecordA = selectedRecordA.getName();
isNew = false;
editLegend = Edit;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
}
};

selectForm.add(edit);

delete = new Button(delete)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to delete.);
}
else
{
// Delete the selected record
unmodifiedRecordA = selectedRecordA.getName();
recordAService.delete(selectedRecordA.getName());
selectedRecordA = null;
info(Deleted ' + unmodifiedRecordA + ');

  

RE: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
The quickstart was sent to the list this morning at 10:04 MST.  Does it
need to be resent?

Shelli

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Tuesday, October 12, 2010 11:52 AM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

No dont think so.. Please provide a quickstart.. I have had property
models
working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 Hi,

 Thanks for file.  Your first email was missing these changes:

IModelRecordA selectedRecordAModel;  (I had set mine to
 PropertyModelRecordA selectedRecordAModel;)
recordAs.setModel(selectedRecordAModel)

 However, even with those changes applied, I still get the same issue
of the
 selected record not updating in the edit group.

 I am deploying in Glassfish v3.  Could that have anything to do with
my
 problems?

 Shelli

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:35 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton shelli.or...@sjrb.ca
 wrote:
  Thanks for the help.  Your changes got rid of the errors and I can
delete
 records now (and the list is updated).
 
  However, once a record has been selected for edit and either saved
or
 cancelled, that same record is always displayed in the edit group when
I
 choose another record to edit or even when I try to create a new one.
I can
 even delete the chosen record and it still displays in the edit group.

 works fine here, meaning you did not completely/propery apply my
 changes. below is the complete file.

 -igor

 public class RecordAPanel extends Panel
 {
private static final long serialVersionUID = 1L;

RecordAService recordAService;
RecordBService recordBService;

RecordA selectedRecordA = new RecordA();
IModelRecordA selectedRecordAModel;
String unmodifiedRecordA;

boolean isNew = false;

WebMarkupContainer selectGroup;
WebMarkupContainer editGroup;

Form selectForm;
Form editForm;

DropDownChoiceRecordA recordAs;
DropDownChoiceRecordB recordBs;

Button add;
Button edit;
Button save;
Button delete;
Button cancel;

Label editLegendLabel;
String editLegend;
Label recordALabel;
Label recordBLabel;

RequiredTextField recordAText;

@SuppressWarnings({ rawtypes, unchecked })
public RecordAPanel(String id)
{
super(id);

recordAService = ((Application)
 RequestCycle.get().getApplication()).getRecordAService();
recordBService = ((Application)
 RequestCycle.get().getApplication()).getRecordBService();

selectedRecordAModel = new PropertyModelRecordA(this,
 selectedRecordA);
this.setDefaultModel(selectedRecordAModel);

// * Select  Group *

selectGroup = new WebMarkupContainer(selectGroup);
selectForm = new Form(selectForm);

recordAs = new DropDownChoiceRecordA(recordAs);
recordAs.setModel(selectedRecordAModel);
recordAs.setChoices(recordAsModel);
recordAs.setChoiceRenderer(new RecordARenderer());

//recordAs = (DropDownChoiceRecordA) new
 DropDownChoiceRecordA(recordAs,
//new PropertyModelRecordA(this,
 selectedRecordA),
//recordAsModel,
//new RecordARenderer());

recordAs.setNullValid(false);

selectForm.add(recordAs);

add = new Button(add)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
setSelectedRecordA(new RecordA());
isNew = true;
editLegend = New;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
};

selectForm.add(add);

edit = new Button(edit)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to edit.);
}
else
{
unmodifiedRecordA = selectedRecordA.getName();
isNew = false;
editLegend = Edit;
editGroup.setVisible(true);
selectGroup.setVisible(false);
}
}
};

selectForm.add(edit);

delete = new Button(delete)
{
private static final long serialVersionUID = 1L;

public void onSubmit()
{
if (selectedRecordA == null)
{
info(You must select a record to delete.);
}
else
   

Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
sorry.. Did'nt see it attached.. So did igor provide you with an fixed
quickstart (working on his system).. That did not work on glassfish?

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 The quickstart was sent to the list this morning at 10:04 MST.  Does it
 need to be resent?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:52 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 No dont think so.. Please provide a quickstart.. I have had property
 models
 working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

  Hi,
 
  Thanks for file.  Your first email was missing these changes:
 
 IModelRecordA selectedRecordAModel;  (I had set mine to
  PropertyModelRecordA selectedRecordAModel;)
 recordAs.setModel(selectedRecordAModel)
 
  However, even with those changes applied, I still get the same issue
 of the
  selected record not updating in the edit group.
 
  I am deploying in Glassfish v3.  Could that have anything to do with
 my
  problems?
 
  Shelli
 
  -Original Message-
  From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:35 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton shelli.or...@sjrb.ca
  wrote:
   Thanks for the help.  Your changes got rid of the errors and I can
 delete
  records now (and the list is updated).
  
   However, once a record has been selected for edit and either saved
 or
  cancelled, that same record is always displayed in the edit group when
 I
  choose another record to edit or even when I try to create a new one.
 I can
  even delete the chosen record and it still displays in the edit group.
 
  works fine here, meaning you did not completely/propery apply my
  changes. below is the complete file.
 
  -igor
 
  public class RecordAPanel extends Panel
  {
 private static final long serialVersionUID = 1L;
 
 RecordAService recordAService;
 RecordBService recordBService;
 
 RecordA selectedRecordA = new RecordA();
 IModelRecordA selectedRecordAModel;
 String unmodifiedRecordA;
 
 boolean isNew = false;
 
 WebMarkupContainer selectGroup;
 WebMarkupContainer editGroup;
 
 Form selectForm;
 Form editForm;
 
 DropDownChoiceRecordA recordAs;
 DropDownChoiceRecordB recordBs;
 
 Button add;
 Button edit;
 Button save;
 Button delete;
 Button cancel;
 
 Label editLegendLabel;
 String editLegend;
 Label recordALabel;
 Label recordBLabel;
 
 RequiredTextField recordAText;
 
 @SuppressWarnings({ rawtypes, unchecked })
 public RecordAPanel(String id)
 {
 super(id);
 
 recordAService = ((Application)
  RequestCycle.get().getApplication()).getRecordAService();
 recordBService = ((Application)
  RequestCycle.get().getApplication()).getRecordBService();
 
 selectedRecordAModel = new PropertyModelRecordA(this,
  selectedRecordA);
 this.setDefaultModel(selectedRecordAModel);
 
 // * Select  Group *
 
 selectGroup = new WebMarkupContainer(selectGroup);
 selectForm = new Form(selectForm);
 
 recordAs = new DropDownChoiceRecordA(recordAs);
 recordAs.setModel(selectedRecordAModel);
 recordAs.setChoices(recordAsModel);
 recordAs.setChoiceRenderer(new RecordARenderer());
 
 //recordAs = (DropDownChoiceRecordA) new
  DropDownChoiceRecordA(recordAs,
 //new PropertyModelRecordA(this,
  selectedRecordA),
 //recordAsModel,
 //new RecordARenderer());
 
 recordAs.setNullValid(false);
 
 selectForm.add(recordAs);
 
 add = new Button(add)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 setSelectedRecordA(new RecordA());
 isNew = true;
 editLegend = New;
 editGroup.setVisible(true);
 selectGroup.setVisible(false);
 }
 };
 
 selectForm.add(add);
 
 edit = new Button(edit)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 if (selectedRecordA == null)
 {
 info(You must select a record to edit.);
 }
 else
 {
 unmodifiedRecordA = selectedRecordA.getName();
 isNew = false;
 editLegend = Edit;
 editGroup.setVisible(true);
 selectGroup.setVisible(false);
 }
 }
 };
 
 

RE: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
He provided an updated RecordAPanel.java class that works on his system.
I updated mine to match his, but still have an issue where once a record
has been selected for edit, that's the only record that is displayed in
the edit group regardless of which record is chosen from the list in the
select group or if I choose to create a new record.

If it's not the code, I was thinking that it might be the app server
doing some caching, but honestly, I'm grasping at straws.

Shelli

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Tuesday, October 12, 2010 11:58 AM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

sorry.. Did'nt see it attached.. So did igor provide you with an fixed
quickstart (working on his system).. That did not work on glassfish?

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 The quickstart was sent to the list this morning at 10:04 MST.  Does
it
 need to be resent?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:52 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 No dont think so.. Please provide a quickstart.. I have had property
 models
 working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

  Hi,
 
  Thanks for file.  Your first email was missing these changes:
 
 IModelRecordA selectedRecordAModel;  (I had set mine to
  PropertyModelRecordA selectedRecordAModel;)
 recordAs.setModel(selectedRecordAModel)
 
  However, even with those changes applied, I still get the same issue
 of the
  selected record not updating in the edit group.
 
  I am deploying in Glassfish v3.  Could that have anything to do with
 my
  problems?
 
  Shelli
 
  -Original Message-
  From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:35 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
shelli.or...@sjrb.ca
  wrote:
   Thanks for the help.  Your changes got rid of the errors and I can
 delete
  records now (and the list is updated).
  
   However, once a record has been selected for edit and either saved
 or
  cancelled, that same record is always displayed in the edit group
when
 I
  choose another record to edit or even when I try to create a new
one.
 I can
  even delete the chosen record and it still displays in the edit
group.
 
  works fine here, meaning you did not completely/propery apply my
  changes. below is the complete file.
 
  -igor
 
  public class RecordAPanel extends Panel
  {
 private static final long serialVersionUID = 1L;
 
 RecordAService recordAService;
 RecordBService recordBService;
 
 RecordA selectedRecordA = new RecordA();
 IModelRecordA selectedRecordAModel;
 String unmodifiedRecordA;
 
 boolean isNew = false;
 
 WebMarkupContainer selectGroup;
 WebMarkupContainer editGroup;
 
 Form selectForm;
 Form editForm;
 
 DropDownChoiceRecordA recordAs;
 DropDownChoiceRecordB recordBs;
 
 Button add;
 Button edit;
 Button save;
 Button delete;
 Button cancel;
 
 Label editLegendLabel;
 String editLegend;
 Label recordALabel;
 Label recordBLabel;
 
 RequiredTextField recordAText;
 
 @SuppressWarnings({ rawtypes, unchecked })
 public RecordAPanel(String id)
 {
 super(id);
 
 recordAService = ((Application)
  RequestCycle.get().getApplication()).getRecordAService();
 recordBService = ((Application)
  RequestCycle.get().getApplication()).getRecordBService();
 
 selectedRecordAModel = new PropertyModelRecordA(this,
  selectedRecordA);
 this.setDefaultModel(selectedRecordAModel);
 
 // * Select  Group *
 
 selectGroup = new WebMarkupContainer(selectGroup);
 selectForm = new Form(selectForm);
 
 recordAs = new DropDownChoiceRecordA(recordAs);
 recordAs.setModel(selectedRecordAModel);
 recordAs.setChoices(recordAsModel);
 recordAs.setChoiceRenderer(new RecordARenderer());
 
 //recordAs = (DropDownChoiceRecordA) new
  DropDownChoiceRecordA(recordAs,
 //new PropertyModelRecordA(this,
  selectedRecordA),
 //recordAsModel,
 //new RecordARenderer());
 
 recordAs.setNullValid(false);
 
 selectForm.add(recordAs);
 
 add = new Button(add)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 setSelectedRecordA(new RecordA());
 isNew = true;
 editLegend = New;
 editGroup.setVisible(true);
 selectGroup.setVisible(false);
 }
 };
 

Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
hmm getting a lot of errors on the services not implementing
serialization...

But does seem theres a difference between calling :

selectedRecordAModel.getObject().getName() and
RecordAPanel.this.selectedRecordA

2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

 sorry.. Did'nt see it attached.. So did igor provide you with an fixed
 quickstart (working on his system).. That did not work on glassfish?


 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 The quickstart was sent to the list this morning at 10:04 MST.  Does it
 need to be resent?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:52 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 No dont think so.. Please provide a quickstart.. I have had property
 models
 working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

  Hi,
 
  Thanks for file.  Your first email was missing these changes:
 
 IModelRecordA selectedRecordAModel;  (I had set mine to
  PropertyModelRecordA selectedRecordAModel;)
 recordAs.setModel(selectedRecordAModel)
 
  However, even with those changes applied, I still get the same issue
 of the
  selected record not updating in the edit group.
 
  I am deploying in Glassfish v3.  Could that have anything to do with
 my
  problems?
 
  Shelli
 
  -Original Message-
  From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:35 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton shelli.or...@sjrb.ca
  wrote:
   Thanks for the help.  Your changes got rid of the errors and I can
 delete
  records now (and the list is updated).
  
   However, once a record has been selected for edit and either saved
 or
  cancelled, that same record is always displayed in the edit group when
 I
  choose another record to edit or even when I try to create a new one.
 I can
  even delete the chosen record and it still displays in the edit group.
 
  works fine here, meaning you did not completely/propery apply my
  changes. below is the complete file.
 
  -igor
 
  public class RecordAPanel extends Panel
  {
 private static final long serialVersionUID = 1L;
 
 RecordAService recordAService;
 RecordBService recordBService;
 
 RecordA selectedRecordA = new RecordA();
 IModelRecordA selectedRecordAModel;
 String unmodifiedRecordA;
 
 boolean isNew = false;
 
 WebMarkupContainer selectGroup;
 WebMarkupContainer editGroup;
 
 Form selectForm;
 Form editForm;
 
 DropDownChoiceRecordA recordAs;
 DropDownChoiceRecordB recordBs;
 
 Button add;
 Button edit;
 Button save;
 Button delete;
 Button cancel;
 
 Label editLegendLabel;
 String editLegend;
 Label recordALabel;
 Label recordBLabel;
 
 RequiredTextField recordAText;
 
 @SuppressWarnings({ rawtypes, unchecked })
 public RecordAPanel(String id)
 {
 super(id);
 
 recordAService = ((Application)
  RequestCycle.get().getApplication()).getRecordAService();
 recordBService = ((Application)
  RequestCycle.get().getApplication()).getRecordBService();
 
 selectedRecordAModel = new PropertyModelRecordA(this,
  selectedRecordA);
 this.setDefaultModel(selectedRecordAModel);
 
 // * Select  Group *
 
 selectGroup = new WebMarkupContainer(selectGroup);
 selectForm = new Form(selectForm);
 
 recordAs = new DropDownChoiceRecordA(recordAs);
 recordAs.setModel(selectedRecordAModel);
 recordAs.setChoices(recordAsModel);
 recordAs.setChoiceRenderer(new RecordARenderer());
 
 //recordAs = (DropDownChoiceRecordA) new
  DropDownChoiceRecordA(recordAs,
 //new PropertyModelRecordA(this,
  selectedRecordA),
 //recordAsModel,
 //new RecordARenderer());
 
 recordAs.setNullValid(false);
 
 selectForm.add(recordAs);
 
 add = new Button(add)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 setSelectedRecordA(new RecordA());
 isNew = true;
 editLegend = New;
 editGroup.setVisible(true);
 selectGroup.setVisible(false);
 }
 };
 
 selectForm.add(add);
 
 edit = new Button(edit)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 if (selectedRecordA == null)
 {
 info(You must select a record to edit.);
 }
 else
 {
 

Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
I can confirm the edit issue.. Also what's supposed to happen in recordb
panel?

I might have a chance to look at it a little later..

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 He provided an updated RecordAPanel.java class that works on his system.
 I updated mine to match his, but still have an issue where once a record
 has been selected for edit, that's the only record that is displayed in
 the edit group regardless of which record is chosen from the list in the
 select group or if I choose to create a new record.

 If it's not the code, I was thinking that it might be the app server
 doing some caching, but honestly, I'm grasping at straws.

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:58 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 sorry.. Did'nt see it attached.. So did igor provide you with an fixed
 quickstart (working on his system).. That did not work on glassfish?

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

  The quickstart was sent to the list this morning at 10:04 MST.  Does
 it
  need to be resent?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:52 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  No dont think so.. Please provide a quickstart.. I have had property
  models
  working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
   Hi,
  
   Thanks for file.  Your first email was missing these changes:
  
  IModelRecordA selectedRecordAModel;  (I had set mine to
   PropertyModelRecordA selectedRecordAModel;)
  recordAs.setModel(selectedRecordAModel)
  
   However, even with those changes applied, I still get the same issue
  of the
   selected record not updating in the edit group.
  
   I am deploying in Glassfish v3.  Could that have anything to do with
  my
   problems?
  
   Shelli
  
   -Original Message-
   From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:35 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
 shelli.or...@sjrb.ca
   wrote:
Thanks for the help.  Your changes got rid of the errors and I can
  delete
   records now (and the list is updated).
   
However, once a record has been selected for edit and either saved
  or
   cancelled, that same record is always displayed in the edit group
 when
  I
   choose another record to edit or even when I try to create a new
 one.
  I can
   even delete the chosen record and it still displays in the edit
 group.
  
   works fine here, meaning you did not completely/propery apply my
   changes. below is the complete file.
  
   -igor
  
   public class RecordAPanel extends Panel
   {
  private static final long serialVersionUID = 1L;
  
  RecordAService recordAService;
  RecordBService recordBService;
  
  RecordA selectedRecordA = new RecordA();
  IModelRecordA selectedRecordAModel;
  String unmodifiedRecordA;
  
  boolean isNew = false;
  
  WebMarkupContainer selectGroup;
  WebMarkupContainer editGroup;
  
  Form selectForm;
  Form editForm;
  
  DropDownChoiceRecordA recordAs;
  DropDownChoiceRecordB recordBs;
  
  Button add;
  Button edit;
  Button save;
  Button delete;
  Button cancel;
  
  Label editLegendLabel;
  String editLegend;
  Label recordALabel;
  Label recordBLabel;
  
  RequiredTextField recordAText;
  
  @SuppressWarnings({ rawtypes, unchecked })
  public RecordAPanel(String id)
  {
  super(id);
  
  recordAService = ((Application)
   RequestCycle.get().getApplication()).getRecordAService();
  recordBService = ((Application)
   RequestCycle.get().getApplication()).getRecordBService();
  
  selectedRecordAModel = new PropertyModelRecordA(this,
   selectedRecordA);
  this.setDefaultModel(selectedRecordAModel);
  
  // * Select  Group *
  
  selectGroup = new WebMarkupContainer(selectGroup);
  selectForm = new Form(selectForm);
  
  recordAs = new DropDownChoiceRecordA(recordAs);
  recordAs.setModel(selectedRecordAModel);
  recordAs.setChoices(recordAsModel);
  recordAs.setChoiceRenderer(new RecordARenderer());
  
  //recordAs = (DropDownChoiceRecordA) new
   DropDownChoiceRecordA(recordAs,
  //new PropertyModelRecordA(this,
   selectedRecordA),
  //recordAsModel,
  //new RecordARenderer());
  
  recordAs.setNullValid(false);
  
  selectForm.add(recordAs);
  
  add = new Button(add)
  {
  private static 

MinimumValidator and Long problem

2010-10-12 Thread Zeldor

I have TextField that should take Long value, but on submit it does not
really work...


org.apache.wicket.RequestCycle logRuntimeException: Exception
'java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.lang.Long' occurred during validation
org.apache.wicket.validation.validator.MinimumValidator on component
10:workForm:hire_worker_1
org.apache.wicket.WicketRuntimeException: Exception
'java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.lang.Long' occurred during validation
org.apache.wicket.validation.validator.MinimumValidator on component
10:workForm:hire_worker_1


My code looks like that:

public Work() {
add(new FeedbackPanel(errorMsg));
FormString workForm = new FormString(workForm, new 
ModelString())
{
private TextFieldLong hire_worker_1 = new
TextFieldLong(hire_worker_1, new ModelLong());
...
{
...
add(hire_worker_1.add(new MinimumValidator(0))
.setType(Long.class));
...
}

@Override
public void onSubmit() {
long hiring_worker_1 = hire_worker_1.getModelObject();
...
}
};
add(workForm);
}

Eclipse does like new MinimumValidatorLong(0), so what's the solution
for my problem?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992468.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: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
Hi,

Sorry about the serialization errors.  My real code is using JPA
services/entities and they are serialized.  

There's a number of tabs that need to be written, but I was just trying
to get the one to work before starting the others.  I set up the recordB
panel to make sure I was creating the tabs correctly.  Eventually it's
where recordBs will be CRUDed.

Shelli

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Tuesday, October 12, 2010 12:19 PM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

I can confirm the edit issue.. Also what's supposed to happen in recordb
panel?

I might have a chance to look at it a little later..

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 He provided an updated RecordAPanel.java class that works on his
system.
 I updated mine to match his, but still have an issue where once a
record
 has been selected for edit, that's the only record that is displayed
in
 the edit group regardless of which record is chosen from the list in
the
 select group or if I choose to create a new record.

 If it's not the code, I was thinking that it might be the app server
 doing some caching, but honestly, I'm grasping at straws.

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:58 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 sorry.. Did'nt see it attached.. So did igor provide you with an fixed
 quickstart (working on his system).. That did not work on glassfish?

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

  The quickstart was sent to the list this morning at 10:04 MST.  Does
 it
  need to be resent?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:52 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  No dont think so.. Please provide a quickstart.. I have had property
  models
  working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
   Hi,
  
   Thanks for file.  Your first email was missing these changes:
  
  IModelRecordA selectedRecordAModel;  (I had set mine to
   PropertyModelRecordA selectedRecordAModel;)
  recordAs.setModel(selectedRecordAModel)
  
   However, even with those changes applied, I still get the same
issue
  of the
   selected record not updating in the edit group.
  
   I am deploying in Glassfish v3.  Could that have anything to do
with
  my
   problems?
  
   Shelli
  
   -Original Message-
   From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:35 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
 shelli.or...@sjrb.ca
   wrote:
Thanks for the help.  Your changes got rid of the errors and I
can
  delete
   records now (and the list is updated).
   
However, once a record has been selected for edit and either
saved
  or
   cancelled, that same record is always displayed in the edit group
 when
  I
   choose another record to edit or even when I try to create a new
 one.
  I can
   even delete the chosen record and it still displays in the edit
 group.
  
   works fine here, meaning you did not completely/propery apply my
   changes. below is the complete file.
  
   -igor
  
   public class RecordAPanel extends Panel
   {
  private static final long serialVersionUID = 1L;
  
  RecordAService recordAService;
  RecordBService recordBService;
  
  RecordA selectedRecordA = new RecordA();
  IModelRecordA selectedRecordAModel;
  String unmodifiedRecordA;
  
  boolean isNew = false;
  
  WebMarkupContainer selectGroup;
  WebMarkupContainer editGroup;
  
  Form selectForm;
  Form editForm;
  
  DropDownChoiceRecordA recordAs;
  DropDownChoiceRecordB recordBs;
  
  Button add;
  Button edit;
  Button save;
  Button delete;
  Button cancel;
  
  Label editLegendLabel;
  String editLegend;
  Label recordALabel;
  Label recordBLabel;
  
  RequiredTextField recordAText;
  
  @SuppressWarnings({ rawtypes, unchecked })
  public RecordAPanel(String id)
  {
  super(id);
  
  recordAService = ((Application)
   RequestCycle.get().getApplication()).getRecordAService();
  recordBService = ((Application)
   RequestCycle.get().getApplication()).getRecordBService();
  
  selectedRecordAModel = new PropertyModelRecordA(this,
   selectedRecordA);
  this.setDefaultModel(selectedRecordAModel);
  
  // * Select  Group *
  
  selectGroup = new WebMarkupContainer(selectGroup);
  selectForm = new Form(selectForm);
  
  recordAs = new DropDownChoiceRecordA(recordAs);
  

[wiquery] How to open a modal dialog from a Link?

2010-10-12 Thread Peter Munro
Hi,

I'm using wiQuery and have a demo application with a Button that opens a
modal dialog successfully, but I'd like to use Links instead of Buttons, so
I'm replacing this:
button wicket:id=open-dialogOpen dialog/button
with an anchor/Link:
a href=# wicket:id=open-dialogOpen dialog/a

and in my Java code, replacing this:
Button button = new Button(open-dialog);
with this:
Link link = new Link(open-dialog) {
public void onClick() {
System.out.println(clicked);
}
};

When I run it and click the link, the Dialog appears for half a second or
so, then the page refreshes itself as a result of the a tag's HTTP
request/response.

I'd like for the dialog to appear locally WITHOUT any HTTP request/response.
And further (ideally), if Javascript is disabled, then have the onClick()
method invoked as normal.

Any ideas how I can do this?

Many thanks,
Peter


Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
in your add button you call setSelectedRecordA(new RecordA()) but never
notify the model that a change has occured...

2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

 hmm getting a lot of errors on the services not implementing
 serialization...

 But does seem theres a difference between calling :

 selectedRecordAModel.getObject().getName() and
 RecordAPanel.this.selectedRecordA

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

 sorry.. Did'nt see it attached.. So did igor provide you with an fixed
 quickstart (working on his system).. That did not work on glassfish?


 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 The quickstart was sent to the list this morning at 10:04 MST.  Does it
 need to be resent?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:52 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 No dont think so.. Please provide a quickstart.. I have had property
 models
 working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

  Hi,
 
  Thanks for file.  Your first email was missing these changes:
 
 IModelRecordA selectedRecordAModel;  (I had set mine to
  PropertyModelRecordA selectedRecordAModel;)
 recordAs.setModel(selectedRecordAModel)
 
  However, even with those changes applied, I still get the same issue
 of the
  selected record not updating in the edit group.
 
  I am deploying in Glassfish v3.  Could that have anything to do with
 my
  problems?
 
  Shelli
 
  -Original Message-
  From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:35 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton shelli.or...@sjrb.ca
  wrote:
   Thanks for the help.  Your changes got rid of the errors and I can
 delete
  records now (and the list is updated).
  
   However, once a record has been selected for edit and either saved
 or
  cancelled, that same record is always displayed in the edit group when
 I
  choose another record to edit or even when I try to create a new one.
 I can
  even delete the chosen record and it still displays in the edit group.
 
  works fine here, meaning you did not completely/propery apply my
  changes. below is the complete file.
 
  -igor
 
  public class RecordAPanel extends Panel
  {
 private static final long serialVersionUID = 1L;
 
 RecordAService recordAService;
 RecordBService recordBService;
 
 RecordA selectedRecordA = new RecordA();
 IModelRecordA selectedRecordAModel;
 String unmodifiedRecordA;
 
 boolean isNew = false;
 
 WebMarkupContainer selectGroup;
 WebMarkupContainer editGroup;
 
 Form selectForm;
 Form editForm;
 
 DropDownChoiceRecordA recordAs;
 DropDownChoiceRecordB recordBs;
 
 Button add;
 Button edit;
 Button save;
 Button delete;
 Button cancel;
 
 Label editLegendLabel;
 String editLegend;
 Label recordALabel;
 Label recordBLabel;
 
 RequiredTextField recordAText;
 
 @SuppressWarnings({ rawtypes, unchecked })
 public RecordAPanel(String id)
 {
 super(id);
 
 recordAService = ((Application)
  RequestCycle.get().getApplication()).getRecordAService();
 recordBService = ((Application)
  RequestCycle.get().getApplication()).getRecordBService();
 
 selectedRecordAModel = new PropertyModelRecordA(this,
  selectedRecordA);
 this.setDefaultModel(selectedRecordAModel);
 
 // * Select  Group *
 
 selectGroup = new WebMarkupContainer(selectGroup);
 selectForm = new Form(selectForm);
 
 recordAs = new DropDownChoiceRecordA(recordAs);
 recordAs.setModel(selectedRecordAModel);
 recordAs.setChoices(recordAsModel);
 recordAs.setChoiceRenderer(new RecordARenderer());
 
 //recordAs = (DropDownChoiceRecordA) new
  DropDownChoiceRecordA(recordAs,
 //new PropertyModelRecordA(this,
  selectedRecordA),
 //recordAsModel,
 //new RecordARenderer());
 
 recordAs.setNullValid(false);
 
 selectForm.add(recordAs);
 
 add = new Button(add)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 setSelectedRecordA(new RecordA());
 isNew = true;
 editLegend = New;
 editGroup.setVisible(true);
 selectGroup.setVisible(false);
 }
 };
 
 selectForm.add(add);
 
 edit = new Button(edit)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 if (selectedRecordA 

RE: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
This is where my confusion about models may be kicking in.  I thought
that property models (PropertModel or CompoundPropertyModel)
automatically checked if the model object changed.  How do I tell the
model it has?

Shelli

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Tuesday, October 12, 2010 12:10 PM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

in your add button you call setSelectedRecordA(new RecordA()) but never
notify the model that a change has occured...

2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

 hmm getting a lot of errors on the services not implementing
 serialization...

 But does seem theres a difference between calling :

 selectedRecordAModel.getObject().getName() and
 RecordAPanel.this.selectedRecordA

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

 sorry.. Did'nt see it attached.. So did igor provide you with an fixed
 quickstart (working on his system).. That did not work on glassfish?


 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 The quickstart was sent to the list this morning at 10:04 MST.  Does
it
 need to be resent?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 11:52 AM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 No dont think so.. Please provide a quickstart.. I have had property
 models
 working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

  Hi,
 
  Thanks for file.  Your first email was missing these changes:
 
 IModelRecordA selectedRecordAModel;  (I had set mine to
  PropertyModelRecordA selectedRecordAModel;)
 recordAs.setModel(selectedRecordAModel)
 
  However, even with those changes applied, I still get the same
issue
 of the
  selected record not updating in the edit group.
 
  I am deploying in Glassfish v3.  Could that have anything to do
with
 my
  problems?
 
  Shelli
 
  -Original Message-
  From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:35 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
shelli.or...@sjrb.ca
  wrote:
   Thanks for the help.  Your changes got rid of the errors and I
can
 delete
  records now (and the list is updated).
  
   However, once a record has been selected for edit and either
saved
 or
  cancelled, that same record is always displayed in the edit group
when
 I
  choose another record to edit or even when I try to create a new
one.
 I can
  even delete the chosen record and it still displays in the edit
group.
 
  works fine here, meaning you did not completely/propery apply my
  changes. below is the complete file.
 
  -igor
 
  public class RecordAPanel extends Panel
  {
 private static final long serialVersionUID = 1L;
 
 RecordAService recordAService;
 RecordBService recordBService;
 
 RecordA selectedRecordA = new RecordA();
 IModelRecordA selectedRecordAModel;
 String unmodifiedRecordA;
 
 boolean isNew = false;
 
 WebMarkupContainer selectGroup;
 WebMarkupContainer editGroup;
 
 Form selectForm;
 Form editForm;
 
 DropDownChoiceRecordA recordAs;
 DropDownChoiceRecordB recordBs;
 
 Button add;
 Button edit;
 Button save;
 Button delete;
 Button cancel;
 
 Label editLegendLabel;
 String editLegend;
 Label recordALabel;
 Label recordBLabel;
 
 RequiredTextField recordAText;
 
 @SuppressWarnings({ rawtypes, unchecked })
 public RecordAPanel(String id)
 {
 super(id);
 
 recordAService = ((Application)
  RequestCycle.get().getApplication()).getRecordAService();
 recordBService = ((Application)
  RequestCycle.get().getApplication()).getRecordBService();
 
 selectedRecordAModel = new PropertyModelRecordA(this,
  selectedRecordA);
 this.setDefaultModel(selectedRecordAModel);
 
 // * Select  Group *
 
 selectGroup = new WebMarkupContainer(selectGroup);
 selectForm = new Form(selectForm);
 
 recordAs = new DropDownChoiceRecordA(recordAs);
 recordAs.setModel(selectedRecordAModel);
 recordAs.setChoices(recordAsModel);
 recordAs.setChoiceRenderer(new RecordARenderer());
 
 //recordAs = (DropDownChoiceRecordA) new
  DropDownChoiceRecordA(recordAs,
 //new PropertyModelRecordA(this,
  selectedRecordA),
 //recordAsModel,
 //new RecordARenderer());
 
 recordAs.setNullValid(false);
 
 selectForm.add(recordAs);
 
 add = new Button(add)
 {
 private static final long serialVersionUID = 1L;
 
 public void onSubmit()
 {
 setSelectedRecordA(new 

Re: AjaxPagingNavigator give out strange error

2010-10-12 Thread btbluesky

I finally found out what exactly the problem is.
I used the quickstart to generate a new project from scratch.
In my maven, I have wicket javadoc to be dependency. whenever that
dependency is there. All the ajax calls failed in both jetty and tomcat (I
setup both servers to test them), and spurring out bunch of javadoc html
failed code.

The second I take that dependency out of my eclipse WTP project, redeploy,
it's perfectly fine.

Is it just me, what am I doing wrong. Again the only thing I used is, enable
maven manage in eclipse, and then add the javadoc in the dependency.

dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket/artifactId
version${wicket.version}/version
classifierjavadoc/classifier
/dependency


The error:


Unexpected RuntimeException

WicketMessage: Tag 'DT' (line 103, column 1) has a mismatched close tag at
'/DL' (line 104, column 1)
[markup =
jar:file:/D:/mavenRepo/org/apache/wicket/wicket/1.4.12/wicket-1.4.12-javadoc.jar!/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.html
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;


Markup

The problem is in
jar:file:/D:/mavenRepo/org/apache/wicket/wicket/1.4.12/wicket-1.4.12-javadoc.jar!/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.html:
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxPagingNavigator-give-out-strange-error-tp2327360p2992535.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: [wiquery] How to open a modal dialog from a Link?

2010-10-12 Thread Ernesto Reinaldo Barreiro
Use JavaScript to do that on the client side? See method

/**Method to open the dialog
 * @return the associated JsStatement
 */
public JsStatement open() {
return new JsQuery(this).$().chain(dialog, 'open');
}

on Dialog class which generates the needed JavaScript. I haven't tried this but

a wicket:id=link onclick=Open Dialog/a

---

WebMarkupContainer link =  new WebMarkupContainer(link);
link.add(new AttributeModifier(onclick, new
AbstractReadOnlyModelString() {

@Override
public String getObject() { 
return new JsQuery(dialog).$().chain(dialog,
'open').render().toString();
}
}));

might work.

Ernesto



On Tue, Oct 12, 2010 at 8:25 PM, Peter Munro spelud...@gmail.com wrote:
 Hi,

 I'm using wiQuery and have a demo application with a Button that opens a
 modal dialog successfully, but I'd like to use Links instead of Buttons, so
 I'm replacing this:
 button wicket:id=open-dialogOpen dialog/button
 with an anchor/Link:
 a href=# wicket:id=open-dialogOpen dialog/a

 and in my Java code, replacing this:
 Button button = new Button(open-dialog);
 with this:
 Link link = new Link(open-dialog) {
    public void onClick() {
        System.out.println(clicked);
    }
 };

 When I run it and click the link, the Dialog appears for half a second or
 so, then the page refreshes itself as a result of the a tag's HTTP
 request/response.

 I'd like for the dialog to appear locally WITHOUT any HTTP request/response.
 And further (ideally), if Javascript is disabled, then have the onClick()
 method invoked as normal.

 Any ideas how I can do this?

 Many thanks,
 Peter


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



Re: AjaxPagingNavigator give out strange error

2010-10-12 Thread jcgarciam

Why do you add the *classifierjavadoc/classifier *
in your pom to have the JavaDocs, why not adding the the
-DdownloadSources=true -DdownloadJavadocs=true in your maven command, full
example:

mvn eclipse:eclipse  -DdownloadSources=true -DdownloadJavadocs=true


On Tue, Oct 12, 2010 at 4:13 PM, btbluesky [via Apache Wicket] 
ml-node+2992535-582055769-65...@n4.nabble.comml-node%2b2992535-582055769-65...@n4.nabble.com
 wrote:

 I finally found out what exactly the problem is.
 I used the quickstart to generate a new project from scratch.
 In my maven, I have wicket javadoc to be dependency. whenever that
 dependency is there. All the ajax calls failed in both jetty and tomcat (I
 setup both servers to test them), and spurring out bunch of javadoc html
 failed code.

 The second I take that dependency out of my eclipse WTP project, redeploy,
 it's perfectly fine.

 Is it just me, what am I doing wrong. Again the only thing I used is,
 enable maven manage in eclipse, and then add the javadoc in the
 dependency.

 *dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket/artifactId
 version${wicket.version}/version
 classifierjavadoc/classifier
 /dependency*


 The error:


 *Unexpected RuntimeException

 WicketMessage: Tag 'DT' (line 103, column 1) has a mismatched close tag
 at '/DL' (line 104, column 1)
 [markup =
 jar:file:/D:/mavenRepo/org/apache/wicket/wicket/1.4.12/wicket-1.4.12-javadoc.jar!/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.html

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
 http://www.w3.org/TR/html4/loose.dtd;
 
 
 Markup

 The problem is in
 jar:file:/D:/mavenRepo/org/apache/wicket/wicket/1.4.12/wicket-1.4.12-javadoc.jar!/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.html:

 *

 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/AjaxPagingNavigator-give-out-strange-error-tp2327360p2992535.html
 To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxPagingNavigator-give-out-strange-error-tp2327360p2992593.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: Can i execute an inline-javascript added to head for replaced panel on ajax-response?

2010-10-12 Thread MZemeck
Can you share the final solution?



From:   Per Newgro per.new...@gmx.ch
To: users@wicket.apache.org
Date:   10/12/2010 01:37 PM
Subject:Re: Can i execute an inline-javascript added to head for 
replaced panel on ajax-response?



  Jeeehhaa. Thanks alot Igor. That did it. Both tips together work as 
expected.

Cheers
Per
 call setoutputmarkupid(true) on your label

 -igor


 On Tue, Oct 12, 2010 at 10:14 AM, Per Newgroper.new...@gmx.ch  wrote:
   Thanks Igor,

 but it didn't work. It seems that my label has no id in the response 
and
 thus the script can't find the element.

 div
 spanDone/span
 /div

 This should be lblReplaced3 after the ajax-refresh. Do i have to do
 something special for using replace with ajax?

 Thanks
 Per


 Here is the response
 *INFO: *focus set on doReplace2
 *INFO: *Using XMLHttpRequest transport
 *INFO: *
 *INFO: *Initiating Ajax GET request on
 
?wicket:interface=:0:main:doReplace::IBehaviorListener:0:random=0.27541138352960803
 *INFO: *Invoking pre-call handler(s)...
 *INFO: *Received ajax response (1202 characters)
 *INFO: *
 ?xml version=1.0 
encoding=UTF-8?ajax-responseheader-contribution
 encoding=wicket1![CDATA[head
 xmlns:wicket=http://wicket.apache.org;script type=text/javascript
 
src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script
 script type=text/javascript
 
src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script
 script type=text/javascript
 
src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script
 script type=text/javascript
 id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/
 wicketAjaxDebugEnable=true;
 /*--]^]^*//script

 /head]]/header-contributioncomponent id=main1 
encoding=wicket1
 ![CDATA[div id=main1
 div
 spanDone/span
 /div
 a id=doReplace2 href=# onclick=var
 
wcall=wicketAjaxGet('?wicket:interface=:0:main:doReplace::IBehaviorListener:0:-1',function()
 { }.bind(this),function() { }.bind(this), function() {return
 Wicket.$('doReplace2') != null;}.bind(this));return 
!wcall;[Link]^/a
 
/div]]/componentevaluate![CDATA[document.getElementById(lblReplaced3).style.color=red;]]/evaluate/ajax-response
 *INFO: *Response parsed. Now invoking steps...
 *INFO: *returned focused element: http://localhost:8080/#
 *INFO: *returned focused element: http://localhost:8080/#
 *ERROR: *Wicket.Ajax.Call.processEvaluation: Exception evaluating
 javascript: TypeError: document.getElementById(lblReplaced3) is null
 *INFO: *Response processed successfully.
 *INFO: *Invoking post-call handler(s)...
 *INFO: *Calling focus on doReplace2
 *INFO: *focus set on doReplace2
 *INFO: *focus removed from doReplace2
 *INFO: *focus set on wicketDebugLink
 *INFO: *focus removed from wicketDebugLink

 use renderondomreadyjavascript

 -igor


 -
 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






Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

Re: repaint a fragment

2010-10-12 Thread Jeremy Thomerson
item.replaceWith(new Fragment()) will replace the *item* with the
*fragment*, which is definitely not what you want.

On Tue, Oct 12, 2010 at 6:57 AM, fachhoch fachh...@gmail.com wrote:


 I am confused ,

 I have an Item with a fragment .

 to repaint  this fragment I should just add this item to target and no need
 of calling item.replaceWith(new Freagment()) ?

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




-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: AjaxPagingNavigator give out strange error

2010-10-12 Thread Igor Vaynberg
the problem is most likely the fact that wicket tries to load markup
out of the javadoc jar instead of the wicket jar. the javadoc has html
files named the same as wicket jar.

it doesnt make sense to have the javadoc jar on your classpath. but,
if you must, just make sure it is on the classpath *after* the wicket
jar.

-igor

On Tue, Oct 12, 2010 at 12:13 PM, btbluesky btblue...@gmail.com wrote:

 I finally found out what exactly the problem is.
 I used the quickstart to generate a new project from scratch.
 In my maven, I have wicket javadoc to be dependency. whenever that
 dependency is there. All the ajax calls failed in both jetty and tomcat (I
 setup both servers to test them), and spurring out bunch of javadoc html
 failed code.

 The second I take that dependency out of my eclipse WTP project, redeploy,
 it's perfectly fine.

 Is it just me, what am I doing wrong. Again the only thing I used is, enable
 maven manage in eclipse, and then add the javadoc in the dependency.

 dependency
        groupIdorg.apache.wicket/groupId
        artifactIdwicket/artifactId
        version${wicket.version}/version
        classifierjavadoc/classifier
 /dependency


 The error:


 Unexpected RuntimeException

 WicketMessage: Tag 'DT' (line 103, column 1) has a mismatched close tag at
 '/DL' (line 104, column 1)
 [markup =
 jar:file:/D:/mavenRepo/org/apache/wicket/wicket/1.4.12/wicket-1.4.12-javadoc.jar!/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.html
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 http://www.w3.org/TR/html4/loose.dtd;
 
 
 Markup

 The problem is in
 jar:file:/D:/mavenRepo/org/apache/wicket/wicket/1.4.12/wicket-1.4.12-javadoc.jar!/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.html:

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AjaxPagingNavigator-give-out-strange-error-tp2327360p2992535.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: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
Think I was going in the wrong direction.. Looking at the error, seems to
get triggered by pressing the cancel button only..

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 This is where my confusion about models may be kicking in.  I thought
 that property models (PropertModel or CompoundPropertyModel)
 automatically checked if the model object changed.  How do I tell the
 model it has?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 12:10 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 in your add button you call setSelectedRecordA(new RecordA()) but never
 notify the model that a change has occured...

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

  hmm getting a lot of errors on the services not implementing
  serialization...
 
  But does seem theres a difference between calling :
 
  selectedRecordAModel.getObject().getName() and
  RecordAPanel.this.selectedRecordA
 
  2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
 
  sorry.. Did'nt see it attached.. So did igor provide you with an fixed
  quickstart (working on his system).. That did not work on glassfish?
 
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
  The quickstart was sent to the list this morning at 10:04 MST.  Does
 it
  need to be resent?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:52 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  No dont think so.. Please provide a quickstart.. I have had property
  models
  working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
   Hi,
  
   Thanks for file.  Your first email was missing these changes:
  
  IModelRecordA selectedRecordAModel;  (I had set mine to
   PropertyModelRecordA selectedRecordAModel;)
  recordAs.setModel(selectedRecordAModel)
  
   However, even with those changes applied, I still get the same
 issue
  of the
   selected record not updating in the edit group.
  
   I am deploying in Glassfish v3.  Could that have anything to do
 with
  my
   problems?
  
   Shelli
  
   -Original Message-
   From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:35 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
 shelli.or...@sjrb.ca
   wrote:
Thanks for the help.  Your changes got rid of the errors and I
 can
  delete
   records now (and the list is updated).
   
However, once a record has been selected for edit and either
 saved
  or
   cancelled, that same record is always displayed in the edit group
 when
  I
   choose another record to edit or even when I try to create a new
 one.
  I can
   even delete the chosen record and it still displays in the edit
 group.
  
   works fine here, meaning you did not completely/propery apply my
   changes. below is the complete file.
  
   -igor
  
   public class RecordAPanel extends Panel
   {
  private static final long serialVersionUID = 1L;
  
  RecordAService recordAService;
  RecordBService recordBService;
  
  RecordA selectedRecordA = new RecordA();
  IModelRecordA selectedRecordAModel;
  String unmodifiedRecordA;
  
  boolean isNew = false;
  
  WebMarkupContainer selectGroup;
  WebMarkupContainer editGroup;
  
  Form selectForm;
  Form editForm;
  
  DropDownChoiceRecordA recordAs;
  DropDownChoiceRecordB recordBs;
  
  Button add;
  Button edit;
  Button save;
  Button delete;
  Button cancel;
  
  Label editLegendLabel;
  String editLegend;
  Label recordALabel;
  Label recordBLabel;
  
  RequiredTextField recordAText;
  
  @SuppressWarnings({ rawtypes, unchecked })
  public RecordAPanel(String id)
  {
  super(id);
  
  recordAService = ((Application)
   RequestCycle.get().getApplication()).getRecordAService();
  recordBService = ((Application)
   RequestCycle.get().getApplication()).getRecordBService();
  
  selectedRecordAModel = new PropertyModelRecordA(this,
   selectedRecordA);
  this.setDefaultModel(selectedRecordAModel);
  
  // * Select  Group *
  
  selectGroup = new WebMarkupContainer(selectGroup);
  selectForm = new Form(selectForm);
  
  recordAs = new DropDownChoiceRecordA(recordAs);
  recordAs.setModel(selectedRecordAModel);
  recordAs.setChoices(recordAsModel);
  recordAs.setChoiceRenderer(new RecordARenderer());
  
  //recordAs = (DropDownChoiceRecordA) new
   DropDownChoiceRecordA(recordAs,
  //new PropertyModelRecordA(this,
   selectedRecordA),
  //recordAsModel,

Re: Can i execute an inline-javascript added to head for replaced panel on ajax-response?

2010-10-12 Thread Per Newgro

 Am 12.10.2010 21:43, schrieb mzem...@osc.state.ny.us:

Can you share the final solution?



Sure. It's

public ReplacementPanel(String id) {
super(id);
final Label component;
add(component = new Label(lblReplaced, Done));
component.setOutputMarkupId(true); // Change 
add(new AbstractBehavior() {
@Override
public void renderHead(IHeaderResponse response) {
String js = $(function() 
{$(document.getElementById(\ + component.getMarkupId() + 
\).style.color=\red\);});;

response.renderOnDomReadyJavascript(js); // Change 
super.renderHead(response);
}
});
}


Cheers
Per

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



RE: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
I only explicitly set the selectedRecordA in two places, during the
cancel and add onSubmit methods (I removed the initialization in the
declaration in my code).  As you alluded to earlier, add is done via 

setSelectedRecordA(new RecordA());

and cancel is done via:

RecordAPanel.this.selectedRecordA = null;

I changed cancel to be:

setSelectedRecordA(new RecordA());

but it doesn't seem to make a difference, still get the issue when
cancelling.

Should I be setting the selectedRecordA to null on cancel?  It makes
sense to me and it's what I've done in other applications/frameworks,
but perhaps it's not correct in Wicket...

Shelli

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Tuesday, October 12, 2010 3:00 PM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

Think I was going in the wrong direction.. Looking at the error, seems
to
get triggered by pressing the cancel button only..

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 This is where my confusion about models may be kicking in.  I thought
 that property models (PropertModel or CompoundPropertyModel)
 automatically checked if the model object changed.  How do I tell the
 model it has?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 12:10 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 in your add button you call setSelectedRecordA(new RecordA()) but
never
 notify the model that a change has occured...

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

  hmm getting a lot of errors on the services not implementing
  serialization...
 
  But does seem theres a difference between calling :
 
  selectedRecordAModel.getObject().getName() and
  RecordAPanel.this.selectedRecordA
 
  2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
 
  sorry.. Did'nt see it attached.. So did igor provide you with an
fixed
  quickstart (working on his system).. That did not work on
glassfish?
 
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
  The quickstart was sent to the list this morning at 10:04 MST.
Does
 it
  need to be resent?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:52 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  No dont think so.. Please provide a quickstart.. I have had
property
  models
  working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
   Hi,
  
   Thanks for file.  Your first email was missing these changes:
  
  IModelRecordA selectedRecordAModel;  (I had set mine to
   PropertyModelRecordA selectedRecordAModel;)
  recordAs.setModel(selectedRecordAModel)
  
   However, even with those changes applied, I still get the same
 issue
  of the
   selected record not updating in the edit group.
  
   I am deploying in Glassfish v3.  Could that have anything to do
 with
  my
   problems?
  
   Shelli
  
   -Original Message-
   From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:35 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
 shelli.or...@sjrb.ca
   wrote:
Thanks for the help.  Your changes got rid of the errors and I
 can
  delete
   records now (and the list is updated).
   
However, once a record has been selected for edit and either
 saved
  or
   cancelled, that same record is always displayed in the edit
group
 when
  I
   choose another record to edit or even when I try to create a new
 one.
  I can
   even delete the chosen record and it still displays in the edit
 group.
  
   works fine here, meaning you did not completely/propery apply my
   changes. below is the complete file.
  
   -igor
  
   public class RecordAPanel extends Panel
   {
  private static final long serialVersionUID = 1L;
  
  RecordAService recordAService;
  RecordBService recordBService;
  
  RecordA selectedRecordA = new RecordA();
  IModelRecordA selectedRecordAModel;
  String unmodifiedRecordA;
  
  boolean isNew = false;
  
  WebMarkupContainer selectGroup;
  WebMarkupContainer editGroup;
  
  Form selectForm;
  Form editForm;
  
  DropDownChoiceRecordA recordAs;
  DropDownChoiceRecordB recordBs;
  
  Button add;
  Button edit;
  Button save;
  Button delete;
  Button cancel;
  
  Label editLegendLabel;
  String editLegend;
  Label recordALabel;
  Label recordBLabel;
  
  RequiredTextField recordAText;
  
  @SuppressWarnings({ rawtypes, unchecked })
  public RecordAPanel(String id)
  {
  super(id);
  
  recordAService = ((Application)
   RequestCycle.get().getApplication()).getRecordAService();
   

Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
going at a hunch I decided to rem out the below:

//cancel.setDefaultFormProcessing(false);

And seems it fixed the problem.. But im too tired to digg further had a
similar situation last week.. And the reason was sound.. Just cant remember
it now..

2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

 Think I was going in the wrong direction.. Looking at the error, seems to
 get triggered by pressing the cancel button only..


 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 This is where my confusion about models may be kicking in.  I thought
 that property models (PropertModel or CompoundPropertyModel)
 automatically checked if the model object changed.  How do I tell the
 model it has?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 12:10 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 in your add button you call setSelectedRecordA(new RecordA()) but never
 notify the model that a change has occured...

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

  hmm getting a lot of errors on the services not implementing
  serialization...
 
  But does seem theres a difference between calling :
 
  selectedRecordAModel.getObject().getName() and
  RecordAPanel.this.selectedRecordA
 
  2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
 
  sorry.. Did'nt see it attached.. So did igor provide you with an fixed
  quickstart (working on his system).. That did not work on glassfish?
 
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
  The quickstart was sent to the list this morning at 10:04 MST.  Does
 it
  need to be resent?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:52 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  No dont think so.. Please provide a quickstart.. I have had property
  models
  working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
   Hi,
  
   Thanks for file.  Your first email was missing these changes:
  
  IModelRecordA selectedRecordAModel;  (I had set mine to
   PropertyModelRecordA selectedRecordAModel;)
  recordAs.setModel(selectedRecordAModel)
  
   However, even with those changes applied, I still get the same
 issue
  of the
   selected record not updating in the edit group.
  
   I am deploying in Glassfish v3.  Could that have anything to do
 with
  my
   problems?
  
   Shelli
  
   -Original Message-
   From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:35 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
 shelli.or...@sjrb.ca
   wrote:
Thanks for the help.  Your changes got rid of the errors and I
 can
  delete
   records now (and the list is updated).
   
However, once a record has been selected for edit and either
 saved
  or
   cancelled, that same record is always displayed in the edit group
 when
  I
   choose another record to edit or even when I try to create a new
 one.
  I can
   even delete the chosen record and it still displays in the edit
 group.
  
   works fine here, meaning you did not completely/propery apply my
   changes. below is the complete file.
  
   -igor
  
   public class RecordAPanel extends Panel
   {
  private static final long serialVersionUID = 1L;
  
  RecordAService recordAService;
  RecordBService recordBService;
  
  RecordA selectedRecordA = new RecordA();
  IModelRecordA selectedRecordAModel;
  String unmodifiedRecordA;
  
  boolean isNew = false;
  
  WebMarkupContainer selectGroup;
  WebMarkupContainer editGroup;
  
  Form selectForm;
  Form editForm;
  
  DropDownChoiceRecordA recordAs;
  DropDownChoiceRecordB recordBs;
  
  Button add;
  Button edit;
  Button save;
  Button delete;
  Button cancel;
  
  Label editLegendLabel;
  String editLegend;
  Label recordALabel;
  Label recordBLabel;
  
  RequiredTextField recordAText;
  
  @SuppressWarnings({ rawtypes, unchecked })
  public RecordAPanel(String id)
  {
  super(id);
  
  recordAService = ((Application)
   RequestCycle.get().getApplication()).getRecordAService();
  recordBService = ((Application)
   RequestCycle.get().getApplication()).getRecordBService();
  
  selectedRecordAModel = new PropertyModelRecordA(this,
   selectedRecordA);
  this.setDefaultModel(selectedRecordAModel);
  
  // * Select  Group *
  
  selectGroup = new WebMarkupContainer(selectGroup);
  selectForm = new Form(selectForm);
  
  recordAs = new DropDownChoiceRecordA(recordAs);
  recordAs.setModel(selectedRecordAModel);
  

RE: PropertyModel Not Refreshing

2010-10-12 Thread Shelli Orton
I had tried removing that line once before and it does solve the problem
when cancelling an edit of an existing record, but I can't cancel the
add of a new one.  Because I'm using a RequiredTextField, I get a
validation error:

 Field 'recordAText' is required.

Thanks for taking the time to look at this and at least confirming that
there is an issue (and it's not just in my mind).

Shelli

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Tuesday, October 12, 2010 3:26 PM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing

going at a hunch I decided to rem out the below:

//cancel.setDefaultFormProcessing(false);

And seems it fixed the problem.. But im too tired to digg further had a
similar situation last week.. And the reason was sound.. Just cant
remember
it now..

2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

 Think I was going in the wrong direction.. Looking at the error, seems
to
 get triggered by pressing the cancel button only..


 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 This is where my confusion about models may be kicking in.  I thought
 that property models (PropertModel or CompoundPropertyModel)
 automatically checked if the model object changed.  How do I tell the
 model it has?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 12:10 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 in your add button you call setSelectedRecordA(new RecordA()) but
never
 notify the model that a change has occured...

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

  hmm getting a lot of errors on the services not implementing
  serialization...
 
  But does seem theres a difference between calling :
 
  selectedRecordAModel.getObject().getName() and
  RecordAPanel.this.selectedRecordA
 
  2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
 
  sorry.. Did'nt see it attached.. So did igor provide you with an
fixed
  quickstart (working on his system).. That did not work on
glassfish?
 
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
  The quickstart was sent to the list this morning at 10:04 MST.
Does
 it
  need to be resent?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:52 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  No dont think so.. Please provide a quickstart.. I have had
property
  models
  working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
   Hi,
  
   Thanks for file.  Your first email was missing these changes:
  
  IModelRecordA selectedRecordAModel;  (I had set mine to
   PropertyModelRecordA selectedRecordAModel;)
  recordAs.setModel(selectedRecordAModel)
  
   However, even with those changes applied, I still get the same
 issue
  of the
   selected record not updating in the edit group.
  
   I am deploying in Glassfish v3.  Could that have anything to do
 with
  my
   problems?
  
   Shelli
  
   -Original Message-
   From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:35 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
 shelli.or...@sjrb.ca
   wrote:
Thanks for the help.  Your changes got rid of the errors and
I
 can
  delete
   records now (and the list is updated).
   
However, once a record has been selected for edit and either
 saved
  or
   cancelled, that same record is always displayed in the edit
group
 when
  I
   choose another record to edit or even when I try to create a
new
 one.
  I can
   even delete the chosen record and it still displays in the edit
 group.
  
   works fine here, meaning you did not completely/propery apply
my
   changes. below is the complete file.
  
   -igor
  
   public class RecordAPanel extends Panel
   {
  private static final long serialVersionUID = 1L;
  
  RecordAService recordAService;
  RecordBService recordBService;
  
  RecordA selectedRecordA = new RecordA();
  IModelRecordA selectedRecordAModel;
  String unmodifiedRecordA;
  
  boolean isNew = false;
  
  WebMarkupContainer selectGroup;
  WebMarkupContainer editGroup;
  
  Form selectForm;
  Form editForm;
  
  DropDownChoiceRecordA recordAs;
  DropDownChoiceRecordB recordBs;
  
  Button add;
  Button edit;
  Button save;
  Button delete;
  Button cancel;
  
  Label editLegendLabel;
  String editLegend;
  Label recordALabel;
  Label recordBLabel;
  
  RequiredTextField recordAText;
  
  @SuppressWarnings({ rawtypes, unchecked })
  public RecordAPanel(String id)
  {
  super(id);
  
  recordAService = ((Application)
  

Re: MinimumValidator and Long problem

2010-10-12 Thread Jeremy Thomerson
Since your model doesn't actually know what type of field it is operating on
(like PropertyModel does), you need to call setType(Long.class) on your text
field.

On Tue, Oct 12, 2010 at 1:23 PM, Zeldor pgronkiew...@gmail.com wrote:


 I have TextField that should take Long value, but on submit it does not
 really work...


 org.apache.wicket.RequestCycle logRuntimeException: Exception
 'java.lang.ClassCastException: java.lang.Integer cannot be cast to
 java.lang.Long' occurred during validation
 org.apache.wicket.validation.validator.MinimumValidator on component
 10:workForm:hire_worker_1
 org.apache.wicket.WicketRuntimeException: Exception
 'java.lang.ClassCastException: java.lang.Integer cannot be cast to
 java.lang.Long' occurred during validation
 org.apache.wicket.validation.validator.MinimumValidator on component
 10:workForm:hire_worker_1


 My code looks like that:

 public Work() {
add(new FeedbackPanel(errorMsg));
FormString workForm = new FormString(workForm, new
 ModelString())
 {
private TextFieldLong hire_worker_1 = new
 TextFieldLong(hire_worker_1, new ModelLong());
 ...
 {
 ...
 add(hire_worker_1.add(new MinimumValidator(0))
.setType(Long.class));
 ...
 }

 @Override
public void onSubmit() {
long hiring_worker_1 =
 hire_worker_1.getModelObject();
...
 }
};
add(workForm);
}

 Eclipse does like new MinimumValidatorLong(0), so what's the solution
 for my problem?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992468.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




-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: How to trigger server-side method when user clicks on a Table Row

2010-10-12 Thread Jeremy Thomerson
On Tue, Oct 12, 2010 at 8:25 AM, duncan787 duncan...@gmail.com wrote:


 Its already attached to the DataView, see the relevant/simplified Java
 code
 added below.  Would it best practice be to assign a WebMarkupContainer to
 the TR element and add both an AjaxFallbackLink and a DataView to the
 container?

DataViewSiteProject projectListDataView =
new DataViewSiteProject(siteProjectList, getDataProvider(), 100)
{
@Override
protected void populateItem(final ItemSiteProject item)
{
SiteProject siteProject = item.getModelObject();
item.add(new Label(ProjectDesc,
 siteProject.getProjectDesc()));
}
};

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991852.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


Nowhere in that code do you attach any ajax behavior that I see.

All you need is this (in your populate item method):

item.add(new AjaxEventBehavior(onclick) { ... onEvent(AjaxRequestTarget
target) { /* do something here */ } });

-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
yeah I see your point.. But you could always validate latter.. But I agree
it's not the way it's supposed to be. It's like the components on the form
does not update when you press cancel and default form processing are off.

-Nino

2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 I had tried removing that line once before and it does solve the problem
 when cancelling an edit of an existing record, but I can't cancel the
 add of a new one.  Because I'm using a RequiredTextField, I get a
 validation error:

 Field 'recordAText' is required.

 Thanks for taking the time to look at this and at least confirming that
 there is an issue (and it's not just in my mind).

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 3:26 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 going at a hunch I decided to rem out the below:

 //cancel.setDefaultFormProcessing(false);

 And seems it fixed the problem.. But im too tired to digg further had a
 similar situation last week.. And the reason was sound.. Just cant
 remember
 it now..

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

  Think I was going in the wrong direction.. Looking at the error, seems
 to
  get triggered by pressing the cancel button only..
 
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
  This is where my confusion about models may be kicking in.  I thought
  that property models (PropertModel or CompoundPropertyModel)
  automatically checked if the model object changed.  How do I tell the
  model it has?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 12:10 PM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  in your add button you call setSelectedRecordA(new RecordA()) but
 never
  notify the model that a change has occured...
 
  2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
 
   hmm getting a lot of errors on the services not implementing
   serialization...
  
   But does seem theres a difference between calling :
  
   selectedRecordAModel.getObject().getName() and
   RecordAPanel.this.selectedRecordA
  
   2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
  
   sorry.. Did'nt see it attached.. So did igor provide you with an
 fixed
   quickstart (working on his system).. That did not work on
 glassfish?
  
  
   2010/10/12 Shelli Orton shelli.or...@sjrb.ca
  
   The quickstart was sent to the list this morning at 10:04 MST.
 Does
  it
   need to be resent?
  
   Shelli
  
   -Original Message-
   From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:52 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   No dont think so.. Please provide a quickstart.. I have had
 property
   models
   working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
  
   2010/10/12 Shelli Orton shelli.or...@sjrb.ca
  
Hi,
   
Thanks for file.  Your first email was missing these changes:
   
   IModelRecordA selectedRecordAModel;  (I had set mine to
PropertyModelRecordA selectedRecordAModel;)
   recordAs.setModel(selectedRecordAModel)
   
However, even with those changes applied, I still get the same
  issue
   of the
selected record not updating in the edit group.
   
I am deploying in Glassfish v3.  Could that have anything to do
  with
   my
problems?
   
Shelli
   
-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Tuesday, October 12, 2010 11:35 AM
To: users@wicket.apache.org
Subject: Re: PropertyModel Not Refreshing
   
On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
  shelli.or...@sjrb.ca
wrote:
 Thanks for the help.  Your changes got rid of the errors and
 I
  can
   delete
records now (and the list is updated).

 However, once a record has been selected for edit and either
  saved
   or
cancelled, that same record is always displayed in the edit
 group
  when
   I
choose another record to edit or even when I try to create a
 new
  one.
   I can
even delete the chosen record and it still displays in the edit
  group.
   
works fine here, meaning you did not completely/propery apply
 my
changes. below is the complete file.
   
-igor
   
public class RecordAPanel extends Panel
{
   private static final long serialVersionUID = 1L;
   
   RecordAService recordAService;
   RecordBService recordBService;
   
   RecordA selectedRecordA = new RecordA();
   IModelRecordA selectedRecordAModel;
   String unmodifiedRecordA;
   
   boolean isNew = false;
   
   WebMarkupContainer selectGroup;
   WebMarkupContainer editGroup;
   
   Form selectForm;
   Form editForm;
   
   DropDownChoiceRecordA recordAs;
   

Re: submit or refresh form via ajax from javascript ?

2010-10-12 Thread Jeremy Thomerson
Did you mean AJAX submit (as your subject implied)?  Have you tried
AjaxFormSubmitBehavior?

On Tue, Oct 12, 2010 at 8:16 AM, jcgarciam jcgarc...@gmail.com wrote:


 Simple javascript:

 var theForm = document.getElementById(formId);
 theForm.submit();




 On Tue, Oct 12, 2010 at 7:53 AM, Maris Orbidans [via Apache Wicket] 
 ml-node+2991613-1252635351-65...@n4.nabble.comml-node%2b2991613-1252635351-65...@n4.nabble.com
 ml-node%2b2991613-1252635351-65...@n4.nabble.comml-node%252b2991613-1252635351-65...@n4.nabble.com
 
  wrote:

 
 
  Is it possible to submit a form from javascript ?
 
 
 
  Maris
 
  -
  To unsubscribe, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2991613i=0
  For additional commands, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2991613i=1
 
 
 
  --
   View message @
 
 http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991613.html
  To start a new topic under Apache Wicket, email
  ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 ml-node%2b1842946-398011874-65...@n4.nabble.comml-node%252b1842946-398011874-65...@n4.nabble.com
 
  To unsubscribe from Apache Wicket, click here
 http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=
 .
 
 
 


 --
 Sincerely,
 JC (http://www.linkedin.com/in/jcgarciam)
 Work smarter, not harder!.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991835.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




-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: PropertyModel Not Refreshing

2010-10-12 Thread Igor Vaynberg
you should first try and understand how models work. there is this
page to help you:

https://cwiki.apache.org/WICKET/working-with-wicket-models.html

but nothing will be better then setting some breakpoints and seeing
how things actually work.

-igor

On Tue, Oct 12, 2010 at 2:24 PM, Shelli Orton shelli.or...@sjrb.ca wrote:
 I only explicitly set the selectedRecordA in two places, during the
 cancel and add onSubmit methods (I removed the initialization in the
 declaration in my code).  As you alluded to earlier, add is done via

    setSelectedRecordA(new RecordA());

 and cancel is done via:

    RecordAPanel.this.selectedRecordA = null;

 I changed cancel to be:

    setSelectedRecordA(new RecordA());

 but it doesn't seem to make a difference, still get the issue when
 cancelling.

 Should I be setting the selectedRecordA to null on cancel?  It makes
 sense to me and it's what I've done in other applications/frameworks,
 but perhaps it's not correct in Wicket...

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 3:00 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 Think I was going in the wrong direction.. Looking at the error, seems
 to
 get triggered by pressing the cancel button only..

 2010/10/12 Shelli Orton shelli.or...@sjrb.ca

 This is where my confusion about models may be kicking in.  I thought
 that property models (PropertModel or CompoundPropertyModel)
 automatically checked if the model object changed.  How do I tell the
 model it has?

 Shelli

 -Original Message-
 From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
 Sent: Tuesday, October 12, 2010 12:10 PM
 To: users@wicket.apache.org
 Subject: Re: PropertyModel Not Refreshing

 in your add button you call setSelectedRecordA(new RecordA()) but
 never
 notify the model that a change has occured...

 2010/10/12 nino martinez wael nino.martinez.w...@gmail.com

  hmm getting a lot of errors on the services not implementing
  serialization...
 
  But does seem theres a difference between calling :
 
  selectedRecordAModel.getObject().getName() and
  RecordAPanel.this.selectedRecordA
 
  2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
 
  sorry.. Did'nt see it attached.. So did igor provide you with an
 fixed
  quickstart (working on his system).. That did not work on
 glassfish?
 
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
  The quickstart was sent to the list this morning at 10:04 MST.
 Does
 it
  need to be resent?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 11:52 AM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  No dont think so.. Please provide a quickstart.. I have had
 property
  models
  working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
   Hi,
  
   Thanks for file.  Your first email was missing these changes:
  
      IModelRecordA selectedRecordAModel;  (I had set mine to
   PropertyModelRecordA selectedRecordAModel;)
      recordAs.setModel(selectedRecordAModel)
  
   However, even with those changes applied, I still get the same
 issue
  of the
   selected record not updating in the edit group.
  
   I am deploying in Glassfish v3.  Could that have anything to do
 with
  my
   problems?
  
   Shelli
  
   -Original Message-
   From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:35 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   On Tue, Oct 12, 2010 at 10:30 AM, Shelli Orton
 shelli.or...@sjrb.ca
   wrote:
Thanks for the help.  Your changes got rid of the errors and I
 can
  delete
   records now (and the list is updated).
   
However, once a record has been selected for edit and either
 saved
  or
   cancelled, that same record is always displayed in the edit
 group
 when
  I
   choose another record to edit or even when I try to create a new
 one.
  I can
   even delete the chosen record and it still displays in the edit
 group.
  
   works fine here, meaning you did not completely/propery apply my
   changes. below is the complete file.
  
   -igor
  
   public class RecordAPanel extends Panel
   {
      private static final long serialVersionUID = 1L;
  
      RecordAService recordAService;
      RecordBService recordBService;
  
      RecordA selectedRecordA = new RecordA();
      IModelRecordA selectedRecordAModel;
      String unmodifiedRecordA;
  
      boolean isNew = false;
  
      WebMarkupContainer selectGroup;
      WebMarkupContainer editGroup;
  
      Form selectForm;
      Form editForm;
  
      DropDownChoiceRecordA recordAs;
      DropDownChoiceRecordB recordBs;
  
      Button add;
      Button edit;
      Button save;
      Button delete;
      Button cancel;
  
      Label 

Re: wicket 1.5, resource gives error in log?

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

-igor

On Tue, Oct 12, 2010 at 3:49 AM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 Hi

 I have something where I reference an image directly in html, wicket has no
 idea what it should do with it so it passes the request to the servlet
 container.. And it works as I wanted, but should it give an error message?
 Or am I doing something wrong?

 html:
  img src=/images/icons/arrow_down_end.png/

 Log:
 ERROR [org.apache.wicket.request.cycle.RequestCycle]  - Unable to execute
 request. No suitable RequestHandler found.
 URL=images/icons/arrow_down_end.png

 regards Nino


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



Re: PropertyModel Not Refreshing

2010-10-12 Thread nino martinez wael
got point igor.. The first thing I did with the project was copying over the
start.java..Having break points etc just gives it a better sense..

Shelli heres the start.java:



import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.bio.SocketConnector;
import org.mortbay.jetty.webapp.WebAppContext;

public class Start {

public static void main(String[] args) throws Exception {
Server server = new Server();
SocketConnector connector = new SocketConnector();
// Set some timeout options to make debugging easier.
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8081);
server.setConnectors(new Connector[] { connector });

WebAppContext bb = new WebAppContext();
bb.setServer(server);
bb.setContextPath(/);
bb.setWar(src/main/webapp);


// START JMX SERVER
// MBeanServer mBeanServer =
ManagementFactory.getPlatformMBeanServer();
// MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
// server.getContainer().addEventListener(mBeanContainer);
// mBeanContainer.start();

server.addHandler(bb);

try {
System.out.println( STARTING EMBEDDED JETTY SERVER, PRESS
ANY KEY TO STOP);
server.start();
while (System.in.available() == 0) {
Thread.sleep(5000);
}
server.stop();
server.join();
} catch (Exception e) {
e.printStackTrace();
System.exit(100);
}
}
}


Good night
- Nino

2010/10/12 Igor Vaynberg igor.vaynb...@gmail.com

 you should first try and understand how models work. there is this
 page to help you:

 https://cwiki.apache.org/WICKET/working-with-wicket-models.html

 but nothing will be better then setting some breakpoints and seeing
 how things actually work.

 -igor

 On Tue, Oct 12, 2010 at 2:24 PM, Shelli Orton shelli.or...@sjrb.ca
 wrote:
  I only explicitly set the selectedRecordA in two places, during the
  cancel and add onSubmit methods (I removed the initialization in the
  declaration in my code).  As you alluded to earlier, add is done via
 
 setSelectedRecordA(new RecordA());
 
  and cancel is done via:
 
 RecordAPanel.this.selectedRecordA = null;
 
  I changed cancel to be:
 
 setSelectedRecordA(new RecordA());
 
  but it doesn't seem to make a difference, still get the issue when
  cancelling.
 
  Should I be setting the selectedRecordA to null on cancel?  It makes
  sense to me and it's what I've done in other applications/frameworks,
  but perhaps it's not correct in Wicket...
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 3:00 PM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  Think I was going in the wrong direction.. Looking at the error, seems
  to
  get triggered by pressing the cancel button only..
 
  2010/10/12 Shelli Orton shelli.or...@sjrb.ca
 
  This is where my confusion about models may be kicking in.  I thought
  that property models (PropertModel or CompoundPropertyModel)
  automatically checked if the model object changed.  How do I tell the
  model it has?
 
  Shelli
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Tuesday, October 12, 2010 12:10 PM
  To: users@wicket.apache.org
  Subject: Re: PropertyModel Not Refreshing
 
  in your add button you call setSelectedRecordA(new RecordA()) but
  never
  notify the model that a change has occured...
 
  2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
 
   hmm getting a lot of errors on the services not implementing
   serialization...
  
   But does seem theres a difference between calling :
  
   selectedRecordAModel.getObject().getName() and
   RecordAPanel.this.selectedRecordA
  
   2010/10/12 nino martinez wael nino.martinez.w...@gmail.com
  
   sorry.. Did'nt see it attached.. So did igor provide you with an
  fixed
   quickstart (working on his system).. That did not work on
  glassfish?
  
  
   2010/10/12 Shelli Orton shelli.or...@sjrb.ca
  
   The quickstart was sent to the list this morning at 10:04 MST.
  Does
  it
   need to be resent?
  
   Shelli
  
   -Original Message-
   From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
   Sent: Tuesday, October 12, 2010 11:52 AM
   To: users@wicket.apache.org
   Subject: Re: PropertyModel Not Refreshing
  
   No dont think so.. Please provide a quickstart.. I have had
  property
   models
   working in 1.2, 1.3, 1.4 and 1.5 so must be error 42:)
  
   2010/10/12 Shelli Orton shelli.or...@sjrb.ca
  
Hi,
   
Thanks for file.  Your first email was missing these changes:
   
   IModelRecordA selectedRecordAModel;  (I had set mine to
PropertyModelRecordA selectedRecordAModel;)
   

Re: wicket 1.5, resource gives error in log?

2010-10-12 Thread nino martinez wael
done -- https://issues.apache.org/jira/browse/WICKET-3103

2010/10/12 Igor Vaynberg igor.vaynb...@gmail.com

 no, that shouldnt be there. file a bug please.

 -igor

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

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




Re: MinimumValidator and Long problem

2010-10-12 Thread Zeldor

Changing it to :

private TextFieldLong hire_worker_1 = new TextFieldLong(hire_worker_1,
new ModelLong());
{
hire_worker_1.setType(Long.class);
}

Does not change anything. And is it normal that Eclipse does not let me add
anything without enclosing in { }?

BTW, is there any easy way to convert nulls to 0 when you submit empty
TextFields?

On Tue, Oct 12, 2010 at 11:31 PM, jer...@wickettraining.com [via Apache
Wicket] 
ml-node+2992772-1878280583-152...@n4.nabble.comml-node%2b2992772-1878280583-152...@n4.nabble.com
 wrote:

 Since your model doesn't actually know what type of field it is operating
 on
 (like PropertyModel does), you need to call setType(Long.class) on your
 text
 field.

 On Tue, Oct 12, 2010 at 1:23 PM, Zeldor [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2992772i=0
 wrote:

 
  I have TextField that should take Long value, but on submit it does not
  really work...
 
 
  org.apache.wicket.RequestCycle logRuntimeException: Exception
  'java.lang.ClassCastException: java.lang.Integer cannot be cast to
  java.lang.Long' occurred during validation
  org.apache.wicket.validation.validator.MinimumValidator on component
  10:workForm:hire_worker_1
  org.apache.wicket.WicketRuntimeException: Exception
  'java.lang.ClassCastException: java.lang.Integer cannot be cast to
  java.lang.Long' occurred during validation
  org.apache.wicket.validation.validator.MinimumValidator on component
  10:workForm:hire_worker_1
 
 
  My code looks like that:
 
  public Work() {
 add(new FeedbackPanel(errorMsg));
 FormString workForm = new FormString(workForm, new
  ModelString())
  {
 private TextFieldLong hire_worker_1 = new
  TextFieldLong(hire_worker_1, new ModelLong());
  ...
  {
  ...
  add(hire_worker_1.add(new MinimumValidator(0))
 .setType(Long.class));
  ...
  }
 
  @Override
 public void onSubmit() {
 long hiring_worker_1 =
  hire_worker_1.getModelObject();
 ...
  }
 };
 add(workForm);
 }
 
  Eclipse does like new MinimumValidatorLong(0), so what's the solution

  for my problem?
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992468.htmlhttp://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992468.html?by-user=t
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=2992772i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=2992772i=2
 
 


 --
 Jeremy Thomerson
 http://www.wickettraining.com http://www.wickettraining.com?by-user=t


 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992772.html
 To unsubscribe from MinimumValidator and Long problem, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=2992468code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwyOTkyNDY4fC0xMTUwMjA4NDM=.




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992825.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: MinimumValidator and Long problem

2010-10-12 Thread Jeremy Thomerson
On Tue, Oct 12, 2010 at 5:07 PM, Zeldor pgronkiew...@gmail.com wrote:


 Changing it to :

 private TextFieldLong hire_worker_1 = new
 TextFieldLong(hire_worker_1,
 new ModelLong());
 {
hire_worker_1.setType(Long.class);
}

 Does not change anything. And is it normal that Eclipse does not let me add
 anything without enclosing in { }?


Seems like you have a syntax error perhaps a problem with an anonymous
inner class.  You can use Pastebin to paste entire file and we can attempt
to help.


 BTW, is there any easy way to convert nulls to 0 when you submit empty
 TextFields?


Create an IConverter and override getConverter


-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: MinimumValidator and Long problem

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

-igor

On Tue, Oct 12, 2010 at 3:25 PM, Jeremy Thomerson
jer...@wickettraining.com wrote:
 On Tue, Oct 12, 2010 at 5:07 PM, Zeldor pgronkiew...@gmail.com wrote:


 Changing it to :

 private TextFieldLong hire_worker_1 = new
 TextFieldLong(hire_worker_1,
 new ModelLong());
             {
            hire_worker_1.setType(Long.class);
            }

 Does not change anything. And is it normal that Eclipse does not let me add
 anything without enclosing in { }?


 Seems like you have a syntax error perhaps a problem with an anonymous
 inner class.  You can use Pastebin to paste entire file and we can attempt
 to help.


 BTW, is there any easy way to convert nulls to 0 when you submit empty
 TextFields?


 Create an IConverter and override getConverter


 --
 Jeremy Thomerson
 http://www.wickettraining.com


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



Re: MinimumValidator and Long problem

2010-10-12 Thread Jeremy Thomerson
On Tue, Oct 12, 2010 at 5:36 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 its not a syntax problem. you cant have code outside a method unless
 its in a static {} block.


To me, putting code outside a method *is* a syntax problem, typically caused
by inexperience with anonymous inner classes, leading to not enough, or too
many }

-- 
Jeremy Thomerson
http://www.wickettraining.com


RE: Wicket site on Android phone

2010-10-12 Thread Randy S.
A big advantage of the iphone browser is its ability to scroll an inner
scrolling box (scrollable div or iframe, for example). It does this by
handling a two-finger drag as scroll. I'm not aware of a way to do the same
with the android browser.

We also are facing demand for a desktop web app to be used on android so
we are considering in some cases simplifying the UI to accommodate this. One
example is bouncing to a different page rather than using a modal dialog for
some interactions.

Back on topic for Wicket, scrolling is the only barrier we have seen.
Everything else works. For what it's worth, a lot of our ajax stuff is
wiquery-based.
On Oct 8, 2010 3:58 AM, Chris Colman chr...@stepaheadsoftware.com wrote:
 The Android market is going through spectacular growth at the moment.
 It's going bezerk!

 http://blogs.wsj.com/digits/2010/10/05/the-rise-of-android-what-does-it-
 mean-for-apple-users/

 The fact that it supports Flash and that its apps are written in Java
 instead of Objective C like the iPhone (last I heard of that language
 was in 1989!) made it extremely attractive to me but even without
 writing specific Android apps the fact that it has a proper browser
 means that wicket powered sites around the world will start to get
 visited, a lot, by yet another browser type. They've also found that
 Andtroid users, on average, pull down 25% more data per month on their
 iPhone cousins - apparently they're a lot more tech savvy crowd - less
 'Angry Birds' and more ServerSide etc.,

 Coming from Java world my knowledge of JavaScript is very limited so I
 don't know how helpful I'll be in debugging the Javascript as executed
 on a Webkit/Android browser.

 If anyone else out there has a wicket website and an Android phone I'd
 like to know if you experience some of the problem I did. It only
 appears to affect JavaScript - standard HTML form submission seems fine
 - as expected.

 - Chris

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Friday, 8 October 2010 12:06 AM
To: users@wicket.apache.org
Subject: Re: Wicket site on Android phone

I guess it is some WebKit related Javascript issues.
Don't know how hard is to debug them but if you manage - send us a
 patch ;-
)

On Thu, Oct 7, 2010 at 2:03 PM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 I've just picked up a new Android phone (HTC Desire - awesome phone
 BTW)
 and most of our wicket powered site works well. There are two issues
 which maybe just me not knowing how to use the phone properly or they
 may be issues with the Webkit based browser on those things:
 1. I haven't been able to grab the caption on modal windows in
 order to drag them around on the screen. Being a 'touch' based
 paradigm
 maybe there is no such thing as a 'grab'.
 2. Clicking the OK button on a modal window doesn't seem to have
 any effect - the modal stays open.
 I have only had the phone for a couple of days so the issues could be
 all me - not knowing how to perform the above operations - if anyone
 has
 some enlightenment, please let me know.



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



Re: Integrating Separate Different Wicket Applications Into One

2010-10-12 Thread Nivedan Nadaraj
I implemented/integrated a sub-module(s) into one main web application.
The solution is discussed in the link below. Hope this helps.

http://apache-wicket.1842946.n4.nabble.com/Re-Using-Wicket-to-build-Application-Portal-td2248912.html#a2248912

Cheers


On Tue, Oct 12, 2010 at 11:28 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi

 When you say integrate different applications, do u mean each one is a
 sub-application? Do those applications extend the WicketApplication class?
 If they don't then I have had some experience to integrate sub-modules into
 one main application. Let me know if that is what you mean. Otherwise I
 guess some of the experts here would help out.

 Cheers



 On Tue, Oct 12, 2010 at 2:06 AM, kugaprakash kvisagam...@infoblox.comwrote:


 Hi,
 Can you please let me know?
 thanks
 Kuga
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Integrating-Separate-Different-Wicket-Applications-Into-One-tp1889319p2990281.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





using cometd

2010-10-12 Thread fachhoch

I get this message 

JSONCommented is deprecated null null


I am using org.wicketstuff.push  version 1.4.8,
I get the above message sometimes  , do not know when , please tell  me is
this any problem ? 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-cometd-tp2993011p2993011.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: MinimumValidator and Long problem

2010-10-12 Thread Zeldor

I have nothing else really, just same more of same stuff, only a Form with
Labels, TextFields and submit method.

Anyway, deprecated NumberValidator.minimum(0) method works without any
problems, are there any disadvantages of using that?

On Wed, Oct 13, 2010 at 12:43 AM, jer...@wickettraining.com [via Apache
Wicket] 
ml-node+2992859-520586739-152...@n4.nabble.comml-node%2b2992859-520586739-152...@n4.nabble.com
 wrote:

 On Tue, Oct 12, 2010 at 5:36 PM, Igor Vaynberg [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2992859i=0wrote:


  its not a syntax problem. you cant have code outside a method unless
  its in a static {} block.
 
 
 To me, putting code outside a method *is* a syntax problem, typically
 caused
 by inexperience with anonymous inner classes, leading to not enough, or too

 many }

 --
 Jeremy Thomerson
 http://www.wickettraining.com http://www.wickettraining.com?by-user=t


 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992859.html
 To unsubscribe from MinimumValidator and Long problem, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=2992468code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwyOTkyNDY4fC0xMTUwMjA4NDM=.




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2993027.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



AjaxRequestTarget not refreshing Component

2010-10-12 Thread LutherBaker

I have created an outer list of areaGroups such that each group item contains
a list of areas. 

I am displaying a ModalWindow and editing an area. After changing the area's
name, I submit it via an AjaxSubmitButton which initially added the ListView
associated with a particular group. Obviously that failed (can't add a
repeater to an AjaxTargetRequest) at which point I added a
WebMarkupContainer to the markup. 

dl wicket:id=group.list class=groupList 
 dt[group name]/dt 
 wicket:container wicket:id=item.list.container 
 dd wicket:id=item.list 
Edit
 [item name]
 div class=summary wicket:id=item.summary[item summary]/div 
 /dd 
 /wicket:container 
/dl 

I feed this inner ListView with a LodableDetachableModel where I
fetchAreasByAreaGroup: 

@Override 
protected ListArea load() { 
return dataService.fetchAreasByAreaGroup(areaGroup); 
} 

I also created a WebMarkupContainer in code and set its outputMarkupId: 

final WebMarkupContainer itemListContainer = new
WebMarkupContainer(item.list.container); 
itemListContainer.setOutputMarkupId(true); 

I store the markup container in a hashmap keyed by AreaGroup which allows me
to, from the ModalWindow, retrieve the markup container associated with the
edited area's AreaGroup. Which I then add to the AjaxRequestTarget in the
ModalWindow's form's AjaxButton.onSubmit handler: 

final WebMarkupContainer container =
areaPage.getWebMarkupContainer(area.getAreaGroup()); 
target.addComponent(container); 

So all is well. It all compiles and the page loads without error. So, again,
I pop the ModalWindow up, change the name and put a breakpoint in the code.
I can see the AjaxRequestTarget add the container. I can see that the
container is not null. I can see the dataService retrieve the new area. I
can see the code execute which populates the inner ListView I mentioned
earlier - with the updated area properties. 

But, after the ModalWindow goes away, the underlying screen representation
doesn't change. The old name is still displayed. 

Here is a snippet of the generated markup where you can see
item_list_container53 which identifies the wicket:container that I wish to
repaint. 

dl wicket:id=group.list class=groupList 
 dtWork/dt 
 wicket:container wicket:id=item.list.container
id=item_list_container53 
 dd wicket:id=item.list 
Edit
 Hammerhead
 div class=summary wicket:id=item.summaryDay job learning large
scale infrastructure skills/div 
 /dd 
 /wicket:container 
/dldl wicket:id=group.list class=groupList 
 dtBusiness Ventures/dt 
 wicket:container wicket:id=item.list.container
id=item_list_container55 
 dd wicket:id=item.list 
Edit
 Fuzzy Bearings
 div class=summary wicket:id=item.summarySoftware Development
Effort/div 
 /dd 
 /wicket:container 
/dl 


Any thoughts on what I am missing? 

Thanks in advance, 
-Luther 

PS: Please note that nabble will not accept posts with 'onclick' text in the
code snippet 'a' tags ... so I specifically edited onClick to simply be
click in the code snippets.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxRequestTarget-not-refreshing-Component-tp2993093p2993093.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