Re: custom (non wicket) modal dialog. Problem with urls.

2011-08-09 Thread brazz
Hi, 

thank you very much for your answer. It's correct till number 3.
The link in the modal dialog has to be a resourcelink, which loads a pdf
document from the server. I cannot use an external link because there is a
firewall between user and document server (therefore i have to open an
http-connection on the server). My problem is that neither the getData()
method of the ResourceState nor the onclick() method of the link gets called
because the response page ist the page in the background and not the page in
the modal dialog where the links reside . Here's the code for my link. I
have tested it and it works outside of the modal dialog, no problem with
that. So i think the problem is really that i don't get callback messages
from wicket in my links because the page with the links is not the response
page. 


private ResourceLinkVoid createResourceLink(
final Link serviceInfoLink, String labelId, String 
linkId) {
final ASPDynamicResource resource = new
ASPDynamicResource(URLUtil.extractFileName(serviceInfoLink.getUrl())){
private static final long serialVersionUID = 1L;

@Override
public String getContentType() {
return application/pdf;
};

@Override
public String getUrl() {
return serviceInfoLink.getUrl();
};

};
ResourceLinkVoid resourceLink = new 
ResourceLinkVoid(linkId, resource)
{
@Override
public void onClick() {
if(resource.isResourceAvailable()){
log.error(Resource with name:  + 
serviceInfoLink.getUrl()  + is not
available);
}
super.onClick();
}
private static final long serialVersionUID = 
192187593624907520L;

};
resourceLink.add(new Label(labelId, serviceInfoLink.getName()));
return resourceLink;
}

public abstract class ASPDynamicResource extends DynamicWebResource {

private static final long serialVersionUID = -4500556464921243755L;

private Log log = LogFactory.getLog(ASPDynamicResource.class);

public ASPDynamicResource(String id){
super(id);
}

@Override
protected ResourceState getResourceState() {
return new ASPResourceState();
}

private class ASPResourceState extends ResourceState {
   
public String getContentType() {
return ASPDynamicResource.this.getContentType();
}
   
public byte[] getData() {
URLReader urlReader = URLReader.newInstance();
try {
return 
urlReader.getBytes(urlReader.webProxyUrl(getUrl()));
} catch (MalformedURLException e) {
log.error(e);
} catch (Exception e) {
log.error(e);
}
return null;
}
}

public boolean isResourceAvailable() {
URLTester urlTester = URLTester.newInstance();
try {
return 
urlTester.isReachable(urlTester.webProxyUrl(getUrl()));
} catch (MalformedURLException e) {
log.error(e);
return false;
} catch (Exception e) {
log.error(e);
return false;
}
}

public abstract String getUrl();

public abstract String getContentType();

}

public abstract class ASPDynamicResource extends DynamicWebResource {

private static final long serialVersionUID = -4500556464921243755L;

private Log log = LogFactory.getLog(ASPDynamicResource.class);

public ASPDynamicResource(String id){
super(id);
}

@Override
protected ResourceState getResourceState() {
return new ASPResourceState();
}

private class ASPResourceState extends ResourceState {
   
public String getContentType() {
return ASPDynamicResource.this.getContentType();
}
   
public byte[] getData() {
URLReader urlReader = URLReader.newInstance();
try {
return 
urlReader.getBytes(urlReader.webProxyUrl(getUrl()));
} catch 

Re: wicket, hibernate, spring setup

2011-08-09 Thread msj121
jWeekend no longer seems to have a wicket/hibernate/spring archetype.

SOLVED:
I had a lot of trouble using eclipse, but simply I did the following from
the command line:
mvn archertype:generate
and then went through the steps of choosing groupid etc


after all my attempts the archetype was in this list but not eclipse no
matter what I was doing. You may need to switch to the directory and run
mvn package install if you don't see it populated in the list.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-hibernate-spring-setup-tp3728444p3729072.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: Username gets cached

2011-08-09 Thread Hielke Hoeve
This is probably a browser 'feature' where certain form field get cached 
client-side. Very annoying especially since they can show unexpected 
behavior... autocomplete=off is optional so not all browsers use it.

Hielke

-Original Message-
From: Anna Simbirtsev [mailto:asimbirt...@gmail.com] 
Sent: woensdag 3 augustus 2011 15:37
To: users@wicket.apache.org
Subject: Username gets cached

Hi,

On the login page I have a text field with wicket id username and Password text 
field with wicket id password.
If I have a password text field on a different page with different wicket id, 
it caches the values and populates the password field with password and the 
field before it with username.

How can I turn off auto populating the fields?

Thanks
Anna

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



Wicket examples in new version

2011-08-09 Thread marcelp
Hello,

I ran the wicket examples in my Eclipse without any problems (after
importing as Maven project from the src/wicket-examples). The wicket version
here is appearantly 1.4.17.

In my project at work we have the latest wicket version
wicket.version1.5-RC5.1/wicket.version

Now, here do some of the examples not work. For example the repeater example
has a file called DatabaseLocater.java. here I get import
org.apache.wicket.RequestCycle cannot be resolved.

What can I do to get the examples work in the latest version?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-examples-in-new-version-tp3729204p3729204.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 examples in new version

2011-08-09 Thread Sven Meier
Seems you're mixing 1.4.x examples with 1.5 core, you should check your 
classpath.


Hope this helps
Sven

On 08/09/2011 09:29 AM, marcelp wrote:

Hello,

I ran the wicket examples in my Eclipse without any problems (after
importing as Maven project from the src/wicket-examples). The wicket version
here is appearantly 1.4.17.

In my project at work we have the latest wicket version
wicket.version1.5-RC5.1/wicket.version

Now, here do some of the examples not work. For example the repeater example
has a file called DatabaseLocater.java. here I get import
org.apache.wicket.RequestCycle cannot be resolved.

What can I do to get the examples work in the latest version?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-examples-in-new-version-tp3729204p3729204.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: Wicket examples in new version

2011-08-09 Thread marcelp
Hi Sven,

You are right. I did mix them up. I got it compiling now but I get runtime
exceptions. I might come back ;-0 Thanks for the hint.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-examples-in-new-version-tp3729204p3729516.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 examples in new version

2011-08-09 Thread marcelp
Hmm, I can't seem to get to the problem myself.

Last cause: Failed to find markup file associated. ActionPanel: [ActionPanel
[Component id = actions]]

Root cause:org.apache.wicket.markup.MarkupNotFoundException: Failed to find
markup file associated. ActionPanel: [ActionPanel [Component id = actions]]
at
org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.getMarkup(PanelMarkupSourcingStrategy.java:63)

at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:464)
at
org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:669)

at
org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:50)

at org.apache.wicket.Component.internalRenderComponent(Component.java:2584)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1537)

etc

The SimplePage from the examples has the problem. 
Java:

item.add(new ActionPanel(actions, item.getModel()));

HTML:
td[actions]/td

The BasePage.java has a class 

class ActionPanel extends Panel
{
/**
 * @param id
 *component id
 * @param model
 *model for contact
 */
public ActionPanel(String id, IModelContact model)
{
super(id, model);
add(new Link(select)
{
@Override
public void onClick()
{
selected = 
(Contact)getParent().getDefaultModelObject();
}
});
}
}

Anyone got any ideas?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-examples-in-new-version-tp3729204p3729627.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 examples in new version

2011-08-09 Thread marcelp
THe HTML code got deleted in previous message. Should read:span
wicket:id=actions [actions] with brackets

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-examples-in-new-version-tp3729204p3729633.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 examples in new version

2011-08-09 Thread Martin Grigorov
How exactly do you start the examples ?
I run org.apache.wicket.examples.StartExamples as Java Application and
all repeaters work fine in current trunk.

On Tue, Aug 9, 2011 at 2:11 PM, marcelp marcel_po...@deltalloyd.nl wrote:
 THe HTML code got deleted in previous message. Should read:    span
 wicket:id=actions [actions] with brackets

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-examples-in-new-version-tp3729204p3729633.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





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

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



Re: Wicket examples in new version

2011-08-09 Thread marcelp
Hi martin,

Like i said in my first post, when I import as Mavenproject then it works
fine. When I copy and paste some of the files from the examples to my true
project (like what i am doing with the simplepage because I need this
exactly) it doesn't work completely. What I first noticed is that some code
from the examples needed changes. Contructors had different parameters for
example.

So now I have ths problem with Actionpanel

Last cause: Failed to find markup file associated. ActionPanel: [ActionPanel
[Component id = actions]] 

When I change my code from SimplePage.java

item.add(new ActionPanel(actions, item.getModel())); 


into 

item.add(new Label(actions,  Select));

it does work, however it has no click functionality obviously.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-examples-in-new-version-tp3729204p3729678.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 job, Helsinki, Finland

2011-08-09 Thread Martin Makundi
Hi!

We have a job-opening for a wicket developer.

The job requires on-site presence (Helsinki, Finland) and finnish
language skills (minimum fluent in reading).

Project starts in august and duration is 3-6 months.

Apply at: http://www.youritprofile.com/job_ad/id/2813


**
Martin

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



Radio with compoundPropertyModel

2011-08-09 Thread Marco Aurélio Silva
Hi All

I'm having problems to make a radio component work the way I need.

I have a list of PhoneNumber objects:

class PhoneNumber {

String number;
boolean default;
}

The list can have only one entry set as default value. I'm trying to
make the radio button set the value of default in each object, so when
I submit the form to save the object  my model is synced with user
changes. I don't want to set the value in the radioGroup model.

I've created a Panel to edit a single phoneNumber object:


public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

setModel(new CompoundPropertyModel(phoneNumber));

add(TextField(number));

add(Radio(default));

}


And I'm using a repeater to add one EditPhonePanel for each phone in my list.

The number property of PhoneNumber object is being updated as
expected, but I don't know how to make the radio button update the
default property. Can someone help me? Thanks in advance!

I'm using wicket 1.3.6 and java 5

Marco Silva

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



Re: Radio with compoundPropertyModel

2011-08-09 Thread Rodrigo Heffner
Hi Marco,

I haven't tested this, but I believe this should do the trick:

class PhoneNumber {

String number;
boolean default;

/* Add getters and setters for both  */

}

public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

CompoundPropertyModel model = new CompoundPropertyModel(phoneNumber);

add(TextField(number), model.bind(number));

add(Radio(default, model.bind(default)));

}

Let me know if this works.


Cheers,
Rodrigo

On Tue, Aug 9, 2011 at 6:48 PM, Marco Aurélio Silva marc...@gmail.com wrote:
 Hi All

 I'm having problems to make a radio component work the way I need.

 I have a list of PhoneNumber objects:

 class PhoneNumber {

 String number;
 boolean default;
 }

 The list can have only one entry set as default value. I'm trying to
 make the radio button set the value of default in each object, so when
 I submit the form to save the object  my model is synced with user
 changes. I don't want to set the value in the radioGroup model.

 I've created a Panel to edit a single phoneNumber object:


 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 setModel(new CompoundPropertyModel(phoneNumber));

 add(TextField(number));

 add(Radio(default));

 }


 And I'm using a repeater to add one EditPhonePanel for each phone in my list.

 The number property of PhoneNumber object is being updated as
 expected, but I don't know how to make the radio button update the
 default property. Can someone help me? Thanks in advance!

 I'm using wicket 1.3.6 and java 5

 Marco Silva

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





-- 
Rodrigo H M Bezerra

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



Re: Radio with compoundPropertyModel

2011-08-09 Thread Rodrigo Heffner
Please change my TextField line for

add(TextField(number, model.bind(number)));

Please check parenthesis as well :) I'm not working now and my IDE is not open

Sorry!

On Tue, Aug 9, 2011 at 7:12 PM, Rodrigo Heffner
rodrigo.heff...@gmail.com wrote:
 Hi Marco,

 I haven't tested this, but I believe this should do the trick:

 class PhoneNumber {

 String number;
 boolean default;

 /* Add getters and setters for both  */

 }

 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 CompoundPropertyModel model = new CompoundPropertyModel(phoneNumber);

 add(TextField(number), model.bind(number));

 add(Radio(default, model.bind(default)));

 }

 Let me know if this works.


 Cheers,
 Rodrigo

 On Tue, Aug 9, 2011 at 6:48 PM, Marco Aurélio Silva marc...@gmail.com wrote:
 Hi All

 I'm having problems to make a radio component work the way I need.

 I have a list of PhoneNumber objects:

 class PhoneNumber {

 String number;
 boolean default;
 }

 The list can have only one entry set as default value. I'm trying to
 make the radio button set the value of default in each object, so when
 I submit the form to save the object  my model is synced with user
 changes. I don't want to set the value in the radioGroup model.

 I've created a Panel to edit a single phoneNumber object:


 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 setModel(new CompoundPropertyModel(phoneNumber));

 add(TextField(number));

 add(Radio(default));

 }


 And I'm using a repeater to add one EditPhonePanel for each phone in my list.

 The number property of PhoneNumber object is being updated as
 expected, but I don't know how to make the radio button update the
 default property. Can someone help me? Thanks in advance!

 I'm using wicket 1.3.6 and java 5

 Marco Silva

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





 --
 Rodrigo H M Bezerra




-- 
Rodrigo H M Bezerra

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



Re: Radio with compoundPropertyModel

2011-08-09 Thread Marco Aurélio Silva
Hi Rodrigo,

Thanks for the fast response, but that approach didn't solve the
problem. Actually, the problem is not the CompoundPropertyModel, if I
use a PropertyModel instead it wouldn't work as well... in both cases
only the textField is updating my model, the radio does not.

Thanks
Marco

On Tue, Aug 9, 2011 at 4:13 PM, Rodrigo Heffner
rodrigo.heff...@gmail.com wrote:
 Please change my TextField line for

 add(TextField(number, model.bind(number)));

 Please check parenthesis as well :) I'm not working now and my IDE is not open

 Sorry!

 On Tue, Aug 9, 2011 at 7:12 PM, Rodrigo Heffner
 rodrigo.heff...@gmail.com wrote:
 Hi Marco,

 I haven't tested this, but I believe this should do the trick:

 class PhoneNumber {

 String number;
 boolean default;

 /* Add getters and setters for both  */

 }

 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 CompoundPropertyModel model = new CompoundPropertyModel(phoneNumber);

 add(TextField(number), model.bind(number));

 add(Radio(default, model.bind(default)));

 }

 Let me know if this works.


 Cheers,
 Rodrigo

 On Tue, Aug 9, 2011 at 6:48 PM, Marco Aurélio Silva marc...@gmail.com 
 wrote:
 Hi All

 I'm having problems to make a radio component work the way I need.

 I have a list of PhoneNumber objects:

 class PhoneNumber {

 String number;
 boolean default;
 }

 The list can have only one entry set as default value. I'm trying to
 make the radio button set the value of default in each object, so when
 I submit the form to save the object  my model is synced with user
 changes. I don't want to set the value in the radioGroup model.

 I've created a Panel to edit a single phoneNumber object:


 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 setModel(new CompoundPropertyModel(phoneNumber));

 add(TextField(number));

 add(Radio(default));

 }


 And I'm using a repeater to add one EditPhonePanel for each phone in my 
 list.

 The number property of PhoneNumber object is being updated as
 expected, but I don't know how to make the radio button update the
 default property. Can someone help me? Thanks in advance!

 I'm using wicket 1.3.6 and java 5

 Marco Silva

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





 --
 Rodrigo H M Bezerra




 --
 Rodrigo H M Bezerra

 -
 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: Radio with compoundPropertyModel

2011-08-09 Thread Rodrigo Heffner
Hi Marco,

I'm not sure why this is happening. I would probably add an
AjaxFormComponentUpdatingBehavior to your radio (here is an example
http://wicketstuff.org/wicket13/ajax/choice) and use some debug lines
to check values. Note that your components must be inside a form
(which I believe yours must be anyways).

Here's how I think the code would look like:

//let's say that modelChoices is an array of strings that contains
default in it
final RadioChoice radio = new RadioChoice(default,
model.bind(default), modelChoices);
radio.setOutputMarkupId(true);

radio.add(new AjaxFormComponentUpdatingBehavior(onchange)
{
protected void onUpdate(AjaxRequestTarget target)
{
target.addComponent(this.getComponent());
//debug here or add log lines to see the value of
this.getComponent().getDefaultModelObject();
}
});

Sorry this isn't a solution, but it's where I'd start looking for
something. I'm sure someone with more experience may have a much
better suggestion.

On Tue, Aug 9, 2011 at 7:19 PM, Marco Aurélio Silva marc...@gmail.com wrote:
 Hi Rodrigo,

 Thanks for the fast response, but that approach didn't solve the
 problem. Actually, the problem is not the CompoundPropertyModel, if I
 use a PropertyModel instead it wouldn't work as well... in both cases
 only the textField is updating my model, the radio does not.

 Thanks
 Marco

 On Tue, Aug 9, 2011 at 4:13 PM, Rodrigo Heffner
 rodrigo.heff...@gmail.com wrote:
 Please change my TextField line for

 add(TextField(number, model.bind(number)));

 Please check parenthesis as well :) I'm not working now and my IDE is not 
 open

 Sorry!

 On Tue, Aug 9, 2011 at 7:12 PM, Rodrigo Heffner
 rodrigo.heff...@gmail.com wrote:
 Hi Marco,

 I haven't tested this, but I believe this should do the trick:

 class PhoneNumber {

 String number;
 boolean default;

 /* Add getters and setters for both  */

 }

 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 CompoundPropertyModel model = new CompoundPropertyModel(phoneNumber);

 add(TextField(number), model.bind(number));

 add(Radio(default, model.bind(default)));

 }

 Let me know if this works.


 Cheers,
 Rodrigo

 On Tue, Aug 9, 2011 at 6:48 PM, Marco Aurélio Silva marc...@gmail.com 
 wrote:
 Hi All

 I'm having problems to make a radio component work the way I need.

 I have a list of PhoneNumber objects:

 class PhoneNumber {

 String number;
 boolean default;
 }

 The list can have only one entry set as default value. I'm trying to
 make the radio button set the value of default in each object, so when
 I submit the form to save the object  my model is synced with user
 changes. I don't want to set the value in the radioGroup model.

 I've created a Panel to edit a single phoneNumber object:


 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 setModel(new CompoundPropertyModel(phoneNumber));

 add(TextField(number));

 add(Radio(default));

 }


 And I'm using a repeater to add one EditPhonePanel for each phone in my 
 list.

 The number property of PhoneNumber object is being updated as
 expected, but I don't know how to make the radio button update the
 default property. Can someone help me? Thanks in advance!

 I'm using wicket 1.3.6 and java 5

 Marco Silva

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





 --
 Rodrigo H M Bezerra




 --
 Rodrigo H M Bezerra

 -
 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





-- 
Rodrigo H M Bezerra

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



Modal window issue

2011-08-09 Thread Archana
Hi All,

In my current application there is a need to open a Modal window with in a
Modal window and close the parent Modal window, once the child Modal window
opens. Currently from one page on click of a icon the Modal window 1 is
opening. Modal window 1 has few other components along with few buttons. On
click of a create button another Modal window Modal window 2 opens. 

1. The need is to close the Modal window 1 when the Modal window 2 opens.
But for Modal window 2, the parent is Modal window 1. So if I close the
Modal window 1, Modal window 2 does not open. *Is there a way by which I can
close Modal window 1, when Modal window 2 open.*

2. If I can not close the parent Modal window, I want to hide the Modal
window 1, when the Modal window 2 open. I tried the setVisible() for Modal
window 1. but it did not work. *Is there a way by which I can hide the Modal
window 1 or at least deactivate the Modal window 1, when the Modal window 2
opens.*

Both the Modal windows uses Panel. I am using wicket 1.4.

-
Thanks  Regards,
Archana
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Modal-window-issue-tp3731060p3731060.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: Modal window issue

2011-08-09 Thread Martin Makundi
You can do it with javascript.

Make a trigger that closes the modalwindow and then opens a new one by
firing a new javascript call.

Here is an example:

  final FriendlyAjaxEventBehavior ajaxEventBehavior;
  add(ajaxEventBehavior = new
FriendlyAjaxEventBehavior(JavaScriptConstants.ONCLICK) {
@Override
protected void onEvent(AjaxRequestTarget target) {
  showModalWindow(target);
}
/**
 * @see
org.apache.wicket.behavior.AbstractBehavior#isEnabled(org.apache.wicket.Component)
 */
@Override
public boolean isEnabled(Component component) {
  return super.isEnabled(component) 
(!getWorkShiftCellStateController().isInline()) 
workShiftCellStateController.getWorkShiftDayController().getWorkShiftCellDimensionController().isEditorMode()
 workShiftCellStateController.isAllowedToModify();
}
  });

And you can fire it manually:

add(fireFriendlyAjaxEventBehavior(ajaxEventBehavior));

/**
   * @param ajaxEventBehavior
   * @return GenericTailJavaScriptBehavior
   */
  public GenericTailJavaScriptBehavior fireFriendlyAjaxEventBehavior(final
FriendlyAjaxEventBehavior ajaxEventBehavior) {
try {
  return new GenericTailJavaScriptBehavior() {
/**
 * @see
com.tustor.common.wicket.behaviors.GenericTailJavaScriptBehavior#getJavaScript()
 */
@Override
public String getJavaScript() {
  return ajaxEventBehavior.getCallbackScript().toString();
}
/**
 * @see org.apache.wicket.behavior.AbstractBehavior#isTemporary()
 */
@Override
public boolean isTemporary() {
  return true;
}
  };
} finally {
  setAdded(null); // Consume it
}
  }

**
Martin

2011/8/9 Archana archanaacharya.adhik...@gmail.com

 Hi All,

 In my current application there is a need to open a Modal window with in a
 Modal window and close the parent Modal window, once the child Modal window
 opens. Currently from one page on click of a icon the Modal window 1 is
 opening. Modal window 1 has few other components along with few buttons. On
 click of a create button another Modal window Modal window 2 opens.

 1. The need is to close the Modal window 1 when the Modal window 2 opens.
 But for Modal window 2, the parent is Modal window 1. So if I close the
 Modal window 1, Modal window 2 does not open. *Is there a way by which I
 can
 close Modal window 1, when Modal window 2 open.*

 2. If I can not close the parent Modal window, I want to hide the Modal
 window 1, when the Modal window 2 open. I tried the setVisible() for Modal
 window 1. but it did not work. *Is there a way by which I can hide the
 Modal
 window 1 or at least deactivate the Modal window 1, when the Modal window 2
 opens.*

 Both the Modal windows uses Panel. I am using wicket 1.4.

 -
 Thanks  Regards,
 Archana
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Modal-window-issue-tp3731060p3731060.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: Radio with compoundPropertyModel

2011-08-09 Thread Marco Aurélio Silva
Hi Rodrigo

Thanks for your help, but that's not the point. The point is, I need a
way to make the radio work the same way textField works, for example.
I have a dynamic list of phones and I want the auto bind of
propertyModel automatically set the boolean property of my object to
true or false according to user choice.

Thank you
Marco

On Tue, Aug 9, 2011 at 4:34 PM, Rodrigo Heffner
rodrigo.heff...@gmail.com wrote:
 Hi Marco,

 I'm not sure why this is happening. I would probably add an
 AjaxFormComponentUpdatingBehavior to your radio (here is an example
 http://wicketstuff.org/wicket13/ajax/choice) and use some debug lines
 to check values. Note that your components must be inside a form
 (which I believe yours must be anyways).

 Here's how I think the code would look like:

 //let's say that modelChoices is an array of strings that contains
 default in it
 final RadioChoice radio = new RadioChoice(default,
 model.bind(default), modelChoices);
        radio.setOutputMarkupId(true);

        radio.add(new AjaxFormComponentUpdatingBehavior(onchange)
        {
            protected void onUpdate(AjaxRequestTarget target)
            {
                target.addComponent(this.getComponent());
                //debug here or add log lines to see the value of
 this.getComponent().getDefaultModelObject();
            }
        });

 Sorry this isn't a solution, but it's where I'd start looking for
 something. I'm sure someone with more experience may have a much
 better suggestion.

 On Tue, Aug 9, 2011 at 7:19 PM, Marco Aurélio Silva marc...@gmail.com wrote:
 Hi Rodrigo,

 Thanks for the fast response, but that approach didn't solve the
 problem. Actually, the problem is not the CompoundPropertyModel, if I
 use a PropertyModel instead it wouldn't work as well... in both cases
 only the textField is updating my model, the radio does not.

 Thanks
 Marco

 On Tue, Aug 9, 2011 at 4:13 PM, Rodrigo Heffner
 rodrigo.heff...@gmail.com wrote:
 Please change my TextField line for

 add(TextField(number, model.bind(number)));

 Please check parenthesis as well :) I'm not working now and my IDE is not 
 open

 Sorry!

 On Tue, Aug 9, 2011 at 7:12 PM, Rodrigo Heffner
 rodrigo.heff...@gmail.com wrote:
 Hi Marco,

 I haven't tested this, but I believe this should do the trick:

 class PhoneNumber {

 String number;
 boolean default;

 /* Add getters and setters for both  */

 }

 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 CompoundPropertyModel model = new CompoundPropertyModel(phoneNumber);

 add(TextField(number), model.bind(number));

 add(Radio(default, model.bind(default)));

 }

 Let me know if this works.


 Cheers,
 Rodrigo

 On Tue, Aug 9, 2011 at 6:48 PM, Marco Aurélio Silva marc...@gmail.com 
 wrote:
 Hi All

 I'm having problems to make a radio component work the way I need.

 I have a list of PhoneNumber objects:

 class PhoneNumber {

 String number;
 boolean default;
 }

 The list can have only one entry set as default value. I'm trying to
 make the radio button set the value of default in each object, so when
 I submit the form to save the object  my model is synced with user
 changes. I don't want to set the value in the radioGroup model.

 I've created a Panel to edit a single phoneNumber object:


 public void EditPhonePanel(String id, PhoneNumber phoneNumber) {

 setModel(new CompoundPropertyModel(phoneNumber));

 add(TextField(number));

 add(Radio(default));

 }


 And I'm using a repeater to add one EditPhonePanel for each phone in my 
 list.

 The number property of PhoneNumber object is being updated as
 expected, but I don't know how to make the radio button update the
 default property. Can someone help me? Thanks in advance!

 I'm using wicket 1.3.6 and java 5

 Marco Silva

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





 --
 Rodrigo H M Bezerra




 --
 Rodrigo H M Bezerra

 -
 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





 --
 Rodrigo H M Bezerra

 -
 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



[Ann] New Wicket stuff library for simplified ModalWindows: ModalX (1.4.x + 1.5.x)

2011-08-09 Thread Chris Colman
The open source ModalX modal window extensions framework from Visual
Classworks has just been added to wicket-stuff.
 
ModalX now comes in a version for Wicket 1.4.x and for 1.5.x.
 
Try the live demo here:
 
http://demo.visualclassworks.com/modalx/
 
Read more here:
 
http://www.visualclassworks.com/content/list/o/76914/type/modalx
 
Here's the wicketstuff wiki page:
 
https://github.com/wicketstuff/core/wiki/ModalX
 
 
 
 
Yours sincerely,
 
Chris Colman
 
Visual Classworks,
A Division of Step Ahead Software

 
 
Sydney: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 
Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au 
Website:
http://www.visualclassworks.com http://www.visualclassworks.com/ 
http://develop.stepaheadsoftware.com
blocked::http://develop.stepaheadsoftware.com/ 


SAML and Wicket

2011-08-09 Thread Chris Colman
Has anyone had any experience integrating SAML with Wicket?
 
Is it doable? Easy etc.,
 
Can it reuse wicket's inbuilt authentication/redirection mechanism?
 
Yours sincerely,
 
Chris Colman
 
Pagebloom Team Leader,
Step Ahead Software

 
pagebloom - your business  your website growing together
 
Sydney: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 
Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au 
Website:
http://www.pagebloom.com blocked::http://www.pagebloom.com/ 
http://develop.stepaheadsoftware.com
blocked::http://develop.stepaheadsoftware.com/ 
 
 


CheckGroup Model

2011-08-09 Thread delta
Hello ppl,

I have a VO named *Campo* with some attr's.

And my CheckGroup inside of a ListView:

CheckGroupCampo checkGroupCampo = new CheckGroupCampo(checkGroupCampo,
dadosCarta.getListaCampos());
checkGroupCampo.add(new 
CheckGroupSelector(groupSelectorCampos));

CamposListView listaCampos = new CamposListView(listaCampos, 
new
CamposModel(facade));
checkGroupCampo.add(listaCampos);
add(checkGroupCampo);

The CamposModel just return my FULL list to the dtmodel of the ListView.

In my ListView, I have:
protected void populateItem(final ListItemCampo item) {
Campo campo = item.getModelObject();
item.add(new CheckCampo(checkCampo, item.getModel()));
item.add(new Label(descCampo, campo.getDescCampo()));
}

In the CheckGroup constructor I'm passing *dadosCarta.getListaCampos()*,
that is the List of *Campo*. In one stage this list is empty (when I'm in a
include process), but the list can be already filled too (when I'm in a
modify process). In that second case, I want the checkboxes inside the
ListView to come already marked. Initially I thought that just passing the
ListCampo filled to the Checkgroup, as seen in my code, would make the
CheckBoxes marked, but that's not the case.

How can I do this in a elegant way? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-Model-tp3731606p3731606.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: SAML and Wicket

2011-08-09 Thread Russell Pitre
How about wicket-auth-roles + spring security + spring security SAML
extension.  The documentation looks sparse on the spring security SAML
extension, but I bet you could figure it out. Perhaps there is some sample
code in the project source that you could take a look at.  Not exactly the
response you were asking for, but a response nonetheless.  Cheers.


RE: SAML and Wicket

2011-08-09 Thread Chris Colman
No problem. We don't use Spring but you're right, we might be able to
pick up some pointers from the code.

Thanks,
Chris

-Original Message-
From: Russell Pitre [mailto:rpi...@gmail.com]
Sent: Wednesday, 10 August 2011 9:44 AM
To: users@wicket.apache.org
Subject: Re: SAML and Wicket

How about wicket-auth-roles + spring security + spring security SAML
extension.  The documentation looks sparse on the spring security SAML
extension, but I bet you could figure it out. Perhaps there is some
sample
code in the project source that you could take a look at.  Not exactly
the
response you were asking for, but a response nonetheless.  Cheers.

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



Re: [Ann] New Wicket stuff library for simplified ModalWindows: ModalX (1.4.x + 1.5.x)

2011-08-09 Thread Martin Makundi
Hi!

Is this true:

Source Code core-1.4.x Branch

Path is: 
/jdk-1.5-parent/modalx-parenthttps://github.com/wicketstuff/core/tree/core-1.4.x/jdk-1.5-parent/modalx-parent


2011/8/10 Chris Colman chr...@stepaheadsoftware.com

 ** **

 The open source ModalX modal window extensions framework from Visual
 Classworks has just been added to wicket-stuff.

 ** **

 ModalX now comes in a version for Wicket 1.4.x and for 1.5.x.

 ** **

 Try the live demo here:

 ** **

 http://demo.visualclassworks.com/modalx/

 ** **

 Read more here:

 ** **

 http://www.visualclassworks.com/content/list/o/76914/type/modalx

 ** **

 Here’s the wicketstuff wiki page:

 ** **

 https://github.com/wicketstuff/core/wiki/ModalX

 ** **

 ** **

 ** **

 ** **

 Yours sincerely,

 ** **

 Chris Colman

  

 Visual Classworks,

 A Division of Step Ahead Software

 

 ** **

 **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120
 

 Email: chr...@stepahead.com.au //chr...@stepahead.com.au

 Website:

 http://www.visualclassworks.com

 http://develop.stepaheadsoftware.com



Re: [Ann] New Wicket stuff library for simplified ModalWindows: ModalX (1.4.x + 1.5.x)

2011-08-09 Thread Martin Makundi
Ah, sorry, confused jdk-1.5 with W1.5

2011/8/10 Martin Makundi martin.maku...@koodaripalvelut.com

 Hi!

 Is this true:

 Source Code core-1.4.x Branch

 Path is: 
 /jdk-1.5-parent/modalx-parenthttps://github.com/wicketstuff/core/tree/core-1.4.x/jdk-1.5-parent/modalx-parent


 2011/8/10 Chris Colman chr...@stepaheadsoftware.com

 ** **

 The open source ModalX modal window extensions framework from Visual
 Classworks has just been added to wicket-stuff.

 ** **

 ModalX now comes in a version for Wicket 1.4.x and for 1.5.x.

 ** **

 Try the live demo here:

 ** **

 http://demo.visualclassworks.com/modalx/

 ** **

 Read more here:

 ** **

 http://www.visualclassworks.com/content/list/o/76914/type/modalx

 ** **

 Here’s the wicketstuff wiki page:

 ** **

 https://github.com/wicketstuff/core/wiki/ModalX

 ** **

 ** **

 ** **

 ** **

 Yours sincerely,

 ** **

 Chris Colman

  

 Visual Classworks,

 A Division of Step Ahead Software

 

 ** **

 **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100
 2120 

 Email: chr...@stepahead.com.au //chr...@stepahead.com.au

 Website:

 http://www.visualclassworks.com

 http://develop.stepaheadsoftware.com





how to implement a Form with Ajax Paginated List of Checkboxes?

2011-08-09 Thread bad boy
On my Wicket page, I have a form with a couple of TextFields and a paginated 
List of Checkboxes implemented with Dataview and and a sortable data provider.  
The ajax pagination of the dataview works fine.

The problem is that when I select a few items on Page 1 and then go to Page 2 
and then return to Page 1 using the AjaxPagingNavigator, the selection is lost 
: the items that were checked on Page 1 initially do no have the check mark 
anymore. 

What should I do so that the items that were selected on a page of Dataview do 
not get lost when the AjaxPagnigaion is used to traverse the pages of the 
Dataview ?



public final class AjaxFormWithPaginatedCheckBoxPage extends BasePage {

static Logger logger = 
Logger.getLogger(AjaxFormWithPaginatedCheckBoxPage.class);
private Person person = new Person();
int counter = 0;

WebMarkupContainer webMC;
static ListPerson pList=Person.getPersons(100); 
int maxListCount=5;
DataView dv;
CheckGroup group;
public AjaxFormWithPaginatedCheckBoxPage() {
    super();
    final Form form = new Form(form, new CompoundPropertyModel(person)) {

        protected void onSubmit() {
            logger.info(form recived);
            logger.info( person name  + person.getName());

            setResponsePage(new AjaxTogglePanelTestPage());
        }
    };
    final TextField name = new TextField(name);
    final TextField age = new TextField(age);
    form.add(name);
    form.add(age);


    group=new CheckGroup(group, new ArrayList());        
    form.add(group);

    webMC= new WebMarkupContainer(webMC);
    webMC.setOutputMarkupId(true);


    SortablePersonDataProvider personDataProvider=new 
SortablePersonDataProvider(pList);
    dv = new DataViewPerson(persons, personDataProvider) {

        @Override
        protected void populateItem(ItemPerson item) {
            item.add(new Check(check, item.getModel()));

            item.add(new Label(id, new PropertyModel(item.getModel(), 
id)));                
            item.add(new Label(name, new PropertyModel(item.getModel(), 
name)));                
            item.add(new Label(age, new PropertyModel(item.getModel(), 
age)));                
        }


    };
    dv.setItemsPerPage(maxListCount);


    webMC.add(new AjaxFallbackOrderByBorder(orderByID, id, 
personDataProvider)
    {
        @Override
        protected void onSortChanged()
        {
            dv.setCurrentPage(0);
        }

        @Override
        protected void onAjaxClick(AjaxRequestTarget target) {
            target.addComponent(webMC);
        }
    });

    webMC.add(new AjaxFallbackOrderByBorder(orderByName, name, 
personDataProvider)
    {
        @Override
        protected void onSortChanged()
        {
            dv.setCurrentPage(0);
        }

        @Override
        protected void onAjaxClick(AjaxRequestTarget target) {
            target.addComponent(webMC);
        }
    });
    webMC.add(new AjaxFallbackOrderByBorder(orderByAge, age, 
personDataProvider)
    {
        @Override
        protected void onSortChanged()
        {
            dv.setCurrentPage(0);
        }

        @Override
        protected void onAjaxClick(AjaxRequestTarget target) {
            target.addComponent(webMC);
        }
    });


    webMC.add(dv);        
    webMC.add(new AjaxPagingNavigator(navigator,dv));
    group.add(webMC);

    AjaxButton ab = new AjaxButton(ajax-button, new 
PropertyModelString(this,
            counter), form) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form? form) {
            counter++;
            logger.info(ajx form recived);
            logger.info(ajx person name  + person.getName());

            target.addComponent(this);

        }
    };
    form.add(ab);
    form.setDefaultButton(ab);

    add(form);        
}
}

Thanks
Badmash

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