Re: AJAXIFY Palette: Can't get to the Recorder

2010-04-01 Thread Christoph Glass
Hi,

here is a (for me) working code snipplet populated from the example given by
Igor:



/** SelectedFields may be pojo or so */

/* data */
Selected Fields[] collector;

/* list */
List dataList = Arrays.asList(collector);

/* model to save selection */
final Model> fieldsModel;

/* ichoice renderer */
IChoiceRenderer renderer = new
ChoiceRenderer("selectedValue", "selectedValue");

/* palette */
Palette palette = new
Palette("palette",saveSelectedFields,Model.of(dataList),renderer,dataList.size(),true)
{

/**
 *
 */
private static final long serialVersionUID=1L;

@Override
protected Recorder newRecorderComponent()
{
Recorder c=super.newRecorderComponent();
c.add(new AjaxFormComponentUpdatingBehavior("onchange")
{

/**
 *
 */
private static final long serialVersionUID=1L;

/* populate every change in selection to palette model */
@Override
protected void onUpdate(AjaxRequestTarget target)
{

/* init cache */
ArrayList tempList=new ArrayList();

/* foreach selected field.. */
for(int a=0; a0)
{

/* save it to model */
fieldsModel.setObject(tempList);
}
}
});
return c;
}

/* publish */
add(palette);



Hope this helps.

Best regards
Christoph


On Wed, Mar 31, 2010 at 3:19 AM, wicketnewuser  wrote:

>
> Hi i tried doing this it doesn't like adding
> AjaxFormComponentUpdatingBehavior . I thought when you meant
> AjaxFormComponentUpdatingBehavior by whateverbehaviour. i even added
> onupdate method that didn't help too. still getting null when doing
> pallet.getRecorderComponent. Please help
>new PropertyModel(model,"allSids"),
>renderer, 12, false){
>   protected Recorder
> newRecorderComponent() {
>Recorder
> r=super.newRecorderComponent();
>r.add(new
>  AjaxFormComponentUpdatingBehavior("onchange"));
>return r;
>}
>
>};
>
>
> Edvin Syse wrote:
> >
> > Thanks! Will you update the javadoc as well?
> >
> > -- Edvin
> >
> > Den 28. juli. 2008 kl. 16.37 skrev "Igor Vaynberg"
> >  >  >:
> >
> >> override newrecorder() { recorder r=super.newrecorder(); r.add(new
> >> whateverbehavior()); return r; }
> >>
> >> -igor
> >>
> >> On Mon, Jul 28, 2008 at 12:33 AM, Edvin Syse 
> >> wrote:
> >>> The javadocs for the Palette says to add
> >>> AjaxFormComponentUpdatingBehaviour
> >>> to the Recorder like this:
> >>>
> >>>   Form form=new Form(...);
> >>>   Palette palette=new Palette(...);
> >>>   palette.getRecorderComponent().add(new
> >>> AjaxFormComponentUpdatingBehavior("onchange") {...});
> >>>
> >>> getRecorderComponent() is null, because it isn't populated in the
> >>> Palette's
> >>> constructor, it is populated
> >>> in the private initFactories() method, which is called from
> >>> onBeforeRender.
> >>>
> >>> How am I supposed to get to the Recorder-component from the
> >>> constructor of
> >>> my pageclass? :)
> >>>
> >>>
> >>> -- Edvin
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >>> For additional commands, e-mail: users-h...@wicket.apache.org
> >>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/AJAXIFY-Palette%3A-Can%27t-get-to-the-Recorder-tp18685475p28090539.html
> Sent from the Wicket - User 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: AJAXIFY Palette: Can't get to the Recorder

2010-03-30 Thread wicketnewuser

Hi i tried doing this it doesn't like adding
AjaxFormComponentUpdatingBehavior . I thought when you meant
AjaxFormComponentUpdatingBehavior by whateverbehaviour. i even added
onupdate method that didn't help too. still getting null when doing
pallet.getRecorderComponent. Please help
new PropertyModel(model,"allSids"), 
renderer, 12, false){
   protected Recorder 
newRecorderComponent() {
Recorder 
r=super.newRecorderComponent(); 
r.add(new  
AjaxFormComponentUpdatingBehavior("onchange")); 
return r;
}

};


Edvin Syse wrote:
> 
> Thanks! Will you update the javadoc as well?
> 
> -- Edvin
> 
> Den 28. juli. 2008 kl. 16.37 skrev "Igor Vaynberg"
>   >:
> 
>> override newrecorder() { recorder r=super.newrecorder(); r.add(new
>> whateverbehavior()); return r; }
>>
>> -igor
>>
>> On Mon, Jul 28, 2008 at 12:33 AM, Edvin Syse   
>> wrote:
>>> The javadocs for the Palette says to add  
>>> AjaxFormComponentUpdatingBehaviour
>>> to the Recorder like this:
>>>
>>>   Form form=new Form(...);
>>>   Palette palette=new Palette(...);
>>>   palette.getRecorderComponent().add(new
>>> AjaxFormComponentUpdatingBehavior("onchange") {...});
>>>
>>> getRecorderComponent() is null, because it isn't populated in the  
>>> Palette's
>>> constructor, it is populated
>>> in the private initFactories() method, which is called from  
>>> onBeforeRender.
>>>
>>> How am I supposed to get to the Recorder-component from the  
>>> constructor of
>>> my pageclass? :)
>>>
>>>
>>> -- Edvin
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/AJAXIFY-Palette%3A-Can%27t-get-to-the-Recorder-tp18685475p28090539.html
Sent from the Wicket - User 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: AJAXIFY Palette: Can't get to the Recorder

2008-07-28 Thread Edvin Syse

Thanks! Will you update the javadoc as well?

-- Edvin

Den 28. juli. 2008 kl. 16.37 skrev "Igor Vaynberg" <[EMAIL PROTECTED] 
>:



override newrecorder() { recorder r=super.newrecorder(); r.add(new
whateverbehavior()); return r; }

-igor

On Mon, Jul 28, 2008 at 12:33 AM, Edvin Syse <[EMAIL PROTECTED]>  
wrote:
The javadocs for the Palette says to add  
AjaxFormComponentUpdatingBehaviour

to the Recorder like this:

  Form form=new Form(...);
  Palette palette=new Palette(...);
  palette.getRecorderComponent().add(new
AjaxFormComponentUpdatingBehavior("onchange") {...});

getRecorderComponent() is null, because it isn't populated in the  
Palette's

constructor, it is populated
in the private initFactories() method, which is called from  
onBeforeRender.


How am I supposed to get to the Recorder-component from the  
constructor of

my pageclass? :)


-- Edvin


-
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: AJAXIFY Palette: Can't get to the Recorder

2008-07-28 Thread Igor Vaynberg
override newrecorder() { recorder r=super.newrecorder(); r.add(new
whateverbehavior()); return r; }

-igor

On Mon, Jul 28, 2008 at 12:33 AM, Edvin Syse <[EMAIL PROTECTED]> wrote:
> The javadocs for the Palette says to add AjaxFormComponentUpdatingBehaviour
> to the Recorder like this:
>
>Form form=new Form(...);
>Palette palette=new Palette(...);
>palette.getRecorderComponent().add(new
> AjaxFormComponentUpdatingBehavior("onchange") {...});
>
> getRecorderComponent() is null, because it isn't populated in the Palette's
> constructor, it is populated
> in the private initFactories() method, which is called from onBeforeRender.
>
> How am I supposed to get to the Recorder-component from the constructor of
> my pageclass? :)
>
>
> -- Edvin
>
>
> -
> 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]



AJAXIFY Palette: Can't get to the Recorder

2008-07-28 Thread Edvin Syse
The javadocs for the Palette says to add 
AjaxFormComponentUpdatingBehaviour to the Recorder like this:


Form form=new Form(...);
Palette palette=new Palette(...);
palette.getRecorderComponent().add(new 
AjaxFormComponentUpdatingBehavior("onchange") {...});

getRecorderComponent() is null, because it isn't populated in the Palette's 
constructor, it is populated
in the private initFactories() method, which is called from onBeforeRender.

How am I supposed to get to the Recorder-component from the constructor of my 
pageclass? :)


-- Edvin


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