Re: help with drag and drop (wicket-dnd)

2012-02-26 Thread Sven Meier
Usually you do not have to override that method, please take a look at the 
examples.

Sven

Dan12321  schrieb:

>Thanks.
>
>So what should be in method DragSource#onBeforeDrop()? I should set there
>transfer data: transfer.setData(drag); ?
>
>I have Wicket 1.5.4 and wicket-dnd 0.5.0.
>
>--
>View this message in context: 
>http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4423719.html
>Sent from the Users forum mailing list archive at Nabble.com.
>
>-
>To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>For additional commands, e-mail: users-h...@wicket.apache.org
>


Re: help with drag and drop (wicket-dnd)

2012-02-26 Thread Dan12321
Thanks.

So what should be in method DragSource#onBeforeDrop()? I should set there
transfer data: transfer.setData(drag); ?

I have Wicket 1.5.4 and wicket-dnd 0.5.0.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4423719.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: help with drag and drop (wicket-dnd)

2012-02-26 Thread Sven Meier

Hi,

your s have to output their markup id too.


transfer.getData() allways NULL. What should be in transfer?



The transfer objects hold whatever the dragsource puts into it. If you haven't 
overriden DragSource#onBeforeDrop() this is just the model object of the 
dragged element.


BTW which version are you using?

Regards
Sven

On 02/26/2012 08:22 PM, Dan12321 wrote:

Thanks for answer.
Yes, in the first "td" is "span" but in this forum it was formatted and span
was not visible.
The first td should be:<  span wicket:id="aaa" class="aaa">www
--

But I make little modification and html is:


<  span wicket:id="aaa" class="aaa">aaa
<  span wicket:id="bbb" class="bbb">bbb
<  span wicket:id="ccc" class="ccc">ccc



And in java class was added:
Label bbb = new Label("bbb", "bbb");
Label ccc = new Label("ccc", "ccc");
bbb.setOutputMarkupId(true);
ccc.setOutputMarkupId(true);
container.add(bbb);
container.add(ccc);



But in the methods is transfer.getData() allways NULL. What should be in
transfer? The target element? Is there any way how to know what element was
targeted (drop)?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422742.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: Performance optimization

2012-02-26 Thread Martin Makundi
Here is how I managed to do ajax refresh:

  final Component
newDummyAjaxUpdateComponentFromMarkup =
TakpPanelWithDynamicMarkup.newDummyAjaxUpdateComponentFromMarkup(freshMarkup,
markupId, false);
  if (newDummyAjaxUpdateComponentFromMarkup != null) {

target.addComponent(newDummyAjaxUpdateComponentFromMarkup);
  }


  public static Component newDummyAjaxUpdateComponentFromMarkup(String
freshMarkup, String markupId, boolean required) {
XmlPullParser xmlPullParser = new XmlPullParser();
try {
  xmlPullParser.parse(freshMarkup);
} catch (Exception e) {
  throw new RuntimeException(e);
}

XmlTag xmlTag = findStartTag(xmlPullParser, markupId);

if (xmlTag != null) {
  final StringBuilder stringBuilder = new StringBuilder();
  final int startEndPosition;
  {
final String tagAsString = xmlTag.toString();
stringBuilder.append(tagAsString);
startEndPosition = xmlTag.getPos() + tagAsString.length();
  }
  {
try {
  xmlTag = (XmlTag) xmlPullParser.nextTag();
} catch (Exception e) {
  if (required) {
throw new RuntimeException(e);
  }

  // else
  Utils.errorLog(TakpPanelWithDynamicMarkup.class, e);
}

stringBuilder.append(xmlPullParser.getInput(startEndPosition,
xmlTag.getPos())); // Value inside
stringBuilder.append(xmlTag.toString());
  }

  return new TakpPanelWithDynamicMarkup(markupId) {
private transient IResourceStream markupResourceStream;

@Override
public IResourceStream getMarkupResourceStream(MarkupContainer
container, Class containerClass) {
  if (markupResourceStream == null) {
final StringBufferResourceStream stream = new
StringBufferResourceStream();

stream.append("");

stream.append(stringBuilder);

stream.append("");

markupResourceStream = new MarkupResourceStream(stream);
  }

  return markupResourceStream;
}
  };
} else if (required) {
  throw new IllegalStateException("Component with markup id " +
markupId + " not found from markup stream " + freshMarkup);
}

return null;
  }


It could be streamlined ofcourse.. with duality it could be native
part of wicket ;)


**
Martin

2012/2/25 Per :
> Hi Martin,
>
> some of the things we did was (as mentioned by others) to generate HTML,
> this saved a lot of memory. But also to look really hard at the component
> tree and decide if everything was needed *all the time*. For instance, we
> had plenty of AJAX links that were rarely used (5 per row or so). We decided
> to make them load on demand only ("click for admin actions"). This saved
> some 500 bytes per row.  Also, some optimisations like replacing
> setVisible(false) by an empty component saved us some space. Some component
> use more memory than others, and can be replaced. Etc.  It's really crucial
> to use a profiler to see where all the bytes go. I wrote a blogpost over
> here:
> http://www.small-improvements.com/blog/technical/tuning-wicket-session-size
> a few months ago. You may even want to create your own eviction-policy that
> collects certain pages more aggressively than others (if applicable). Many
> options.
>
> But yeah, it's tough, it's one of the things I found most challenging about
> Wicket. I'd love to hear how you end solving with the problem, maybe there's
> something else to be learned!
>
> Good luck!
> Per
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Performance-optimization-tp4412659p4419111.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: help with drag and drop (wicket-dnd)

2012-02-26 Thread Dan12321
yes it is valid and the html is:


< span wicket:id="aaa" class="aaa">aaa< 
/span>
< span wicket:id="bbb" class="bbb">bbb< 
/span>
< span wicket:id="ccc" class="ccc">ccc< 
/span>



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422835.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: help with drag and drop (wicket-dnd)

2012-02-26 Thread Per Newgro

Hi Dan,

only a shot in the dark - but is your markup valid? validate with w3c.

PS: Is it required to add the ending slash?

Cheers
Per

Thanks for answer.
Yes, in the first "td" is "span" but in this forum it was formatted and span
was not visible.
The first td should be:<  span wicket:id="aaa" class="aaa">www
--

But I make little modification and html is:


<  span wicket:id="aaa" class="aaa">aaa
<  span wicket:id="bbb" class="bbb">bbb
<  span wicket:id="ccc" class="ccc">ccc



And in java class was added:
Label bbb = new Label("bbb", "bbb");
Label ccc = new Label("ccc", "ccc");
bbb.setOutputMarkupId(true);
ccc.setOutputMarkupId(true);
container.add(bbb);
container.add(ccc);



But in the methods is transfer.getData() allways NULL. What should be in
transfer? The target element? Is there any way how to know what element was
targeted (drop)?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422742.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Re: help with drag and drop (wicket-dnd)

2012-02-26 Thread Dan12321
Thanks for answer.
Yes, in the first "td" is "span" but in this forum it was formatted and span
was not visible.
The first td should be: < span wicket:id="aaa" class="aaa">www
--

But I make little modification and html is:


< span wicket:id="aaa" class="aaa">aaa
< span wicket:id="bbb" class="bbb">bbb
< span wicket:id="ccc" class="ccc">ccc



And in java class was added:
Label bbb = new Label("bbb", "bbb");
Label ccc = new Label("ccc", "ccc");
bbb.setOutputMarkupId(true);
ccc.setOutputMarkupId(true);
container.add(bbb);
container.add(ccc);



But in the methods is transfer.getData() allways NULL. What should be in
transfer? The target element? Is there any way how to know what element was
targeted (drop)?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422742.html
Sent from the Users forum mailing list archive at Nabble.com.

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



CAS with shibboleth Idp integration.

2012-02-26 Thread mejat.joseph
Hi 

 I am facing one difficulties to configure CAS with shibboleth idp.This is
my requirement.

I want to use CAS as a service provider and integrate with shibboleth
idp.When i access one application its redirect to shibboleth idp. After
success full authentication its redirect to original application.

Please let me know know this configuration ... i will appreciate ...

Thanks,
Mejat joseph 
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CAS-with-shibboleth-Idp-integration-tp4422623p4422623.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: help with drag and drop (wicket-dnd)

2012-02-26 Thread Sven Meier

Hi,

with .drag("span") you tell the drag source that drags should start on 
span tags.


>
> 
> 
> www
> aaa
> aaa
> 
> 
>

Do you have a span tag in your markup?

Sven

On 02/26/2012 04:50 PM, Dan12321 wrote:

I would like to use drag and drop functions in my wicket application.
Into my pom.xml I add: wicket-dnd (http://code.google.com/p/wicket-dnd/)

But my code do not work. Could you help me, please?

I have got table. In the first cell ("td") is "span" element. I want this
"span" drag and drop into another cell ("td") in the table.
Thanks for help.

WebMarkupContainer container = new WebMarkupContainer("container");
Model  model = Model.of(new String("AAA"));
container.add(new DragSource(Operation.values()) {
  public void onAfterDrop(AjaxRequestTarget target, 
Transfer transfer) {

  System.out.println("A");

  }
}.drag("span"));

container.add(new DropTarget(Operation.values()) {
  public void onDrop(AjaxRequestTarget target, Transfer 
transfer,
Location location) {
// add transfer data

  System.out.println("");
  }
}.dropCenter("td"));

Label label = new Label("aaa", model);
label.setOutputMarkupId(true);
container.add(label);

add(container);

and HTML:






www
aaa
aaa





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422338.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



help with drag and drop (wicket-dnd)

2012-02-26 Thread Dan12321
I would like to use drag and drop functions in my wicket application.
Into my pom.xml I add: wicket-dnd (http://code.google.com/p/wicket-dnd/)

But my code do not work. Could you help me, please?

I have got table. In the first cell ("td") is "span" element. I want this
"span" drag and drop into another cell ("td") in the table.
Thanks for help.

WebMarkupContainer container = new WebMarkupContainer("container");
Model model = Model.of(new String("AAA"));
container.add(new DragSource(Operation.values()) {
  public void onAfterDrop(AjaxRequestTarget target, 
Transfer transfer) {
  
  System.out.println("A");
  
  }
}.drag("span"));

container.add(new DropTarget(Operation.values()) {
  public void onDrop(AjaxRequestTarget target, Transfer 
transfer,
Location location) {
// add transfer data
  
  System.out.println("");
  }
}.dropCenter("td"));

Label label = new Label("aaa", model);
label.setOutputMarkupId(true);
container.add(label);

add(container);

and HTML:






www
aaa
aaa





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422338.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Exception (Header was already written to response!) when setting response page in IRequestCycleListener

2012-02-26 Thread nhsoft.yhw
I have the same problem, but only in IE browser, firefox or chrome works 

-
first wicket application: 114生活网 
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Exception-Header-was-already-written-to-response-when-setting-response-page-in-IRequestCycleListener-tp4418783p4422044.html
Sent from the Users forum mailing list archive at Nabble.com.

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