Re: Refreshing a listview using AJAX

2008-07-29 Thread Igor Vaynberg
read the models page on the wiki, its a real eye opener

-igor

On Tue, Jul 29, 2008 at 3:04 PM, Edbay <[EMAIL PROTECTED]> wrote:
>
> Worked!!!
> Can you explain how putting the model name in quotes does the trick?
>
>
> mypage extends page{
> private string dept;
>
> public mypage() {
>  add(new dropdownchoice("id", new propertymodel(this, "dept"));
>  add(new listview("list", new propertymodel(this, "users"));
> }
>
>
> public list getusers() {
>  db.queryusers(dept);
> }
> }
> }
>
> -igor
> --
> View this message in context: 
> http://www.nabble.com/Refreshing-a-listview-using-AJAX-tp18720967p18722241.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Refreshing a listview using AJAX

2008-07-29 Thread Edbay

Only problem here is that I populate the dropdown like so:

List depts = new ArrayList ();
depts.add("A");
depts.add("B");

How do I get this list into the dropdown using the suggested code below? 


mypage extends page{
private string dept;

public mypage() {
  add(new dropdownchoice("id", new propertymodel(this, "dept"));
  add(new listview("list", new propertymodel(this, "users"));
}

public list getusers() {
  db.queryusers(dept);
}
}
}

-igor


-- 
View this message in context: 
http://www.nabble.com/Refreshing-a-listview-using-AJAX-tp18720967p18723061.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Refreshing a listview using AJAX

2008-07-29 Thread Edbay

Worked!!!
Can you explain how putting the model name in quotes does the trick?
 

mypage extends page{
private string dept;

public mypage() {
  add(new dropdownchoice("id", new propertymodel(this, "dept"));
  add(new listview("list", new propertymodel(this, "users"));
}


public list getusers() {
  db.queryusers(dept);
}
}
}

-igor
-- 
View this message in context: 
http://www.nabble.com/Refreshing-a-listview-using-AJAX-tp18720967p18722241.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Refreshing a listview using AJAX

2008-07-29 Thread Igor Vaynberg
mypage extends page{
private string dept;

public mypage() {
  add(new dropdownchoice("id", new propertymodel(this, "dept"));
  add(new listview("list", new propertymodel(this, "users"));
}


public list getusers() {
  db.queryusers(dept);
}
}
}

-igor

On Tue, Jul 29, 2008 at 1:44 PM, Edbay <[EMAIL PROTECTED]> wrote:
>
> I have a listview consisting of user info in a HTML table that I want to
> refresh when the user picks a value from a dropdownlist of department codes.
> Below is the pseudocode, cobbled together from various postings on the net.
> The code runs the first time; however, subsequent requests do not refresh
> the listview.
> What am I doing wrong? Appreciate any help.
>
>
> Java code:
>Form f = new Form("bgForm", new CompoundPropertyModel(this));
>List  depts = new ArrayList ();
>depts.add("A");
>depts.add("B");
>depts.add("C");
>model = new Model();
>DropDownChoice dd = new DropDownChoice("bgIds", model, depts);
>sectionDropDown.setRequired(true);
>f.add(dd);
>f.add(new AjaxButton("submitBG", f)
>{
>protected void onSubmit(AjaxRequestTarget target, Form 
> form)
>{
>userlist = (ArrayList) DB.getUsers("B");
>target.addComponent(bgUsers);
>});
>add(f);
>users = new WebMarkupContainer("bgUsers");
>users.setOutputMarkupId(true);
>users.setOutputMarkupPlaceholderTag(true);
>add(users);
>userlist = (ArrayList) DB.getUsers("A");
>ListView userEntries = new ListView("userEntries", userlist)
>{
>protected void populateItem(ListItem item)
>{
>item.setModel(new 
> CompoundPropertyModel(item.getModelObject()));
>item.add(new Label("last"));
>item.add(new Label("first"));
>item.add(new Label("email"));
>item.add(new Label("status"));
>}
>};
>users.add(userEntries);
>
> HTML:
> action="">
>
> id="bglabel">Users for Business
> Group
> id="busgroups">
>A
>B
>
>
>
>
>
>
>
>
>Last Name
>First Name
>Email
>Status
>
>
>Allen 
>Stephen
>[EMAIL 
> PROTECTED]
>Active
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/Refreshing-a-listview-using-AJAX-tp18720967p18720967.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Refreshing a listview using AJAX

2008-07-29 Thread Edbay

I have a listview consisting of user info in a HTML table that I want to
refresh when the user picks a value from a dropdownlist of department codes. 
Below is the pseudocode, cobbled together from various postings on the net.
The code runs the first time; however, subsequent requests do not refresh
the listview. 
What am I doing wrong? Appreciate any help.


Java code:
Form f = new Form("bgForm", new CompoundPropertyModel(this));
List  depts = new ArrayList ();
depts.add("A");
depts.add("B");
depts.add("C");
model = new Model();
DropDownChoice dd = new DropDownChoice("bgIds", model, depts);
sectionDropDown.setRequired(true);
f.add(dd);
f.add(new AjaxButton("submitBG", f) 
{
protected void onSubmit(AjaxRequestTarget target, Form 
form) 
{
userlist = (ArrayList) DB.getUsers("B");
target.addComponent(bgUsers);
});
add(f);
users = new WebMarkupContainer("bgUsers"); 
users.setOutputMarkupId(true);
users.setOutputMarkupPlaceholderTag(true);
add(users);
userlist = (ArrayList) DB.getUsers("A");
ListView userEntries = new ListView("userEntries", userlist) 
{
protected void populateItem(ListItem item) 
{
item.setModel(new 
CompoundPropertyModel(item.getModelObject()));
item.add(new Label("last"));
item.add(new Label("first"));
item.add(new Label("email"));
item.add(new Label("status"));
}
};
users.add(userEntries);

HTML:


Users 
for Business
Group

A
B








Last Name
First Name
Email
Status


Allen 
Stephen
[EMAIL 
PROTECTED]
Active






  
-- 
View this message in context: 
http://www.nabble.com/Refreshing-a-listview-using-AJAX-tp18720967p18720967.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modal window - update main page on close

2008-07-29 Thread steviezz

In my case, my ModalWindow contains a Panel. 

I have now tried passing my component WebMarkupContainer to the constructor
of the ModalWindow Panel, eg - main page code like: 


final WebMarkupContainer listContainer = new
WebMarkupContainer("theContainer");
...

final ModalWindow modalWindow = new ModalWindow("modalWindow");
...

modalWindow.setContent(new MyPanel(modalWindowWindow.getContentId(),
listContainer, modalWindow, myRecord));


Then in the MyPanel, I create a Form, add submit and cancel buttons, and
then do something like: 


private void addSaveButton(Form form, final WebMarkupContainer
listContainer, final MyRecord rec, final MySubRecord subrec) {

AjaxFallbackButton save = new AjaxFallbackButton("savebutton", 
form) {

protected void onSubmit(AjaxRequestTarget target, Form 
form) {
  // save record code 

 //try to update listContainer on main page 
  target.addComponent(listContainer);
} 
}

form.add(save);
}

Similar for the cancel button

private void addCancelButton(Form form, final WebMarkupContainer
listContainer, final ModalWindow window) {

AjaxFallbackButton cancel = new 
AjaxFallbackButton("cancelbutton", form) {

protected void onSubmit(AjaxRequestTarget target, Form 
form) {

target.addComponent(listContainer);
window.close(target);
}
};

cancel.setDefaultFormProcessing(false);
form.add(cancel);
}   


Then back in the main page, I have the callbacks for the modalwindow close
buttons, eg: 


modalWindow.setCloseButtonCallback(new 
ModalWindow.CloseButtonCallback() {
public boolean onCloseButtonClicked(AjaxRequestTarget target) {
target.addComponent(listContainer);
return true;
}
});

modalWindow.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback()
{
public void onClose(AjaxRequestTarget target) {
target.addComponent(listContainer);
}
});


This does not work for me.  If this is meant to work, then maybe I need to
look for other errors in my code.  But I'm new to Wicket, so hard to tell if
I'm trying to do something impossible or not recommended.


Steve





Vitaly Tsaplin wrote:
> 
> It depends how you create your modal window. If it contains a page
> (iframe) then passing a component belonging to a main page to a modal
> window is not a solution. At least it did not work for me. The work
> around was to either open a modal window as a panel and pass the
> component as a constructor argrument (it works fine) or to update your
> component in WindowClosedCallback as you do :)
> 
> On Tue, Jul 29, 2008 at 8:24 PM, steviezz <[EMAIL PROTECTED]>
> wrote:
>>
>> Component I want to update is in a Panel contained in the main page.  So,
>> no
>> access to this component from the cancel button on the ModalWindow.
>>
>> Should I be passing the Panel to the ModalWindow in the constructor so I
>> can
>> access its components?
>>
>>
>> Steve
>>
>>
>>
>>
>>
>>
>> damnitjim wrote:
>>>
>>> Have you tried adding target.addComponent() call in the CancelButton
>>> submit
>>> ?
>>>
>>> On Mon, Jul 28, 2008 at 4:19 PM, steve222 <[EMAIL PROTECTED]>
>>> wrote:
>>>

 Hi. Using Wicket 1.3.4.

 I have a main page with a panel.  Page contains a form for editing a
 main
 record.  Panel contains a DataView containing a list of related sub
 records.
 In the java code for the pabel, create a ModalWindow and pop this for
 adding
 more sub-records.  Uses AJAX.

 Got this working OK similar to:


 Main page code:


public MainRecordEdit(PageParameters p) {

Integer id = p.getInt("mainRecord");

// uses application scope Spring bean to get record from
 database
final MyRecord myRecord =
 getRecordManager().findById(id);

...
// stuff form main record CRUD on main page
...


// add the panel for the sub records
add(new MyListingPanel("myListingPanel", myRecord));

}



 Panel code for sub records:

public MyListingPanel(String id, final MyRecord myRecord) {

super(id);

Collection mySubs = myRecord.getSubRecords();

DataView dataView = new D

Re: RadioGroup, Radio with AjaxEventBehavior not updating form model

2008-07-29 Thread nanotech

Actually the exception that I am getting is :

Attempted to set property value on a null object. Property expression:
dropdown_2_Input Value: >


final DropDownChoice dropdown_2= new DropDownChoice("dropdown_2_Input",
dropDown_List){
public boolean isRequired()
{
return securityTypeRadio.isEnabled();
}

 };
dropdown_2.setOutputMarkupId(true);

Note: Dropdown 2 is diabled onload.



nanotech wrote:
> 
> Hi ,
> 
> I am trying to add Ajax Behaviour to Radio (in a radioGroup)
> 
> RadioGroup has radio_1 and radio_2
> radio_1 controls Dropdown_1 (i.e when radio_1 is checked then Dropdown_1
> is enabled and Dropdown_2 is disabled--its all working fine and good)
> radio_2 controls Dropdown_2 (i.e when radio_2 is checked then Dropdown_2
> is enabled and Dropdown_1 is disabled --its all working fine and good)
> 
> At setup time radio_1 is selected  and Dropdown_1 is enabled.
> 
> If I submit the form like this then I get the value in the form that I am
> submitting.
> But, if I change the radio_selected to radio_2 and then submit the form
> then the value getting set is NULL.
> 
> Question:
> How can I make sure that on changing radio appropriate form's model is
> updated? What am I missing?
> 
> //Here is some code
> // Keep the Model of radio group and first radio same. to pre-select it
> final RadioGroup group = new RadioGroup("group", this.getModel());
> // All the radio Buttons
> final Radio radio_1 = new Radio("radio_1", this.getModel());
> final Radio radio_2 = new Radio("radio_2",new Model("abc"));
> 
>   group.add(radio_1);
>   group.add(radio_2);
> 
>   radio_1.add(new AjaxEventBehavior("onClick")
>   {
>   private static final long serialVersionUID = 1L;
>   @Override
>   protected void onEvent(AjaxRequestTarget target)
>   {
>   group.processInput();
>   
>   dropdpwn_1.setEnabled(true);
>   dropdpwn_2.setEnabled(false);
> 
>   if (target != null)
>   {
>   target.addComponent(dropdpwn_1);
>   target.addComponent(dropdpwn_2);
>   }
>   }
>   });
> 
>   radio_2.add(new AjaxEventBehavior("onClick")
>   {
>   private static final long serialVersionUID = 1L;
> 
>   @Override
>   protected void onEvent(AjaxRequestTarget target)
>   {
>   group.processInput();
> 
>   dropdpwn_1.setEnabled(false);
>   dropdpwn_2.setEnabled(true);
> 
>   if (target != null)
>   {
>   target.addComponent(dropdpwn_1);
>   target.addComponent(dropdpwn_2);
>   }
>   }
>   });
> 

-- 
View this message in context: 
http://www.nabble.com/RadioGroup%2C-Radio-with-AjaxEventBehavior-not-updating-form-model-tp18720051p18720616.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RadioGroup, Radio with AjaxEventBehavior not updating form model

2008-07-29 Thread nanotech

Hi ,

I am trying to add Ajax Behaviour to Radio (in a radioGroup)

RadioGroup has radio_1 and radio_2
radio_1 controls Dropdown_1 (i.e when radio_1 is checked then Dropdown_1 is
enabled and Dropdown_2 is disabled--its all working fine and good)
radio_2 controls Dropdown_2 (i.e when radio_2 is checked then Dropdown_2 is
enabled and Dropdown_1 is disabled --its all working fine and good)

At setup time radio_1 is selected  and Dropdown_1 is enabled.

If I submit the form like this then I get the value in the form that I am
submitting.
But, if I change the radio_selected to radio_2 and then submit the form then
the value getting set is NULL.

Question:
How can I make sure that on changing radio appropriate form's model is
updated? What am I missing?

//Here is some code
// Keep the Model of radio group and first radio same. to pre-select it
final RadioGroup group = new RadioGroup("group", this.getModel());
// All the radio Buttons
final Radio radio_1 = new Radio("radio_1", this.getModel());
final Radio radio_2 = new Radio("radio_2",new Model("abc"));

group.add(radio_1);
group.add(radio_2);

radio_1.add(new AjaxEventBehavior("onClick")
{
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target)
{
group.processInput();

dropdpwn_1.setEnabled(true);
dropdpwn_2.setEnabled(false);

if (target != null)
{
target.addComponent(dropdpwn_1);
target.addComponent(dropdpwn_2);
}
}
});

radio_2.add(new AjaxEventBehavior("onClick")
{
private static final long serialVersionUID = 1L;

@Override
protected void onEvent(AjaxRequestTarget target)
{
group.processInput();

dropdpwn_1.setEnabled(false);
dropdpwn_2.setEnabled(true);

if (target != null)
{
target.addComponent(dropdpwn_1);
target.addComponent(dropdpwn_2);
}
}
});
-- 
View this message in context: 
http://www.nabble.com/RadioGroup%2C-Radio-with-AjaxEventBehavior-not-updating-form-model-tp18720051p18720051.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modal window - update main page on close

2008-07-29 Thread Vitaly Tsaplin
It depends how you create your modal window. If it contains a page
(iframe) then passing a component belonging to a main page to a modal
window is not a solution. At least it did not work for me. The work
around was to either open a modal window as a panel and pass the
component as a constructor argrument (it works fine) or to update your
component in WindowClosedCallback as you do :)

On Tue, Jul 29, 2008 at 8:24 PM, steviezz <[EMAIL PROTECTED]> wrote:
>
> Component I want to update is in a Panel contained in the main page.  So, no
> access to this component from the cancel button on the ModalWindow.
>
> Should I be passing the Panel to the ModalWindow in the constructor so I can
> access its components?
>
>
> Steve
>
>
>
>
>
>
> damnitjim wrote:
>>
>> Have you tried adding target.addComponent() call in the CancelButton
>> submit
>> ?
>>
>> On Mon, Jul 28, 2008 at 4:19 PM, steve222 <[EMAIL PROTECTED]>
>> wrote:
>>
>>>
>>> Hi. Using Wicket 1.3.4.
>>>
>>> I have a main page with a panel.  Page contains a form for editing a main
>>> record.  Panel contains a DataView containing a list of related sub
>>> records.
>>> In the java code for the pabel, create a ModalWindow and pop this for
>>> adding
>>> more sub-records.  Uses AJAX.
>>>
>>> Got this working OK similar to:
>>>
>>>
>>> Main page code:
>>>
>>>
>>>public MainRecordEdit(PageParameters p) {
>>>
>>>Integer id = p.getInt("mainRecord");
>>>
>>>// uses application scope Spring bean to get record from
>>> database
>>>final MyRecord myRecord = getRecordManager().findById(id);
>>>
>>>...
>>>// stuff form main record CRUD on main page
>>>...
>>>
>>>
>>>// add the panel for the sub records
>>>add(new MyListingPanel("myListingPanel", myRecord));
>>>
>>>}
>>>
>>>
>>>
>>> Panel code for sub records:
>>>
>>>public MyListingPanel(String id, final MyRecord myRecord) {
>>>
>>>super(id);
>>>
>>>Collection mySubs = myRecord.getSubRecords();
>>>
>>>DataView dataView = new DataView("dataView", new
>>> ListDataProvider(new
>>> ArrayList(mySubs))) {
>>>
>>>public void populateItem(final Item item) {
>>>final MySub ms = (MyRecord) item.getModelObject();
>>>item.add(new Label("id", ms.getId()));
>>>...
>>>}
>>>};
>>>
>>>final WebMarkupContainer listContainer = new
>>> WebMarkupContainer("theContainer");
>>>
>>>listContainer.setOutputMarkupId(true);
>>>listContainer.add(dataView);
>>>
>>>   ...
>>>
>>>   payawayWindow.setWindowClosedCallback(new
>>> ModalWindow.WindowClosedCallback() {
>>>public void onClose(AjaxRequestTarget target) {
>>>
>>>// not sure what to put here to refresh the list
>>> in
>>> dataview
>>>
>>>target.addComponent(listContainer);
>>>}
>>>});
>>>
>>>
>>>   final ModalWindow modalWindow = new ModalWindow("modalWindow");
>>>   modalWindow.setOutputMarkupId(true);
>>>   add(modalWindow);
>>>
>>>   add(new AjaxLink("modalLink") {
>>>   public void onClick(AjaxRequestTarget target) {
>>>modalWindowshow(target);
>>>}
>>>});
>>>
>>>
>>> In the jave code for the Modal window - also a Panel - I do normal CRUD
>>> stuff via AJAX with feedback going into a FeedbackPanel on the modal
>>> window
>>> panel when I save (or hit validation errors).  No problems here - my AJAX
>>> updates work OK.
>>>
>>> I close the popup panel using a button:
>>>
>>>   private void addCancelButton(Form form, final ModalWindow
>>> window) {
>>>
>>>AjaxFallbackButton cancel = new
>>> AjaxFallbackButton("cancelbutton", form)
>>> {
>>>
>>>@Override
>>>protected void onSubmit(AjaxRequestTarget
>>> target, Form form) {
>>>
>>>// not sure if I need to do
>>> anything
>>> here to make the new
>>>// sub record appear on main page
>>> when I close this window
>>>
>>>info("Cancel was pressed!");
>>>window.close(target);
>>>}
>>>};
>>>
>>>cancel.setDefaultFormProcessing(false);
>>>form.add(cancel);
>>>}
>>>
>>>
>>> Window closes.  Main page does not show new sub record in the DataView on
>>> the main Panel.
>>>
>>> Page refresh reloads the list OK.
>>>
>>> Thanks.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Modal-window---update-main-page-on-close-tp18701883p187

Re: @SpringBean and serialization

2008-07-29 Thread lars vonk
Hi Gerald,

Don't forget Findbugs is a static code analysis tool, so it can't
figure out everything. To get rid of these (false) warnings you could
for instance disable these specific warnings in FindBugs for wicket
classes that are injected by Spring using FindBugs filters. See
http://findbugs.sourceforge.net/manual/filter.html on how to do that.

BTW: The wicket docs about spring clearly explains the serialization
problem: http://cwiki.apache.org/WICKET/spring.html

-- Lars



On Tue, Jul 29, 2008 at 5:10 PM, Gerald Reinhart <[EMAIL PROTECTED]> wrote:
>
> We use Findbugs on our build process, with this
>
>  @SpringBean(name = "mySpringBean")
>   private MyPOJO config;
>
> Findbugs Warning :
>
>  Class com...MyPage defines non-transient non-serializable instance
> field config Bug type SE_BAD_FIELD (click for details)
> In class com...MyPage Field com...MyPage.config In MyPage.java
>
> SE_BAD_FIELD: Non-transient non-serializable instance field in serializable
> class
> This Serializable class defines a non-primitive instance field which is
> neither transient, Serializable, or java.lang.Object, and does not appear to
> implement the Externalizable interface or the readObject() and writeObject()
> methods.  Objects of this class will not be deserialized correctly if a
> non-Serializable object is stored in this field.
>
> So we set the field transient
>
>  @SpringBean(name = "mySpringBean")
>   transient MyPOJO config;
>
> So that Findbugs didn't complain... that the reason why we decided to
> develop this Helper to set SpringBean in the readObject() method. Perhaps we
> won't do all that is the documentation tell explicitly that we didn't have
> to take care of the deserialization of SpringBean (as
> SpringComponentInjector inject Serializable proxies)
>
> Regards,
>
>
> Gerald Reinhart
>
>
> --
> View this message in context: 
> http://www.nabble.com/%40SpringBean-and-serialization-tp15330505p18714397.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modal window - update main page on close

2008-07-29 Thread steviezz

Component I want to update is in a Panel contained in the main page.  So, no
access to this component from the cancel button on the ModalWindow. 

Should I be passing the Panel to the ModalWindow in the constructor so I can
access its components?


Steve






damnitjim wrote:
> 
> Have you tried adding target.addComponent() call in the CancelButton
> submit
> ?
> 
> On Mon, Jul 28, 2008 at 4:19 PM, steve222 <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Hi. Using Wicket 1.3.4.
>>
>> I have a main page with a panel.  Page contains a form for editing a main
>> record.  Panel contains a DataView containing a list of related sub
>> records.
>> In the java code for the pabel, create a ModalWindow and pop this for
>> adding
>> more sub-records.  Uses AJAX.
>>
>> Got this working OK similar to:
>>
>>
>> Main page code:
>>
>>
>>public MainRecordEdit(PageParameters p) {
>>
>>Integer id = p.getInt("mainRecord");
>>
>>// uses application scope Spring bean to get record from
>> database
>>final MyRecord myRecord = getRecordManager().findById(id);
>>
>>...
>>// stuff form main record CRUD on main page
>>...
>>
>>
>>// add the panel for the sub records
>>add(new MyListingPanel("myListingPanel", myRecord));
>>
>>}
>>
>>
>>
>> Panel code for sub records:
>>
>>public MyListingPanel(String id, final MyRecord myRecord) {
>>
>>super(id);
>>
>>Collection mySubs = myRecord.getSubRecords();
>>
>>DataView dataView = new DataView("dataView", new
>> ListDataProvider(new
>> ArrayList(mySubs))) {
>>
>>public void populateItem(final Item item) {
>>final MySub ms = (MyRecord) item.getModelObject();
>>item.add(new Label("id", ms.getId()));
>>...
>>}
>>};
>>
>>final WebMarkupContainer listContainer = new
>> WebMarkupContainer("theContainer");
>>
>>listContainer.setOutputMarkupId(true);
>>listContainer.add(dataView);
>>
>>   ...
>>
>>   payawayWindow.setWindowClosedCallback(new
>> ModalWindow.WindowClosedCallback() {
>>public void onClose(AjaxRequestTarget target) {
>>
>>// not sure what to put here to refresh the list
>> in
>> dataview
>>
>>target.addComponent(listContainer);
>>}
>>});
>>
>>
>>   final ModalWindow modalWindow = new ModalWindow("modalWindow");
>>   modalWindow.setOutputMarkupId(true);
>>   add(modalWindow);
>>
>>   add(new AjaxLink("modalLink") {
>>   public void onClick(AjaxRequestTarget target) {
>>modalWindowshow(target);
>>}
>>});
>>
>>
>> In the jave code for the Modal window - also a Panel - I do normal CRUD
>> stuff via AJAX with feedback going into a FeedbackPanel on the modal
>> window
>> panel when I save (or hit validation errors).  No problems here - my AJAX
>> updates work OK.
>>
>> I close the popup panel using a button:
>>
>>   private void addCancelButton(Form form, final ModalWindow
>> window) {
>>
>>AjaxFallbackButton cancel = new
>> AjaxFallbackButton("cancelbutton", form)
>> {
>>
>>@Override
>>protected void onSubmit(AjaxRequestTarget
>> target, Form form) {
>>
>>// not sure if I need to do
>> anything
>> here to make the new
>>// sub record appear on main page
>> when I close this window
>>
>>info("Cancel was pressed!");
>>window.close(target);
>>}
>>};
>>
>>cancel.setDefaultFormProcessing(false);
>>form.add(cancel);
>>}
>>
>>
>> Window closes.  Main page does not show new sub record in the DataView on
>> the main Panel.
>>
>> Page refresh reloads the list OK.
>>
>> Thanks.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Modal-window---update-main-page-on-close-tp18701883p18701883.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Modal-window---update-main-page-on-close-tp18701883p18718430.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AuthenticatedWebApplication Problem

2008-07-29 Thread trames

Yes, there was an index.jsp in the root context.  I removed this, and it will
now work with

  
myapp
/*
 

This seems like a rather obscure problem.  Is this documented somewhere or
can it be fixed so others won't have to spend time on it.  I spend two days
trying to figure out what was wrong.


As far as Maurice's question, I saw the  continueToOriginalDestination()
method buried in the SignInPanel.java source.  So yes it is being used.  I
am using the stock code for this panel, and am not sure how to get the url
at that point in the stack.


Thanks to all for helping with this problem
--Tim




Martijn Dashorst wrote:
> 
> do you have an index.jsp in your root context? If so, remove that and try
> again.
> 
> Martijn
> 
> On Mon, Jul 28, 2008 at 5:24 PM, Ames, Tim <[EMAIL PROTECTED]> wrote:
>> Using wicket 1.3.4 - production/stable version
>>
>>
>>
>> I am testing AuthenticatedWebApplication and AuthenticatedWebSession set
>> up similar to the wicket-examples.
>>
>>
>>
>> I have the @AuthorizationInstantiation annotation set up on the home
>> page.
>>
>>
>>
>> I start up a session using the address:  http://localhost:8080/MyApp/
>>
>>
>>
>> As expected, the Sign In page shows with an address of:
>> http://localhost:8080/MyApp/?wicket:bookmarkablePage=:org.apache.wicket.
>> authentication.pages.SignInPage
>>
>> I log in, the user and password are valid, and I click Sign In.
>>
>>
>>
>> At this point is where the problem occurs.  I loose the context "MyApp"
>> in the address.  The address now shows: http://localhost:8080/index.jsp
>>
>>
>>
>>
>>
>> Thanks for any insight.
>>
>> --Tim
>>
>>
>>
>>
> -- 
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/AuthenticatedWebApplication-Problem-tp18692918p18717912.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE 7 form submission issue - SOLVED

2008-07-29 Thread Ritesh Trivedi

I put some debug statements in Form.java onFormSubmit(), figured out what the
issues was.

Not sure if it needs to be fixed in Wicket code, but here is the
explanation...

The page has a root form and multiple panels each with its own form. One of
the panels has fragment inside which it has a submitting button with image.
I used   as markup for that and corresponding
java code was new Button.add(new Image). Seems like findSubmittingButton in
Form.java returns this as a button submitted instead of the root form submit
button which was pressed, causing call to onsubmit etc of incorrect button,
thats why I didnt see the oonsubmit of the root form or the button.


igor.vaynberg wrote:
> 
> what do you expect the response to be? you have shown no code or
> anything for us to go on...
> 
> create a jira issue and attach a quickstart to it.
> 
> -igor
> 
> On Tue, Jul 29, 2008 at 8:53 AM, Ritesh Trivedi
> <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> No responses yet - anyone pointers on debugging the issue?
>>
>>
>> Ritesh Trivedi wrote:
>>>
>>> Hi,
>>>
>>> I am observing really weird behavior in IE7. I have nested forms on a
>>> page
>>> and a submit button on the outer most form (root form). In FF2 and FF3
>>> when I click submit button (input type="submit") it works fine, the form
>>> gets submitted and I see validation errors. But in IE, I dont see any
>>> validation errors. I am using plain required fields - no complicated
>>> validation. Seems like it doesnt even matter if I change the default
>>> form
>>> processing to false, neither buttons nor forms onsubmit() is getting
>>> called. But the URL is changing.
>>>
>>> Will appreciate any pointers.
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/IE-7-form-submission-issue-tp18703523p18715311.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IE-7-form-submission-issue-tp18703523p18717678.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: YUI DatePicker: JavaScript errors if parent container is not visible

2008-07-29 Thread nate roe
I confirmed that this problem occurs on the trunk, and I filed JIRA
#1762: https://issues.apache.org/jira/browse/WICKET-1762

Thanks, Igor.

- Nate

On Mon, Jul 28, 2008 at 4:54 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> please check with latest trunk, if it still happens open a jira issue
> and attach a quickstart.
>
> -igor
>
> On Mon, Jul 28, 2008 at 4:32 PM, nate roe <[EMAIL PROTECTED]> wrote:
>> I'm using Wicket 1.3.3.
>>
>> If I add a DatePicker to a DateTextField that I in turn add to a
>> WebMarkupContainer, and that WebMarkupContainer is hidden, a
>> JavaScript error occurs.  It looks like the header contributor for the
>> DatePicker is still rendered to the page despite the fact that its
>> markup is hidden.  The JavaScript error occurs where the
>> header-contributed JavaScript refers to the (now non-existent)
>> DatePicker object.
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE 7 form submission issue

2008-07-29 Thread Igor Vaynberg
what do you expect the response to be? you have shown no code or
anything for us to go on...

create a jira issue and attach a quickstart to it.

-igor

On Tue, Jul 29, 2008 at 8:53 AM, Ritesh Trivedi
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> No responses yet - anyone pointers on debugging the issue?
>
>
> Ritesh Trivedi wrote:
>>
>> Hi,
>>
>> I am observing really weird behavior in IE7. I have nested forms on a page
>> and a submit button on the outer most form (root form). In FF2 and FF3
>> when I click submit button (input type="submit") it works fine, the form
>> gets submitted and I see validation errors. But in IE, I dont see any
>> validation errors. I am using plain required fields - no complicated
>> validation. Seems like it doesnt even matter if I change the default form
>> processing to false, neither buttons nor forms onsubmit() is getting
>> called. But the URL is changing.
>>
>> Will appreciate any pointers.
>>
>
> --
> View this message in context: 
> http://www.nabble.com/IE-7-form-submission-issue-tp18703523p18715311.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to update custom Panel via AJAX

2008-07-29 Thread Ryan O'Hara
Thank you, Marijn.  I've actually looked over the model page a few  
times in the past.  I guess I just don't have a full handle on  
models, in general.  Using the LoadableDetachableModel did resolve my  
problem - thanks!  Below are the working code snippets:


public Gbrowse(String id, String position, String[] sources) {
super(id);
setPosition(position);
setSources(sources);
Label label = new Label("gbrowse", new  
LoadableDetachableModel() {

@Override
protected Object load() {
return getGbrowse(getPosition(), getSources());
}
});
label.setEscapeModelStrings(false);
add(label);
}

gbrowse = new Gbrowse("gbrowse", getPosition(), new String[] 
{"CHOPCNVs", "CHOPCNVRs", "CHOPCNVBlocks"});

gbrowse.setOutputMarkupId(true);
form.add(gbrowse);
...

//submit button
AjaxSubmitLink asl = new AjaxSubmitLink("submit") {
public void onSubmit(AjaxRequestTarget target, Form form) {
try {
gbrowse.setPosition(position);
target.addComponent(gbrowse);
...

I'd like for the position to automatically get updated, instead of  
having to call setPosition().  I feel like this can be accomplished  
using LoadableDetachableModel, as well.  I tried replacing getPosition 
() with a LoadableDetachableModel that returns getPosition() in the  
load() method during the instantiation of Gbrowse, but it looks to  
always be null.  I'm happy to have it working, but I'd like to use  
the LDM if that's that way to go.  Any advice?  Thanks, again.


Ryan

On Jul 29, 2008, at 11:43 AM, Martijn Dashorst wrote:

Read this page: http://cwiki.apache.org/WICKET/working-with-wicket- 
models.html


And after that:

public Gbrowse(String id, final String position, final String[]  
sources) {

   super(id);
   Label label = new Label("gbrowse", new
LoadableDetachableModel() { @Override Object load() { return
getGbrowse(position,sources); });
   label.setEscapeModelStrings(false);
   add(label);
   }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IE 7 form submission issue

2008-07-29 Thread Ritesh Trivedi

Hi,

No responses yet - anyone pointers on debugging the issue?


Ritesh Trivedi wrote:
> 
> Hi,
> 
> I am observing really weird behavior in IE7. I have nested forms on a page
> and a submit button on the outer most form (root form). In FF2 and FF3
> when I click submit button (input type="submit") it works fine, the form
> gets submitted and I see validation errors. But in IE, I dont see any
> validation errors. I am using plain required fields - no complicated
> validation. Seems like it doesnt even matter if I change the default form
> processing to false, neither buttons nor forms onsubmit() is getting
> called. But the URL is changing.
> 
> Will appreciate any pointers.
> 

-- 
View this message in context: 
http://www.nabble.com/IE-7-form-submission-issue-tp18703523p18715311.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modal window - update main page on close

2008-07-29 Thread damnitjim
Have you tried adding target.addComponent() call in the CancelButton submit
?

On Mon, Jul 28, 2008 at 4:19 PM, steve222 <[EMAIL PROTECTED]> wrote:

>
> Hi. Using Wicket 1.3.4.
>
> I have a main page with a panel.  Page contains a form for editing a main
> record.  Panel contains a DataView containing a list of related sub
> records.
> In the java code for the pabel, create a ModalWindow and pop this for
> adding
> more sub-records.  Uses AJAX.
>
> Got this working OK similar to:
>
>
> Main page code:
>
>
>public MainRecordEdit(PageParameters p) {
>
>Integer id = p.getInt("mainRecord");
>
>// uses application scope Spring bean to get record from
> database
>final MyRecord myRecord = getRecordManager().findById(id);
>
>...
>// stuff form main record CRUD on main page
>...
>
>
>// add the panel for the sub records
>add(new MyListingPanel("myListingPanel", myRecord));
>
>}
>
>
>
> Panel code for sub records:
>
>public MyListingPanel(String id, final MyRecord myRecord) {
>
>super(id);
>
>Collection mySubs = myRecord.getSubRecords();
>
>DataView dataView = new DataView("dataView", new
> ListDataProvider(new
> ArrayList(mySubs))) {
>
>public void populateItem(final Item item) {
>final MySub ms = (MyRecord) item.getModelObject();
>item.add(new Label("id", ms.getId()));
>...
>}
>};
>
>final WebMarkupContainer listContainer = new
> WebMarkupContainer("theContainer");
>
>listContainer.setOutputMarkupId(true);
>listContainer.add(dataView);
>
>   ...
>
>   payawayWindow.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback() {
>public void onClose(AjaxRequestTarget target) {
>
>// not sure what to put here to refresh the list in
> dataview
>
>target.addComponent(listContainer);
>}
>});
>
>
>   final ModalWindow modalWindow = new ModalWindow("modalWindow");
>   modalWindow.setOutputMarkupId(true);
>   add(modalWindow);
>
>   add(new AjaxLink("modalLink") {
>   public void onClick(AjaxRequestTarget target) {
>modalWindowshow(target);
>}
>});
>
>
> In the jave code for the Modal window - also a Panel - I do normal CRUD
> stuff via AJAX with feedback going into a FeedbackPanel on the modal window
> panel when I save (or hit validation errors).  No problems here - my AJAX
> updates work OK.
>
> I close the popup panel using a button:
>
>   private void addCancelButton(Form form, final ModalWindow
> window) {
>
>AjaxFallbackButton cancel = new
> AjaxFallbackButton("cancelbutton", form)
> {
>
>@Override
>protected void onSubmit(AjaxRequestTarget
> target, Form form) {
>
>// not sure if I need to do anything
> here to make the new
>// sub record appear on main page
> when I close this window
>
>info("Cancel was pressed!");
>window.close(target);
>}
>};
>
>cancel.setDefaultFormProcessing(false);
>form.add(cancel);
>}
>
>
> Window closes.  Main page does not show new sub record in the DataView on
> the main Panel.
>
> Page refresh reloads the list OK.
>
> Thanks.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Modal-window---update-main-page-on-close-tp18701883p18701883.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: How to update custom Panel via AJAX

2008-07-29 Thread Martijn Dashorst
Read this page: http://cwiki.apache.org/WICKET/working-with-wicket-models.html

And after that:

public Gbrowse(String id, final String position, final String[] sources) {
   super(id);
   Label label = new Label("gbrowse", new
LoadableDetachableModel() { @Override Object load() { return
getGbrowse(position,sources); });
   label.setEscapeModelStrings(false);
   add(label);
   }


On Tue, Jul 29, 2008 at 4:57 PM, Ryan O'Hara
<[EMAIL PROTECTED]> wrote:
> I have a custon class extending Panel.  The constructor accepts two
> parameters which are passed to another method that sets the content of the
> label.  I have been able to get the initial loading of the custom Panel to
> work, but it doesn't seem to be updating via AJAX.  Below is some of the
> code to help you better understand what I'm dealing with:
>
> public Gbrowse(String id, String position, String[] sources) {
>super(id);
>Label label = new Label("gbrowse", getGbrowse(position,sources));
>label.setEscapeModelStrings(false);
>add(label);
>}
>
>
> Page using Gbrowse:
>
> gbrowse = new Gbrowse("gbrowse", position, new String
> []{"CHOPCNVs","CHOPCNVRs","CHOPCNVBlocks"});
>gbrowse.setOutputMarkupId(true);
>form.add(gbrowse);
>
>//submit button
>AjaxSubmitLink asl = new AjaxSubmitLink("submit") {
>public void onSubmit(AjaxRequestTarget target, Form form) {
>try {
>target.addComponent(gbrowse);
>...
>
>
> Thanks for the help.
>
> Ryan
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: @SpringBean and serialization

2008-07-29 Thread Igor Vaynberg
so you decrease the efficiency of your application so that your static
analysis tool stops reporting false positives?

-igor

On Tue, Jul 29, 2008 at 8:10 AM, Gerald Reinhart <[EMAIL PROTECTED]> wrote:
>
> We use Findbugs on our build process, with this
>
>  @SpringBean(name = "mySpringBean")
>   private MyPOJO config;
>
> Findbugs Warning :
>
>  Class com...MyPage defines non-transient non-serializable instance
> field config Bug type SE_BAD_FIELD (click for details)
> In class com...MyPage Field com...MyPage.config In MyPage.java
>
> SE_BAD_FIELD: Non-transient non-serializable instance field in serializable
> class
> This Serializable class defines a non-primitive instance field which is
> neither transient, Serializable, or java.lang.Object, and does not appear to
> implement the Externalizable interface or the readObject() and writeObject()
> methods.  Objects of this class will not be deserialized correctly if a
> non-Serializable object is stored in this field.
>
> So we set the field transient
>
>  @SpringBean(name = "mySpringBean")
>   transient MyPOJO config;
>
> So that Findbugs didn't complain... that the reason why we decided to
> develop this Helper to set SpringBean in the readObject() method. Perhaps we
> won't do all that is the documentation tell explicitly that we didn't have
> to take care of the deserialization of SpringBean (as
> SpringComponentInjector inject Serializable proxies)
>
> Regards,
>
>
> Gerald Reinhart
>
>
> --
> View this message in context: 
> http://www.nabble.com/%40SpringBean-and-serialization-tp15330505p18714397.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: @SpringBean and serialization

2008-07-29 Thread Gerald Reinhart

We use Findbugs on our build process, with this

  @SpringBean(name = "mySpringBean")
   private MyPOJO config; 

Findbugs Warning : 

 Class com...MyPage defines non-transient non-serializable instance
field config Bug type SE_BAD_FIELD (click for details) 
In class com...MyPage Field com...MyPage.config In MyPage.java

SE_BAD_FIELD: Non-transient non-serializable instance field in serializable
class 
This Serializable class defines a non-primitive instance field which is
neither transient, Serializable, or java.lang.Object, and does not appear to
implement the Externalizable interface or the readObject() and writeObject()
methods.  Objects of this class will not be deserialized correctly if a
non-Serializable object is stored in this field.

So we set the field transient 

  @SpringBean(name = "mySpringBean")
   transient MyPOJO config; 

So that Findbugs didn't complain... that the reason why we decided to
develop this Helper to set SpringBean in the readObject() method. Perhaps we
won't do all that is the documentation tell explicitly that we didn't have
to take care of the deserialization of SpringBean (as
SpringComponentInjector inject Serializable proxies)

Regards,


Gerald Reinhart 


-- 
View this message in context: 
http://www.nabble.com/%40SpringBean-and-serialization-tp15330505p18714397.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to update custom Panel via AJAX

2008-07-29 Thread Ryan O'Hara
I have a custon class extending Panel.  The constructor accepts two  
parameters which are passed to another method that sets the content  
of the label.  I have been able to get the initial loading of the  
custom Panel to work, but it doesn't seem to be updating via AJAX.   
Below is some of the code to help you better understand what I'm  
dealing with:


public Gbrowse(String id, String position, String[] sources) {
super(id);
Label label = new Label("gbrowse", getGbrowse 
(position,sources));

label.setEscapeModelStrings(false);
add(label);
}


Page using Gbrowse:

gbrowse = new Gbrowse("gbrowse", position, new String [] 
{"CHOPCNVs","CHOPCNVRs","CHOPCNVBlocks"});

gbrowse.setOutputMarkupId(true);
form.add(gbrowse);

//submit button
AjaxSubmitLink asl = new AjaxSubmitLink("submit") {
public void onSubmit(AjaxRequestTarget target, Form form) {
try {
target.addComponent(gbrowse);
...


Thanks for the help.

Ryan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: @SpringBean and serialization

2008-07-29 Thread Igor Vaynberg
On Tue, Jul 29, 2008 at 1:11 AM, Gerald Reinhart <[EMAIL PROTECTED]> wrote:
>
>
> jwcarman wrote:
>>
>> Why are you doing this again?  @SpringBean already takes care of
>> re-establishing the connection upon deserialization.
>>
>
> Are you sure ?

read the spring page on the wiki

-igor

>
>
> Sebastiaan van Erk wrote:
>>
>> The myService field is filled with a proxy to the service which is
>> serializable and can look up
>> the service again if it is lost (due to a serialize/deserialize cycle of
>> the component). The proxy is injected on instantiation of the component
>> and NOT on deserialization (see also IComponentInstantiationListener).
>>
>> Marking it transient will not work because after deserialize the
>> myService field will be null, calling all subsequent calls to the
>> service to fail with a NullPointerException.
>>
>
> --
> View this message in context: 
> http://www.nabble.com/%40SpringBean-and-serialization-tp15330505p18707368.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the remote address (IP)

2008-07-29 Thread Brill Pappin

That's an unpopulated (not localhost) ipv6 address.

- Brill

On 29-Jul-08, at 6:35 AM, Kaspar Fischer wrote:


I try to obtain the client's remote address from the session:

 WebClientInfo info = (WebClientInfo) session.getClientInfo();
 final String remoteAddress = info.getProperties().getRemoteAddress();

This results in "0:0:0:0:0:0:0:1%0". Any idea what might be wrong?
Thanks a lot, Kaspar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Size() is invoked twice

2008-07-29 Thread Rik van der Kleij
Hi,

During performance tuning of a data table I noticed that size() of data
provider is invoked twice during one request. This happens when navigating
to a next page. Is this normal behavior? During debugging I noticed that the
onDetach() of AbstractPageableView is invoked an extra time.


Regards,
Rik


Re: passing objects between pages

2008-07-29 Thread Ricky
Hey,

so you've got a class CreateUser which is a factory that creates an Edit
Page? The name would be misleading i think. You could have something like
PageFactory, CONTANER extends MarkupContainer, MODEL
extends IModel> (i kept capture (?) just as an example)  and throw in a
create method in there which is something like : createPage(final MODEL
model) { }.

But I am thinking that Wicket's idea was not to manage the life cycle of
objects to keep it simpler; otherwise its very easy to become Dependency
Injection type container to provide for things like above.

Just a thought, only Igor can verify that info, i could be plain wrong.

Regards,
Rick

On Tue, Jul 29, 2008 at 12:49 AM, Jeremy Thomerson <
[EMAIL PROTECTED]> wrote:

> As far as the constructor problem is concerned, I may not fully understand
> your problem, but what about static factory methods?
>
> CreateUser.createEditPage(IModel)
> CreateUser.createAddPage(IModel)
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
> On Thu, Jul 24, 2008 at 6:50 AM, John <[EMAIL PROTECTED]> wrote:
>
> > hi Igor,
> >
> > i do have a detachable Group model so am now passing that into my
> > CreateUser page - thank you
> >
> > that is a very interesting point regarding serialization... thank you
> > for mentioning it!  i will have to bear that in mind.
> >
> > as i understand generics, the generic identity is lost at run time so
> > you cannot have two constructors accepting different IModels like
> > IModel and IModel.  is there an obvious way around this
> > that i have not spotted?  my CreateUser page is also an edit page...
> > as the code is exactly the same i am reusing it... but a create would
> > pass a IModel but an edit would pass IModel, but it
> > cannot!!!  i have passed in the user id instead, and am loading it
> > manually inside the page even though i already have the User object
> > inside a detachable model when i make the Link to the edit page.  does
> > this sound correct?
> >
> > hi Thomas,
> >
> > those are good rules!  i have written many pages with ids being used
> > in Links, so for easy access to the object inside the model, i have
> > creating final references to the model object at the start of the
> > constructor... and then just calling myobject.getId() where needed.  i
> > am concerned that this might break your second rule, as the object
> > inside the model may not be the same i think?
> >
> > i have read that for example new Label(myObject.getName()) is bad
> > because the Label will be fixed as the name when the page was first
> > constructed, but it will not change if the name changes but the page
> > is redisplayed.  however i have a gap in my understanding regrding
> > redisplay of the page...
> >
> > when does a page get redisplayed?  a page that displays a School
> > information can not be re used for a different School i think as the
> > IModel or School id will be passed to the page constructor.
> > so it will only be displayed for the one School...  does that mean
> > that the School object that is inside the model on the page will
> > always be the same or will that object change when the model is
> > detached and reattached?  so my final reference to the School object
> > is a bad bad thing?
> >
> > also... when you view a different School does the first page still
> > exist?  i can see the first page can not be reused if i click a link
> > to view the first School that is passing a IModel into the
> > constructor, but if I pass the School id number via a PageParameters
> > will Wicket reuse a page if the PageParameters match?
> >
> > john...
> >
> >
> >
> > On Tue, Jul 22, 2008 at 9:41 AM, Thomas Mäder <[EMAIL PROTECTED]>
> > wrote:
> > > I have three rules for directly referencing objects from pages
> > >
> > > 1) It's serializable
> > > 2) The valueis not going to change from the time I construct the page
> > > to when I use the object
> > > 3) It doesn't matter if I get a copy of the object (because of
> > deserialization).
> > >
> > > 2 & 3 can be summarized as the object being a value object
> > >
> > > Thomas
> > >
> > >
> > > On Mon, Jul 21, 2008 at 6:25 PM, Igor Vaynberg <
> [EMAIL PROTECTED]>
> > wrote:
> > >> the easiest thing to do is to pass the imodel into the second
> > >> page. i assume you already have a detachable group model that you are
> > >> using to list users, so just pass it to the next page.
> > >>
> > >> in general keeping references to objects is safe for as long as the
> > >> objects them selves are valid. the problem with hibernate objects is
> > >> that although you have a reference that you can keep forever, the
> > >> object's lifecycle is not tied to that reference. the object is tied
> > >> to the session whose scope is usually a request, so the object itself
> > >> is only valid during the request, which is why you have to use
> > >> loadable detachable models.
> > >>
> > >> if you had an object that is not tied to any kind of lifecycle you
> > >> could keep a reference inde

Re: How to get the remote address (IP)

2008-07-29 Thread Michael Sparer

try:
final ServletWebRequest req = (ServletWebRequest)
RequestCycle.get().getRequest();
final String remoteAddr = 
req.getHttpServletRequest().getRemoteAddr();

regards,
Michael

hbf wrote:
> 
> I try to obtain the client's remote address from the session:
> 
>WebClientInfo info = (WebClientInfo) session.getClientInfo();
>final String remoteAddress = info.getProperties().getRemoteAddress();
> 
> This results in "0:0:0:0:0:0:0:1%0". Any idea what might be wrong?
> Thanks a lot, Kaspar
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/How-to-get-the-remote-address-%28IP%29-tp18709448p18710838.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the remote address (IP)

2008-07-29 Thread Jonas
Is your browser running on the same machine as the webserver?
If so, you might want to read this:
http://en.wikipedia.org/wiki/IPv6#Special_addresses

On Tue, Jul 29, 2008 at 1:48 PM, Kaspar Fischer <[EMAIL PROTECTED]> wrote:
> On 29.07.2008, at 12:53, Hoover, William wrote:
>
>> did you try
>> getRequestCycleSettings().setGatherExtendedBrowserInfo(true); in your
>> WebApplication?
>
> William, thanks for your answer. I indeed did not set this in my
> application. But if I do, I still obtain the same result.
>
> However, isn't there a cheap way to obtain the client's IP?
> If possible, I'd like to avoid gathering extended browser info.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the remote address (IP)

2008-07-29 Thread Kaspar Fischer

On 29.07.2008, at 12:53, Hoover, William wrote:


did you try
getRequestCycleSettings().setGatherExtendedBrowserInfo(true); in your
WebApplication?


William, thanks for your answer. I indeed did not set this in my
application. But if I do, I still obtain the same result.

However, isn't there a cheap way to obtain the client's IP?
If possible, I'd like to avoid gathering extended browser info.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: @SpringBean and serialization

2008-07-29 Thread James Carman
You don't have to mark your field as transient.  The proxy is indeed
serializable (at least the object that it writeReplaces itself with
is) and will re-establish itself upon deserialization.

On Tue, Jul 29, 2008 at 4:11 AM, Gerald Reinhart <[EMAIL PROTECTED]> wrote:
>
>
> jwcarman wrote:
>>
>> Why are you doing this again?  @SpringBean already takes care of
>> re-establishing the connection upon deserialization.
>>
>
> Are you sure ?
>
>
> Sebastiaan van Erk wrote:
>>
>> The myService field is filled with a proxy to the service which is
>> serializable and can look up
>> the service again if it is lost (due to a serialize/deserialize cycle of
>> the component). The proxy is injected on instantiation of the component
>> and NOT on deserialization (see also IComponentInstantiationListener).
>>
>> Marking it transient will not work because after deserialize the
>> myService field will be null, calling all subsequent calls to the
>> service to fail with a NullPointerException.
>>
>
> --
> View this message in context: 
> http://www.nabble.com/%40SpringBean-and-serialization-tp15330505p18707368.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to get the remote address (IP)

2008-07-29 Thread Hoover, William
did you try
getRequestCycleSettings().setGatherExtendedBrowserInfo(true); in your
WebApplication? 

-Original Message-
From: Kaspar Fischer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 29, 2008 6:35 AM
To: users@wicket.apache.org
Subject: How to get the remote address (IP)

I try to obtain the client's remote address from the session:

   WebClientInfo info = (WebClientInfo) session.getClientInfo();
   final String remoteAddress = info.getProperties().getRemoteAddress();

This results in "0:0:0:0:0:0:0:1%0". Any idea what might be wrong?
Thanks a lot, Kaspar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to get the remote address (IP)

2008-07-29 Thread Kaspar Fischer

I try to obtain the client's remote address from the session:

  WebClientInfo info = (WebClientInfo) session.getClientInfo();
  final String remoteAddress = info.getProperties().getRemoteAddress();

This results in "0:0:0:0:0:0:0:1%0". Any idea what might be wrong?
Thanks a lot, Kaspar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Interrupting AJAX calls

2008-07-29 Thread Federico Fanton
On Tue, 29 Jul 2008 10:01:41 +0200
"Martijn Dashorst" <[EMAIL PROTECTED]> wrote:

> This is nothing we can do anything about: the browser cancels
> rendering. And with good cause. I've had my share of websites that
> took hold of my browser for too long. especially when they are getting
> ads from remote servers.
>
> In this case: just ensure that your responses are quick enough.

I see, but the customer found this "problem" during an AJAX call that shows a 
big DIV with a "please wait" message.. That is, I can't speed things up :/
I see in the DOM reference an "event.preventDefault", I think I'll try that..
Many thanks for your answer! :)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: @SpringBean and serialization

2008-07-29 Thread Gerald Reinhart


jwcarman wrote:
> 
> Why are you doing this again?  @SpringBean already takes care of
> re-establishing the connection upon deserialization.
> 

Are you sure ?


Sebastiaan van Erk wrote:
> 
> The myService field is filled with a proxy to the service which is
> serializable and can look up
> the service again if it is lost (due to a serialize/deserialize cycle of
> the component). The proxy is injected on instantiation of the component
> and NOT on deserialization (see also IComponentInstantiationListener).
> 
> Marking it transient will not work because after deserialize the
> myService field will be null, calling all subsequent calls to the
> service to fail with a NullPointerException. 
> 

-- 
View this message in context: 
http://www.nabble.com/%40SpringBean-and-serialization-tp15330505p18707368.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Interrupting AJAX calls

2008-07-29 Thread Martijn Dashorst
This is nothing we can do anything about: the browser cancels
rendering. And with good cause. I've had my share of websites that
took hold of my browser for too long. especially when they are getting
ads from remote servers.

In this case: just ensure that your responses are quick enough.

Martijn

On Tue, Jul 29, 2008 at 8:45 AM, Federico Fanton <[EMAIL PROTECTED]> wrote:
> On Fri, 25 Jul 2008 12:20:13 +0200
> Federico Fanton <[EMAIL PROTECTED]> wrote:
>
>> I'm sorry, I just noticed that if I press "ESC" during an AJAX call in 
>> Wicket, it gets interrupted (and the "onFailure" script gets run, I think)
>>
>> To reproduce, just head to
>> http://wicketstuff.org/wicket13/ajax/modal-window.1
>> and click on a link, then quickly press "ESC", the popup window shouldn't 
>> show up (or block in mid-rendering).
>
> Am I the only one seeing this behavior?
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]