AttributeModifier in AjaxLink's onClick. Possible?

2009-03-25 Thread CrocodileShoes

Can I do this?

MarkupContainer facetNameLink = new AjaxLink(facetNameLink) {
  @Override
  public void onClick(AjaxRequestTarget target) {
// Get the dataprovider's query response
SolrQuery query = responseModel.getQuery();
// Set the query back to the beginning.
query.setStart(0);
// Add the clicked facet as a filter query on the solr query
query.addFilterQuery(ffcount.getAsFilterQuery());

this.add(new SimpleAttributeModifier(id, facetFieldTitleSelected));
target.addComponent(this);
this.setResponsePage(getPage());
  }
}.add(new Label(facetName, ffcount.getName()));

facetNameLink.setOutputMarkupId(true);


Nothing seems to change in the markup so i'm doing something stupid
somewhere.  Note everything else works as expected apart from the
AttributeModifier.

Cheers
-- 
View this message in context: 
http://www.nabble.com/AttributeModifier-in-AjaxLink%27s-onClick.--Possible--tp22697831p22697831.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: AttributeModifier in AjaxLink's onClick. Possible?

2009-03-25 Thread nino martinez wael
No theres a ajax decorator you can override instead, or something like it...

2009/3/25 CrocodileShoes markjohndo...@googlemail.com


 Can I do this?

 MarkupContainer facetNameLink = new AjaxLink(facetNameLink) {
  @Override
  public void onClick(AjaxRequestTarget target) {
// Get the dataprovider's query response
SolrQuery query = responseModel.getQuery();
// Set the query back to the beginning.
query.setStart(0);
// Add the clicked facet as a filter query on the solr query
query.addFilterQuery(ffcount.getAsFilterQuery());

this.add(new SimpleAttributeModifier(id, facetFieldTitleSelected));
target.addComponent(this);
this.setResponsePage(getPage());
  }
 }.add(new Label(facetName, ffcount.getName()));

 facetNameLink.setOutputMarkupId(true);


 Nothing seems to change in the markup so i'm doing something stupid
 somewhere.  Note everything else works as expected apart from the
 AttributeModifier.

 Cheers
 --
 View this message in context:
 http://www.nabble.com/AttributeModifier-in-AjaxLink%27s-onClick.--Possible--tp22697831p22697831.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: AttributeModifier in AjaxLink's onClick. Possible?

2009-03-25 Thread CrocodileShoes

Ah Ok.  After a quick search through the wiki I came up with this:

@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
  return new AjaxCallDecorator() {
public CharSequence decorateScript(CharSequence script) {
  // add Javascript to change id here
  return  + script;
}
  };
}

Now I have to look up the Javascript.

Thanks, Nino.
-- 
View this message in context: 
http://www.nabble.com/AttributeModifier-in-AjaxLink%27s-onClick.--Possible--tp22697831p22698229.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: AttributeModifier in AjaxLink's onClick. Possible?

2009-03-25 Thread nino martinez wael
No problem :)

2009/3/25 CrocodileShoes markjohndo...@googlemail.com


 Ah Ok.  After a quick search through the wiki I came up with this:

 @Override
 protected IAjaxCallDecorator getAjaxCallDecorator() {
  return new AjaxCallDecorator() {
public CharSequence decorateScript(CharSequence script) {
  // add Javascript to change id here
  return  + script;
}
  };
 }

 Now I have to look up the Javascript.

 Thanks, Nino.
 --
 View this message in context:
 http://www.nabble.com/AttributeModifier-in-AjaxLink%27s-onClick.--Possible--tp22697831p22698229.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