Re: Synchronizing AutoCompleteTextField with a checkbox

2007-11-01 Thread WicketKeeper

That would work as well, yes. I don't know if this is good practice, but the
way I've done it now, which works, is:

tsf = new TableSelectionField("TableNameAutoCompleteTextField"); 
AjaxCheckBox tncb = new AjaxCheckBox("TableNamesRegexpCheckBox")
{
public void onUpdate(AjaxRequestTarget target)
{
//squelch! does nothing
}
};
tsf.setRegexp(tncb); //don't know if this is good practice, but works 

In the model I have methods:
public void setTableNamesRegexpCheckBox(boolean b)
{
this.b_tablenames = b;
}

public boolean getTableNamesRegexpCheckBox()
{
return b_tablenames;
}
public String getTableNameAutoCompleteTextField()
{
return s_tablenames;
}

public void setTableNameAutoCompleteTextField(String s)
{
s_tablenames = s;
}

And in the getChoices method for the textfield I have the following logic:

if((Boolean)regexp.getModelObject())
{
//regular expression
}
else
{
  //normal
}

Cheers
WK


Dipu Seminlal wrote:
> 
> try adding AjaxFormComponentUpdatingBehaviour to the the check box instead
> of
> setting wantOnSelectionChangedNotifications.
> 
> as far as i know wantOnSelectionChangedNotifications will refresh the
> page.
> 
> AjaxFormComponentUpdatingBehaviour will do an ajax call and won't refresh
> the entire page.
> 
> Regards
> Dipu
> 
> 
> On 11/1/07, WicketKeeper <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi
>>
>> I have an autocomplete field object with the getChoices method
>> overridden,
>> which works just fine. Next to it I have a checkbox, which when checked
>> alters the logic in getChoices so that the string is interpreted as a
>> regular expression.
>>
>> This DOES work:
>>
>> tsf = new TableSelectionField("TableNameAutoCompleteTextField");
>> subjcb = new CheckBox("SubjectsRegexpCheckBox")
>> {
>> protected boolean wantOnSelectionChangedNotifications()
>> {
>> return true;
>> }
>> };
>>
>> both components are added to form, so they implicitly get the
>> CompoundPropertyModel.
>>
>> Right, that's wonderful - except now when I click the checkbox the entire
>> page refreshes. When there's lots of stuff on the page this can be a
>> heavy
>> operation. So I took this bit out:
>>
>> subjcb = new CheckBox("SubjectsRegexpCheckBox")
>> {
>> protected boolean wantOnSelectionChangedNotifications()
>> {
>> return true;
>> }
>> };
>>
>> And now the autocomplete field does not work - well, not completely. If I
>> click submit on the form (which gets that state of the checkbox and
>> field)
>> I
>> get the expected results, even if the autocomplete field doesn't populate
>> correctly.
>>
>> Is there any way I can get round this without forcing a refresh when i
>> click
>> on the checkbox?
>>
>> Cheers
>> WK
>> --
>> View this message in context:
>> http://www.nabble.com/Synchronizing-AutoCompleteTextField-with-a-checkbox-tf4730399.html#a13526176
>> 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/Synchronizing-AutoCompleteTextField-with-a-checkbox-tf4730399.html#a13526416
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: Synchronizing AutoCompleteTextField with a checkbox

2007-11-01 Thread WicketKeeper

I'm a dumdum.
The answer is to use AjaxCheckBox (duhh)
Cheers
WK


WicketKeeper wrote:
> 
> Hi
> 
> I have an autocomplete field object with the getChoices method overridden,
> which works just fine. Next to it I have a checkbox, which when checked
> alters the logic in getChoices so that the string is interpreted as a
> regular expression.
> 
> This DOES work:
> 
> tsf = new TableSelectionField("TableNameAutoCompleteTextField");
> subjcb = new CheckBox("SubjectsRegexpCheckBox")
> {
>   protected boolean wantOnSelectionChangedNotifications()
>   {
>   return true;
>   }
> };
> 
> both components are added to form, so they implicitly get the
> CompoundPropertyModel.
> 
> Right, that's wonderful - except now when I click the checkbox the entire
> page refreshes. When there's lots of stuff on the page this can be a heavy
> operation. So I took this bit out:
> 
> subjcb = new CheckBox("SubjectsRegexpCheckBox")
> {
>   protected boolean wantOnSelectionChangedNotifications()
>   {
>   return true;
>   }
> };
> 
> And now the autocomplete field does not work - well, not completely. If I
> click submit on the form (which gets that state of the checkbox and field)
> I get the expected results, even if the autocomplete field doesn't
> populate correctly.
> 
> Is there any way I can get round this without forcing a refresh when i
> click on the checkbox?
> 
> Cheers
> WK
> 

-- 
View this message in context: 
http://www.nabble.com/Synchronizing-AutoCompleteTextField-with-a-checkbox-tf4730399.html#a13526222
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Synchronizing AutoCompleteTextField with a checkbox

2007-11-01 Thread WicketKeeper

Hi

I have an autocomplete field object with the getChoices method overridden,
which works just fine. Next to it I have a checkbox, which when checked
alters the logic in getChoices so that the string is interpreted as a
regular expression.

This DOES work:

tsf = new TableSelectionField("TableNameAutoCompleteTextField");
subjcb = new CheckBox("SubjectsRegexpCheckBox")
{
protected boolean wantOnSelectionChangedNotifications()
{
return true;
}
};

both components are added to form, so they implicitly get the
CompoundPropertyModel.

Right, that's wonderful - except now when I click the checkbox the entire
page refreshes. When there's lots of stuff on the page this can be a heavy
operation. So I took this bit out:

subjcb = new CheckBox("SubjectsRegexpCheckBox")
{
protected boolean wantOnSelectionChangedNotifications()
{
return true;
}
};

And now the autocomplete field does not work - well, not completely. If I
click submit on the form (which gets that state of the checkbox and field) I
get the expected results, even if the autocomplete field doesn't populate
correctly.

Is there any way I can get round this without forcing a refresh when i click
on the checkbox?

Cheers
WK
-- 
View this message in context: 
http://www.nabble.com/Synchronizing-AutoCompleteTextField-with-a-checkbox-tf4730399.html#a13526176
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: Non-serializable objects and efficiency

2007-10-31 Thread WicketKeeper


For anyone who is interested (new users) the appropriate resource is here:

http://cwiki.apache.org/WICKET/request-processing-overview.html



WicketKeeper wrote:
> 
> Thanks for prompt reply.
> 
> Yes, I was thinking having 1 DataConn for every new request. So what i
> envision is:
> 1. User goes to home page ("active window" being the browser window)
> 2. On connection, a new DataConn object should be initialised.
> 3. User does data enquiry stuff from that page (lots of tabs, form inputs
> etc.) - components on the page are populated by making requests to
> DataConn.
> 
> Otherwise I could have just 1 DataConn for the entire application but it
> might get a bit loaded if there are lots and lots of people connecting -
> plus it does user authentication via the contructor so there has to be 1
> DataConn per user.
> 
> Thanks for your help so far!
> WK
> 
> 
> Johan Compagner wrote:
>> 
>> opening a DataConn everytime for every request isn't really what you want
>> i
>> guess?
>> (else you could have a custom request cycle that does this)
>> 
>> But what you could do is hold an transient field in your custom Wicket
>> Session object
>> and maybe besides that a id or description so that you can restore that
>> transient field.
>> And keep in in the session as long as possible. But it could be that the
>> field (the dataconn)
>> is sometimes null if the wicket sessions was serialized by the container.
>> 
>> What do you mean active window? What is the active window?
>> Do you want an datacon object per browser window?
>> You could look if you can have 1 per pagemap then
>> 
>> 
>> johan
>> 
>> 
>> On 10/25/07, WicketKeeper <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>> Hi
>>> Thanks...
>>> Then how do I get that object by it's id? (did you mean component id?)
>>>
>>> I guess what i'm asking is how to best structure things in Wicket when
>>> there
>>> is a resource that isn't serializable and is used by multiple
>>> components.
>>>
>>> So in my case I have a number of tabs, each with its own panel. Within
>>> the
>>> panel there's a bunch of fillable components, e.g. tables, which are
>>> populated by using DataConn. However for every person that visits the
>>> site
>>> there can only ever be one instance of DataConn (so there would be
>>> multiple
>>> instances in the application if more then one person is hitting the home
>>> page).
>>>
>>> Another question: DataConn should also be "wrapped up" so that GB can
>>> deal
>>> with it once a user closes the active window. Is there a way to do this?
>>>
>>> I keep coming back to the idea of Sessions here but I have a gap in my
>>> understanding of how wicket is deploying objects here. Any help, much
>>> appreciated.
>>>
>>> Thanks!
>>> WW.
>>>
>>>
>>>
>>> Johan Compagner wrote:
>>> >
>>> > you can't keep hard (must be transient) references to those resources
>>> > so you always should be able to look it up again. by, for example,
>>> some
>>> id
>>> > that isn't transient
>>> >
>>> > johan
>>> >
>>> >
>>> >
>>> > On 10/24/07, WicketKeeper <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >>
>>> >> Hi
>>> >>
>>> >> I'm new to Wicket to this might be an ultra-dum question :)
>>> >>
>>> >> I'm creating a wicket application that gets its data from an online
>>> >> resource. The connection logic to that resource is in an external jar
>>> and
>>> >> most of those classes don't implement Serializable. Fore ease of
>>> >> explanation, let's call the entry class for the connection
>>> "DataConn".
>>> So
>>> >> whenever I want to get specific data to, say, fill in an
>>> >> AutoCompleteTextField all i do is list=dataconn.getStuff().
>>> >>
>>> >> Moreover, whenever someone comes to the application's homepage they
>>> >> shoult
>>> >> only ever have ONE instance of DataConn, i.e. 1 instance for each
>>> "user".
>>> >>
>>> >> So my question is - what's the best way to go about doing this in
>>> Wicket?
>>> >>

Re: Scrollbars on AutomCompleteTextField?

2007-10-26 Thread WicketKeeper

Hi,
Yes, i think that might be the most sensible/easy way.
Cheers!
WK



Erik van Oosten wrote:
> 
> Hi WK,
> 
> My solution was to just limit the number of things you show. This is how 
> most autocomplete implementations work anyway.
> 
> Regards,
> Erik.
> 
> 
> WicketKeeper wrote:
>> Hi all
>>
>> Has anyone managed to put scrollbars on the drop-down bit of an
>> AutomCompleteTextField? Seems that i have loads of things beginning with
>> "t"
>> so the explorer window's scrollbars compensate, which isn't ideal because
>> there's other stuff on the panel.
>>
>> I'm guessing its something to do the IAutoCompleteRenderer?
>>
>> Cheers
>> WK
>>   
> 
> -- 
> Erik van Oosten
> http://2008.rubyenrails.nl/
> http://www.day-to-day-stuff.blogspot.com/
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Scrollbars-on-AutoCompleteTextField--tf4696002.html#a13423497
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: Scrollbars on AutoCompleteTextField?

2007-10-26 Thread WicketKeeper


sorry - new to Wicket - don't understand the lingo yet :)
how do mean style my way out? something to do with Session.getSyle()?



Nino.Martinez wrote:
> 
> Could'nt you style your way out of it?
> 
> WicketKeeper wrote:
>> Hi all
>>
>> Has anyone managed to put scrollbars on the drop-down bit of an
>> AutoCompleteTextField? Seems that i have loads of things beginning with
>> "t"
>> so the explorer window's scrollbars compensate, which isn't ideal because
>> there's other stuff on the panel.
>>
>> I'm guessing its something to do the IAutoCompleteRenderer?
>>
>> Cheers
>> WK
>>   
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
:-((:-((
-- 
View this message in context: 
http://www.nabble.com/Scrollbars-on-AutoCompleteTextField--tf4696002.html#a13423342
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Scrollbars on AutomCompleteTextField?

2007-10-26 Thread WicketKeeper

Hi all

Has anyone managed to put scrollbars on the drop-down bit of an
AutomCompleteTextField? Seems that i have loads of things beginning with "t"
so the explorer window's scrollbars compensate, which isn't ideal because
there's other stuff on the panel.

I'm guessing its something to do the IAutoCompleteRenderer?

Cheers
WK
-- 
View this message in context: 
http://www.nabble.com/Scrollbars-on-AutomCompleteTextField--tf4696002.html#a13423277
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: Non-serializable objects and efficiency

2007-10-25 Thread WicketKeeper

Thanks for prompt reply.

Yes, I was thinking having 1 DataConn for every new request. So what i
envision is:
1. User goes to home page ("active window" being the browser window)
2. On connection, a new DataConn object should be initialised.
3. User does data enquiry stuff from that page (lots of tabs, form inputs
etc.) - components on the page are populated by making requests to DataConn.

Otherwise I could have just 1 DataConn for the entire application but it
might get a bit loaded if there are lots and lots of people connecting -
plus it does user authentication via the contructor so there has to be 1
DataConn per user.

Thanks for your help so far!
WK


Johan Compagner wrote:
> 
> opening a DataConn everytime for every request isn't really what you want
> i
> guess?
> (else you could have a custom request cycle that does this)
> 
> But what you could do is hold an transient field in your custom Wicket
> Session object
> and maybe besides that a id or description so that you can restore that
> transient field.
> And keep in in the session as long as possible. But it could be that the
> field (the dataconn)
> is sometimes null if the wicket sessions was serialized by the container.
> 
> What do you mean active window? What is the active window?
> Do you want an datacon object per browser window?
> You could look if you can have 1 per pagemap then
> 
> 
> johan
> 
> 
> On 10/25/07, WicketKeeper <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi
>> Thanks...
>> Then how do I get that object by it's id? (did you mean component id?)
>>
>> I guess what i'm asking is how to best structure things in Wicket when
>> there
>> is a resource that isn't serializable and is used by multiple components.
>>
>> So in my case I have a number of tabs, each with its own panel. Within
>> the
>> panel there's a bunch of fillable components, e.g. tables, which are
>> populated by using DataConn. However for every person that visits the
>> site
>> there can only ever be one instance of DataConn (so there would be
>> multiple
>> instances in the application if more then one person is hitting the home
>> page).
>>
>> Another question: DataConn should also be "wrapped up" so that GB can
>> deal
>> with it once a user closes the active window. Is there a way to do this?
>>
>> I keep coming back to the idea of Sessions here but I have a gap in my
>> understanding of how wicket is deploying objects here. Any help, much
>> appreciated.
>>
>> Thanks!
>> WW.
>>
>>
>>
>> Johan Compagner wrote:
>> >
>> > you can't keep hard (must be transient) references to those resources
>> > so you always should be able to look it up again. by, for example, some
>> id
>> > that isn't transient
>> >
>> > johan
>> >
>> >
>> >
>> > On 10/24/07, WicketKeeper <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> Hi
>> >>
>> >> I'm new to Wicket to this might be an ultra-dum question :)
>> >>
>> >> I'm creating a wicket application that gets its data from an online
>> >> resource. The connection logic to that resource is in an external jar
>> and
>> >> most of those classes don't implement Serializable. Fore ease of
>> >> explanation, let's call the entry class for the connection "DataConn".
>> So
>> >> whenever I want to get specific data to, say, fill in an
>> >> AutoCompleteTextField all i do is list=dataconn.getStuff().
>> >>
>> >> Moreover, whenever someone comes to the application's homepage they
>> >> shoult
>> >> only ever have ONE instance of DataConn, i.e. 1 instance for each
>> "user".
>> >>
>> >> So my question is - what's the best way to go about doing this in
>> Wicket?
>> >> I
>> >> am aware of Session and Models in wicket (though my understanding is
>> >> poor)
>> >> -
>> >> could anyone direct me to the appropriate examples or suggestions
>> please?
>> >>
>> >> Thanks
>> >> WK.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Non-serializable-objects-and-efficiency-tf4684047.html#a13384755
>> >> 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/Non-serializable-objects-and-efficiency-tf4684047.html#a13401731
>> 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/Non-serializable-objects-and-efficiency-tf4684047.html#a13402917
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: Non-serializable objects and efficiency

2007-10-25 Thread WicketKeeper

Hi
Thanks... 
Then how do I get that object by it's id? (did you mean component id?)

I guess what i'm asking is how to best structure things in Wicket when there
is a resource that isn't serializable and is used by multiple components.

So in my case I have a number of tabs, each with its own panel. Within the
panel there's a bunch of fillable components, e.g. tables, which are
populated by using DataConn. However for every person that visits the site
there can only ever be one instance of DataConn (so there would be multiple
instances in the application if more then one person is hitting the home
page).

Another question: DataConn should also be "wrapped up" so that GB can deal
with it once a user closes the active window. Is there a way to do this?

I keep coming back to the idea of Sessions here but I have a gap in my
understanding of how wicket is deploying objects here. Any help, much
appreciated.

Thanks!
WW.



Johan Compagner wrote:
> 
> you can't keep hard (must be transient) references to those resources
> so you always should be able to look it up again. by, for example, some id
> that isn't transient
> 
> johan
> 
> 
> 
> On 10/24/07, WicketKeeper <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi
>>
>> I'm new to Wicket to this might be an ultra-dum question :)
>>
>> I'm creating a wicket application that gets its data from an online
>> resource. The connection logic to that resource is in an external jar and
>> most of those classes don't implement Serializable. Fore ease of
>> explanation, let's call the entry class for the connection "DataConn". So
>> whenever I want to get specific data to, say, fill in an
>> AutoCompleteTextField all i do is list=dataconn.getStuff().
>>
>> Moreover, whenever someone comes to the application's homepage they
>> shoult
>> only ever have ONE instance of DataConn, i.e. 1 instance for each "user".
>>
>> So my question is - what's the best way to go about doing this in Wicket?
>> I
>> am aware of Session and Models in wicket (though my understanding is
>> poor)
>> -
>> could anyone direct me to the appropriate examples or suggestions please?
>>
>> Thanks
>> WK.
>> --
>> View this message in context:
>> http://www.nabble.com/Non-serializable-objects-and-efficiency-tf4684047.html#a13384755
>> 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/Non-serializable-objects-and-efficiency-tf4684047.html#a13401731
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Non-serializable objects and efficiency

2007-10-24 Thread WicketKeeper

Hi

I'm new to Wicket to this might be an ultra-dum question :)

I'm creating a wicket application that gets its data from an online
resource. The connection logic to that resource is in an external jar and
most of those classes don't implement Serializable. Fore ease of
explanation, let's call the entry class for the connection "DataConn". So
whenever I want to get specific data to, say, fill in an
AutoCompleteTextField all i do is list=dataconn.getStuff().

Moreover, whenever someone comes to the application's homepage they shoult
only ever have ONE instance of DataConn, i.e. 1 instance for each "user".

So my question is - what's the best way to go about doing this in Wicket? I
am aware of Session and Models in wicket (though my understanding is poor) -
could anyone direct me to the appropriate examples or suggestions please?

Thanks
WK.
-- 
View this message in context: 
http://www.nabble.com/Non-serializable-objects-and-efficiency-tf4684047.html#a13384755
Sent from the Wicket - User mailing list archive at Nabble.com.


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