Re: WebMarkupContainer update affecting scrollbar which is outside container

2010-12-06 Thread Pedro Santos
Hi David, you can specify your css for clicked links wiht the pseudo-class
:visited, also you can send back to browser only the javascript needed to
style the clicked links, like:
request.appendJavascript(Wicket.$('linkId').style.someProperty = 'some
value');

On Wed, Dec 1, 2010 at 8:56 AM, drf davidrfi...@gmail.com wrote:


 I have an issue whereby an ajax update on a WebMarkupContainer is having
 unexpected effect on content outside the container.

 The page in question consists of two parts:
 1. on the left hand side, a menu, composed of a list of AjaxFallbackLink
 objects. This is contained in a DIV.
 2. on the right hand side, a panel, which itself is contained in a
 WebMarkupContainer.

 Here is standard behavior:
 When a link is clicked, it's color changes to indicate it is selected
 (achieved by using AttributeModifier to change the css class). Also, the
 content of the panel changes. Works fine.

 Here is the issue:
 when the ul/ul list is long, a scrollbar appears in the DIV surrounding
 it (which is correct). I want to avoid the scrollbar moving back to the top
 of the list when an item is clicked, so rather than doing an update on the
 whole page, I use ajax to update just:
 1. The selected link
 2. The previously selected link
 3. The WebMarkupContainer  containing the panel (which will now have new
 content).

 If I just do an update on the two AjaxFallbackLink objects, there is no
 problem, and the DIV does not scroll back to the top. However, when I do an
 update on the WebMarkupContainer, the DIV does scroll back to the top -
 even
 though the DIVulli/il/ulDIV is outside the WebMarkupContainer.

 Here is the snippet from the html:
 wicket:panel
 div wicket:id=pageContainerdiv class=mainPageDiv
 wicket:id=mainPage/div/div

 div class=menuDiv
 ul
 li class=mainMenuItem wicket:id=topItem_CM_Information/li
 li class=subMenuItem wicket:id=subItem_holdings #  /li
 li class=subMenuItem wicket:id=subItem_holdings_at_day_end #  /li
 li class=subMenuItem wicket:id=subItem_holdings_update #  /li
 /ul
 /div
 /wicket:panel

 (I have removed most of the list items for the sake of brevity).
 Here is a snippet from the java:
Panel mainPage = new SimplePage(mainPage);
mainPageContainer = new WebMarkupContainer(pageContainer);
mainPageContainer.setOutputMarkupId(true);
add(mainPageContainer);
mainPageContainer.add(mainPage);

 The list items are then added as AjaxFallbackLink objects.
 As always, help greatly appreciated !


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/WebMarkupContainer-update-affecting-scrollbar-which-is-outside-container-tp3067035p3067035.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




-- 
Pedro Henrique Oliveira dos Santos


reverse proxy / http / https

2010-12-06 Thread Markus Meixner
Hi everybody

Perhaps this is more a apache reverse proxy configuration thing, but
perhaps you can help me anyway.

My application runs behind a reverse proxy, which is terminating https
request and forwarding http requests to the wicket application.

If wicket now responds with redirects, it does this with absolute links
http://host/context-path/ which is normally fine and working.

Problem now is, that those redirects are passed to the client and are
not changed to https://host/context-path/ which will break the redirects.

Question: Is there an easy way to change the URLs protocol/scheme of the
redirects from http to https? And where could I do this?

Thanks anybody for help.

Markus

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



Re: reverse proxy / http / https

2010-12-06 Thread Pedro Santos
I think you can use
http://code.google.com/p/xebia-france/wiki/XForwardedFilter
and watch/help https://issues.apache.org/jira/browse/WICKET-3015

On Mon, Dec 6, 2010 at 9:11 AM, Markus Meixner m.simb...@gmail.com wrote:

 Hi everybody

 Perhaps this is more a apache reverse proxy configuration thing, but
 perhaps you can help me anyway.

 My application runs behind a reverse proxy, which is terminating https
 request and forwarding http requests to the wicket application.

 If wicket now responds with redirects, it does this with absolute links
 http://host/context-path/ which is normally fine and working.

 Problem now is, that those redirects are passed to the client and are
 not changed to https://host/context-path/ which will break the redirects.

 Question: Is there an easy way to change the URLs protocol/scheme of the
 redirects from http to https? And where could I do this?

 Thanks anybody for help.

 Markus

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




-- 
Pedro Henrique Oliveira dos Santos


Re: reverse proxy / http / https

2010-12-06 Thread Martin Makundi
http://apache-wicket.1842946.n4.nabble.com/Wicket-Link-with-proxy-server-wrong-hostname-td1878181.html
http://www.mail-archive.com/users@wicket.apache.org/msg32818.html

2010/12/6 Markus Meixner m.simb...@gmail.com:
 Hi everybody

 Perhaps this is more a apache reverse proxy configuration thing, but
 perhaps you can help me anyway.

 My application runs behind a reverse proxy, which is terminating https
 request and forwarding http requests to the wicket application.

 If wicket now responds with redirects, it does this with absolute links
 http://host/context-path/ which is normally fine and working.

 Problem now is, that those redirects are passed to the client and are
 not changed to https://host/context-path/ which will break the redirects.

 Question: Is there an easy way to change the URLs protocol/scheme of the
 redirects from http to https? And where could I do this?

 Thanks anybody for help.

 Markus

 -
 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



FormComponentPanel + unknown collection type

2010-12-06 Thread alex shubert
Hello!

I got a problem with type mysmatch then implementing custom component.

First of all, the code^
public class EnumCheckGroupT extends Enum extends
FormComponentPanelCollectionT {

 public EnumCheckGroup(final String id, final IModel? extends
CollectionT model, final ClassT enumClass) {
//noinspection unchecked
super(id, (IModelCollectionT) model);

group = new CheckGroupT(checkgroup, model);
...
}

That model comes from:
CompoundPropertyModelGroup formModel = new
CompoundPropertyModelGroup(service.createGroup());
..
 EnumCheckGroup checkGroup = new EnumCheckGroup(roles,
formModel.bind(roles), RoleEnum.class);

Roles is a set of Enum and has getter and setter like  Set getRoles /
Group setRoles(Set)

all of that renders already filled Set without problems, but fails to
set with type mismatch. PropertyResolver#setValue receives value as
ArrayList while property is a Set.
If I call setType(getModelObject.getClass) on CheckGroup it tryes to
convert every Check to PersistentSet (hibernate proxy for a Set) so it
doesnt look like a solution.

Call of setType(getModelObject.getClass) in beforeRender() changes nothing.

Any ideas? Thanks in advance...
-- 
Best regards
Alex

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



Re: Wicket-Hibernate Related LazyInitializationException

2010-12-06 Thread Nivedan Nadaraj
Hi Eelco

Appreciate your time and thoughts. I guess I am going to have to look at LDM
approach, since from what yourself,James and Dan have already mentioned
that.
I noticed a pattern when it/the system throws the Exception I have to track
it closely and see if makes sense and then I guess have to refactor to use a
LDM.Still hazy to me.
Many thanks for the time and thoughts, much appreciated one and all.

Regards
Nivedan




On Sat, Dec 4, 2010 at 9:23 AM, Eelco Hillenius
eelco.hillen...@gmail.comwrote:

 Yep, or least something comparable. You need to re-attach those
 objects you're using to the session somehow, and often the easiest way
 to do that is to just load them again if they were previously
 detached. If you worry about the database being hit more than you
 want, you are probably prematurely optimizing, and if you still worry,
 you should fix this by through Hibernate's (or your own) second level
 cache, not by keeping your model objects inflated between requests.

 As a general rule, something we often repeat on this list, if you work
 with Hibernate managed objects in Wicket models, use detachable models
 (LDM is a common one) and make sure that these objects are 'deflated'
 between requests, meaning that e.g. you only keep references to their
 ids, or e.g. the algorithm to get the objects back again when needed.

 Eelco


 On Wed, Dec 1, 2010 at 10:13 PM, James Carman
 ja...@carmanconsulting.com wrote:
  Just make sure your form's model is a LDM too.
 
  On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi All
 
  I am guessing this is more of a Hibernate thing/issue but if some one
 has
  encountered this and has a explanation that I can probably use from the
  Wicket front would be great.
 
  https://forum.hibernate.org/viewtopic.php?f=1t=1008473
 
 
  I have a LazyIntializationException when i page through some items. I
 use
  the PageableListView, the List item(s) are entities that are retrieved
 via
  an association Person.phones which is  a Set type.
  The funny thing is, the LIException is intermittent. I am also using
  OpenSessionInViewFilter. Any thoughts?
 
  By the way the this is the load() implemenation, I have set the Model
  Object's phoneList with a list of values fetched via the Service-DAO. I
  have used this with other entities without association and it works  but
 I
  guess is a different scenario(not associations)
 
  Model = new LoadableDetachableModelObject() {
 @Override
 protected Object load() {
 return containerForm.getModelObject().getPhoneList();
 }
 };
  }
 
  If someone has any thoughts would appreiciate hearing from you.
 
 
  Cheers
 
 
  -
  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




Displaying decimal places using a TextFieldFloat

2010-12-06 Thread Ian Marshall

I use a TextFieldFloat as shown below. Since this field represents a
currency unit (in this case, pound sterling) I want to have two decimal
places shown always. For example:
  0.00
  5.00
  6.10
  3.28.

What I find when I run my web application is that, after form submission,
the model's Float value is always shown without any trailing zeroes in the
decimals. To use the same examples again, I get:
  0
  5
  6.1
  3.28.

Is there anything simple I can do to get my component to display two decimal
places always?

(Failing this, I intend to work around my problem by changing the
TextFieldFloat to a TextField with a String for its model, and converting
this String to a Float value myself after form submission.)


HTML mark-up

  lt;input type=text wicket:id=flPriceInPounds size=10/gt;


Java code (within a WebPage)

  Form frmForm = new Form(frmForm)
  {
[...]
  };
  frmForm.setModel(new CompoundPropertyModel([...]));
  add(frmForm);

  TextFieldFloat txtMriceInPounds =
   new TextFieldFloat(flPriceInPounds, Float.class);
  frmForm.add(txtPriceInPounds);


Java code: declaration within the form's compound property model

  public Float flPriceInPounds = null;


Regards,

Ian Marshall
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Displaying-decimal-places-using-a-TextField-Float-tp3074547p3074547.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: Displaying decimal places using a TextFieldFloat

2010-12-06 Thread Igor Vaynberg
you can keep the field as float and give it its own converter that
always shows two decimal places

-igor

On Mon, Dec 6, 2010 at 4:38 PM, Ian Marshall ianmarshall...@gmail.com wrote:

 I use a TextFieldFloat as shown below. Since this field represents a
 currency unit (in this case, pound sterling) I want to have two decimal
 places shown always. For example:
  0.00
  5.00
  6.10
  3.28.

 What I find when I run my web application is that, after form submission,
 the model's Float value is always shown without any trailing zeroes in the
 decimals. To use the same examples again, I get:
  0
  5
  6.1
  3.28.

 Is there anything simple I can do to get my component to display two decimal
 places always?

 (Failing this, I intend to work around my problem by changing the
 TextFieldFloat to a TextField with a String for its model, and converting
 this String to a Float value myself after form submission.)


 HTML mark-up
 
  lt;input type=text wicket:id=flPriceInPounds size=10/gt;


 Java code (within a WebPage)
 
  Form frmForm = new Form(frmForm)
  {
    [...]
  };
  frmForm.setModel(new CompoundPropertyModel([...]));
  add(frmForm);

  TextFieldFloat txtMriceInPounds =
   new TextFieldFloat(flPriceInPounds, Float.class);
  frmForm.add(txtPriceInPounds);


 Java code: declaration within the form's compound property model
 
  public Float flPriceInPounds = null;


 Regards,

 Ian Marshall
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Displaying-decimal-places-using-a-TextField-Float-tp3074547p3074547.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: Displaying decimal places using a TextFieldFloat

2010-12-06 Thread Pedro Santos
Hi Ian, you can provide an BigDecimalConverter that works with an
NumberFormat with its minimumFractionDigits setted to 2

On Mon, Dec 6, 2010 at 12:38 PM, Ian Marshall ianmarshall...@gmail.comwrote:


 I use a TextFieldFloat as shown below. Since this field represents a
 currency unit (in this case, pound sterling) I want to have two decimal
 places shown always. For example:
  0.00
  5.00
  6.10
  3.28.

 What I find when I run my web application is that, after form submission,
 the model's Float value is always shown without any trailing zeroes in the
 decimals. To use the same examples again, I get:
  0
  5
  6.1
  3.28.

 Is there anything simple I can do to get my component to display two
 decimal
 places always?

 (Failing this, I intend to work around my problem by changing the
 TextFieldFloat to a TextField with a String for its model, and converting
 this String to a Float value myself after form submission.)


 HTML mark-up
 
  lt;input type=text wicket:id=flPriceInPounds size=10/gt;


 Java code (within a WebPage)
 
  Form frmForm = new Form(frmForm)
  {
[...]
  };
  frmForm.setModel(new CompoundPropertyModel([...]));
  add(frmForm);

  TextFieldFloat txtMriceInPounds =
   new TextFieldFloat(flPriceInPounds, Float.class);
  frmForm.add(txtPriceInPounds);


 Java code: declaration within the form's compound property model
 
  public Float flPriceInPounds = null;


 Regards,

 Ian Marshall
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Displaying-decimal-places-using-a-TextField-Float-tp3074547p3074547.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Display component feedback message once: safety net renders them always before

2010-12-06 Thread Pedro Santos
Hi Joseph, I use an ComponentFeedbackPanel next to the component when I want
its feedback message presented in an special place.

On Thu, Dec 2, 2010 at 9:52 AM, Joseph Pachod j...@thomas-daily.de wrote:

 Hi

 I'm trying to apply the behaviors presented by Alastair Maw in his
 presentation Wicket Forms
 with Flair (cf
 http://code.google.com/p/londonwicket/downloads/detail?name=LondonWicket-FormsWithFlair.pdfcan=2q=)

 Basically, Alastair uses behavior to display feedback message specific to
 some components next to the component in question.

 We use our components in form with feedback panel, for non component
 specific messages.

 Overall, we would like these functionalities:
 A - no message should be rendered twice
 B - no message should be left unrendered (safety net)
 C - component specific message should be rendered next to their component
 D - when some messages were displayed next to their components, the
 feedback panel should display a message for it (like one of more input
 didn't validate, please check them)

 In order to try to achieve that, I used the FeedbackMessage.isRendered()
 method in both the behaviors and the feedback panel IFeedbackMessageFilter.

 However, it looks like the feedback panel is always the first to be
 rendered, whatever the components ordering. As such, it always get to render
 first the feedback messages.

 I tried to use only behavior based feedback messages display, but looks
 like the behavior added on the top level elements also always get rendered
 first.

 Next stuff coming in my mind is to keep track of all these behaviors to be
 able to ask each of these if they would render some message. Doing so in the
 safety net component would allow to avoid duplicates. However, this feels
 poor to do (list to give around or to access somehow in the background,
 maybe through some thread local container).

 so, the big question: is there a nice and easy way to do that ? Anything
 better than this behavior tracking stuff is welcome ;)

 best
 --

 Joseph Pachod
 IT

 THOMAS DAILY GmbH
 Adlerstraße 19
 79098 Freiburg
 Deutschland
 T  + 49 761 3 85 59 506
 F  + 49 761 3 85 59 550
 E  joseph.pac...@thomas-daily.de
 www.thomas-daily.de

 Geschäftsführer/Managing Directors:
 Wendy Thomas, Susanne Larbig
 Handelsregister Freiburg i.Br., HRB 3947

 Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für
 die TD Morning News, eine kostenlose Auswahl aktueller Themen aus TD
 Premium, morgens ab 9:15 in Ihrer Mailbox.

 Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt
 unsere Redaktion unter redakt...@thomas-daily.de entgegen.
 Redaktionsschluss für die TD Morning News ist täglich um 8:45.

 Register free of charge at https://www.thomas-daily.de/user/sign-in to
 have the TD Morning News, a selection of the latest topics from TD Premium,
 delivered to your mailbox from 9:15 every morning.

 Our editorial department receives the latest press releases for the TD
 Morning News and TD Premium at redakt...@thomas-daily.de. The editorial
 deadline for the TD Morning News is 8.45am daily.


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




-- 
Pedro Henrique Oliveira dos Santos


Re: Extending Wicket's Button class to do some extra styling

2010-12-06 Thread Pedro Santos
sure

On Fri, Dec 3, 2010 at 12:21 PM, Stefan Droog sdr...@educator.eu wrote:

 Thanks for your reply but I prefer to add the image and label via

 add(new Image(..,...));
 add(new Label(..,..));

 Instead of replacing the body.

 Is that possible as well?

 Stefan


 2010/12/3 Alexander Morozov alexander.v.moro...@gmail.com

 
 
  class StyledButton extends Button {
 
   public StyledButton(...) {
super();
add(new SimpleAttributeModifier(class, positive));
   }
 
   @Override
   protected void onComponentTagBody(MarkupStream markupStream,
 ComponentTag
  openTag) {
replaceComponentTagBody(markupStream, openTag,  );
   }
 
  }
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Extending-Wicket-s-Button-class-to-do-some-extra-styling-tp3071023p3071104.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
 
 




-- 
Pedro Henrique Oliveira dos Santos


Re: Displaying decimal places using a TextFieldFloat

2010-12-06 Thread Ian Marshall

Thanks Igor and Pedro. I'll do that.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Displaying-decimal-places-using-a-TextField-Float-tp3074547p3074627.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: Initiating File Download through Ajax is not working

2010-12-06 Thread Jonathan Proulx
Hello

In the AJAXDownload class, the appended javascript window.location.href... 
will make the browser display a warning on top to prevent file download.
If I select the warning then try to download the file, it doesn't work, the 
file download dialog never popup.
The second time I trigger the download it works.

Anybody knowns a way to avoid browser warning without modifying browser options?

Or is there another way to initiate file download through ajax?

Thanks
Jonathan


Jonathan Proulx, Programmer Analyst /

bluberi gaming technologies inc.
Drummondville, Quebec Canada
819.475.5155 (telephone) 819.475.5156 (fax) bluberi.com

--
This e-mail and any attachments transmitted with it are personal, privileged 
and confidential and solely for the use of the individual to whom they are 
addressed and intended. If you have received this e-mail in error, please 
notify the sender by return e-mail. If you are not the intended recipient or if 
you believe that you are not, you are hereby notified that the dissemination, 
distribution, plagiarism or copying of this e-mail and attachments transmitted 
with it is strictly prohibited.

Ce courriel et les pièces jointes s’y rattachant sont de nature personnelle, 
privilégiée et confidentielle et pour l’usage exclusif du destinataire à qui 
ils sont adressés et destinés. Si vous avez reçu ce courriel par erreur, 
veuillez s’il vous plaît le renvoyer à l’expéditeur. Si vous n’êtes pas le bon 
destinataire ou si vous croyez ne pas l’être, nous vous informons immédiatement 
que la publication, distribution, diffusion, copie ou plagiat de ce courriel et 
de ses pièces jointes sont strictement interdits.
--
-Message d'origine-


De : val360 [mailto:val_wic...@360works.com]
Envoyé : 3 décembre 2010 16:42
À : users@wicket.apache.org
Objet : Re: Initiating File Download through Ajax is not working


final AJAXDownload download = new AJAXDownload() {
  @Override
  protected IResourceStream getResourceStream() {
return new FileResourceStream(theDatabase.getFile());
  }

  @Override
  protected String getFileName() {
return theDatabase.getFile().getAbsoluteFile().getName();  //FIX!!! the
filename gets .html appended to it.
  }
};
add(download);

add( new AjaxLink(download) {
public void onClick( AjaxRequestTarget target ) {
if( theDatabase.isOpen() ) {
target.appendJavascript( alert('The database is open, 
close or pause the
db first.'); );
} else {
download.initiate( target );
}
}
});

And this class is unchanged:

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AbstractAjaxBehavior;
import
org.apache.wicket.request.target.resource.ResourceStreamRequestTarget;
import org.apache.wicket.util.resource.IResourceStream;

/**
 * @author Sven Meier
 * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
 */
public abstract class AJAXDownload extends AbstractAjaxBehavior
{
/**
 * Call this method to initiate the download.
 */
public void initiate(AjaxRequestTarget target)
{
CharSequence url = getCallbackUrl();

target.appendJavascript(window.location.href=' + url + ');
}

public void onRequest()
{
getComponent().getRequestCycle().setRequestTarget(
new 
ResourceStreamRequestTarget(getResourceStream(), getFileName()));
}

/**
 * @see ResourceStreamRequestTarget#getFileName()
 */
protected String getFileName()
{
return null;
}

/**
 * Hook method providing the actual resource stream.
 */
protected abstract IResourceStream getResourceStream();
}
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Initiating-File-Download-through-Ajax-is-not-working-tp2289784p3071816.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: Initiating File Download through Ajax is not working

2010-12-06 Thread Ernesto Reinaldo Barreiro
Not sure there is a way to overcome that limitation without modifying
browser options. Maybe then it is safer to use another approach like
use AJAX to present a floating dialog with a normal download link.
 Users will need one more click but hat will certainly work for all
browsers and/or settings.

Regards,

Ernesto

On Mon, Dec 6, 2010 at 5:30 PM, Jonathan Proulx
jonathan.pro...@bluberi.com wrote:
 Hello

 In the AJAXDownload class, the appended javascript window.location.href... 
 will make the browser display a warning on top to prevent file download.
 If I select the warning then try to download the file, it doesn't work, the 
 file download dialog never popup.
 The second time I trigger the download it works.

 Anybody knowns a way to avoid browser warning without modifying browser 
 options?

 Or is there another way to initiate file download through ajax?

 Thanks
 Jonathan


 Jonathan Proulx, Programmer Analyst /

 bluberi gaming technologies inc.
 Drummondville, Quebec Canada
 819.475.5155 (telephone) 819.475.5156 (fax) bluberi.com

 --
 This e-mail and any attachments transmitted with it are personal, privileged 
 and confidential and solely for the use of the individual to whom they are 
 addressed and intended. If you have received this e-mail in error, please 
 notify the sender by return e-mail. If you are not the intended recipient or 
 if you believe that you are not, you are hereby notified that the 
 dissemination, distribution, plagiarism or copying of this e-mail and 
 attachments transmitted with it is strictly prohibited.

 Ce courriel et les pièces jointes s’y rattachant sont de nature personnelle, 
 privilégiée et confidentielle et pour l’usage exclusif du destinataire à qui 
 ils sont adressés et destinés. Si vous avez reçu ce courriel par erreur, 
 veuillez s’il vous plaît le renvoyer à l’expéditeur. Si vous n’êtes pas le 
 bon destinataire ou si vous croyez ne pas l’être, nous vous informons 
 immédiatement que la publication, distribution, diffusion, copie ou plagiat 
 de ce courriel et de ses pièces jointes sont strictement interdits.
 --
 -Message d'origine-


 De : val360 [mailto:val_wic...@360works.com]
 Envoyé : 3 décembre 2010 16:42
 À : users@wicket.apache.org
 Objet : Re: Initiating File Download through Ajax is not working


 final AJAXDownload download = new AJAXDownload() {
 �...@override
  protected IResourceStream getResourceStream() {
        return new FileResourceStream(theDatabase.getFile());
  }

 �...@override
  protected String getFileName() {
        return theDatabase.getFile().getAbsoluteFile().getName();  //FIX!!! the
 filename gets .html appended to it.
  }
 };
 add(download);

 add( new AjaxLink(download) {
        public void onClick( AjaxRequestTarget target ) {
                if( theDatabase.isOpen() ) {
                        target.appendJavascript( alert('The database is open, 
 close or pause the
 db first.'); );
                } else {
                        download.initiate( target );
                }
        }
 });

 And this class is unchanged:

 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.behavior.AbstractAjaxBehavior;
 import
 org.apache.wicket.request.target.resource.ResourceStreamRequestTarget;
 import org.apache.wicket.util.resource.IResourceStream;

 /**
  * @author Sven Meier
  * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
  */
 public abstract class AJAXDownload extends AbstractAjaxBehavior
 {
        /**
         * Call this method to initiate the download.
         */
        public void initiate(AjaxRequestTarget target)
        {
                CharSequence url = getCallbackUrl();

                target.appendJavascript(window.location.href=' + url + ');
        }

        public void onRequest()
        {
                getComponent().getRequestCycle().setRequestTarget(
                                new 
 ResourceStreamRequestTarget(getResourceStream(), getFileName()));
        }

        /**
         * @see ResourceStreamRequestTarget#getFileName()
         */
        protected String getFileName()
        {
                return null;
        }

        /**
         * Hook method providing the actual resource stream.
         */
        protected abstract IResourceStream getResourceStream();
 }
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Initiating-File-Download-through-Ajax-is-not-working-tp2289784p3071816.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: 

IndexedSharedResourceCodingStrategy.encode not being called

2010-12-06 Thread Doug Leeper
I have mounted an IndexedSharedResourceCodingStrategy in my WebApplication as 
such:

getSharedResources().add(photo, new BusinessPhotoSharedResource());
mount(new IndexedSharedResourceCodingStrategy(photo, photo) );

and I have created an Image with the appropriate resource ref and ValueMap.

ValueMap valueMap = new ValueMap();
valueMap.add(0, photoId.getBusinessID().toString());
valueMap.add(1, photoId.getContentID().toString());

   add( new Image( photo, new ResourceReference(Application.class, 
photo), valueMap ) );


but the generated URL for that image is not created as expected.

Generated:
src=resources/app/photo?0=508241=1401

Expected:
src=resources/app/50824/1401/photo

Is there something I am missing?

I set a break point in Eclipse in the encode and it never reached that break 
point.

Any help is appreciated.

Thanks
- Doug


Re: FormComponentPanel + unknown collection type

2010-12-06 Thread alex shubert
Anyone? (

On 6 December 2010 15:59, alex shubert alex.shub...@gmail.com wrote:
 Hello!

 I got a problem with type mysmatch then implementing custom component.

 First of all, the code^
 public class EnumCheckGroupT extends Enum extends
 FormComponentPanelCollectionT {
 
  public EnumCheckGroup(final String id, final IModel? extends
 CollectionT model, final ClassT enumClass) {
        //noinspection unchecked
        super(id, (IModelCollectionT) model);

        group = new CheckGroupT(checkgroup, model);
 ...
 }

 That model comes from:
 CompoundPropertyModelGroup formModel = new
 CompoundPropertyModelGroup(service.createGroup());
 ..
  EnumCheckGroup checkGroup = new EnumCheckGroup(roles,
 formModel.bind(roles), RoleEnum.class);

 Roles is a set of Enum and has getter and setter like  Set getRoles /
 Group setRoles(Set)

 all of that renders already filled Set without problems, but fails to
 set with type mismatch. PropertyResolver#setValue receives value as
 ArrayList while property is a Set.
 If I call setType(getModelObject.getClass) on CheckGroup it tryes to
 convert every Check to PersistentSet (hibernate proxy for a Set) so it
 doesnt look like a solution.

 Call of setType(getModelObject.getClass) in beforeRender() changes nothing.

 Any ideas? Thanks in advance...
 --
 Best regards
 Alex




-- 
Best regards
Alex

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



Re: FormComponentPanel + unknown collection type

2010-12-06 Thread alex shubert
Oh, I fouled myself
There nothing to do with setType at all and WiA uses explicit call
only instead of generics.

So, if there are code such as mine, all one have to do is properly
assembly object on it's way to model.

private CollectionT modelField;

@Override
protected void onInitialize() {
super.onInitialize();
collection = getModelObject();
}

@Override
protected void convertInput() {
collection.clear();
collection.addAll(group.getConvertedInput());
setConvertedInput(collection);
}
}

The solution was prompted by #updateModel()

God bless open source and all  Wicket authors =))

-- 
Best regards
Alex

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



Component wiring mess in 'HomePage'

2010-12-06 Thread Peter Karich

 Hi,

I have some components and I'm wiring them together directly within a 
300 lines init method in the HomePage class **
Now this method is 'a bit' lengthy and unreadable. How would you make it 
more maintainable?


Regards,
Peter.

**
https://github.com/karussell/Jetwick/blob/master/src/main/java/de/jetwick/ui/HomePage.java

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



Best Pattern for Admin Pages and User Pages

2010-12-06 Thread Taner Diler
Hi all,

I'm writing a blog application. as all blog applications it has an admin
module. I wrote two abstract page : AdminPage and BlogPage. the differencies
between them are menu, left/right panels and also screen styles. This make
me develope duplicate pages for admin and blog.

So how can I reduce code duplication, what is the best solution for it?

Thanks


Re: Component wiring mess in 'HomePage'

2010-12-06 Thread Hans Lesmeister
Hi,

 I have some components and I'm wiring them together directly within a
 300 lines init method in the HomePage class **
 Now this method is 'a bit' lengthy and unreadable. How would you make it
 more maintainable?

I always try to identify logical groups and delegate creation of those to
separat private methods. And use Panels for reusability.

Cheers
Hans



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



Re: Best Pattern for Admin Pages and User Pages

2010-12-06 Thread Altuğ Bilgin Altıntaş
You can add css object programatically.

https://cwiki.apache.org/WICKET/including-css-resources.html

altug



2010/12/6 Taner Diler jtdde...@gmail.com

 Hi all,

 I'm writing a blog application. as all blog applications it has an admin
 module. I wrote two abstract page : AdminPage and BlogPage. the
 differencies
 between them are menu, left/right panels and also screen styles. This make
 me develope duplicate pages for admin and blog.

 So how can I reduce code duplication, what is the best solution for it?

 Thanks



multipart form with base domain altered

2010-12-06 Thread Paul Wong
Hi,

We've just started to use Wicket in the team, and it's been great!

Currently we're having an issue with base domain (altered) on multipart
forms which has Ajax submits.

Our application runs on abc.subdomain.domain.com
We need to update the domain to domain.com to interact with an external
application within the same domain.

After looking into the generated HTML, wicket creates an iFrame when the
form is multipart and contains ajax buttons/submits.

Because the base page has altered the document.domain to domain.com, all
submits for the ajax buttons ceases to work.

Is there a way to set the document.domain for the iFrame?

Thanks,
Paul


Re: Component wiring mess in 'HomePage'

2010-12-06 Thread James Carman
Create components out of some of the groups of components that
logically belong together?

On Mon, Dec 6, 2010 at 4:37 PM, Hans Lesmeister
hans.lesmeis...@lessy-software.de wrote:
 Hi,

 I have some components and I'm wiring them together directly within a
 300 lines init method in the HomePage class **
 Now this method is 'a bit' lengthy and unreadable. How would you make it
 more maintainable?

 I always try to identify logical groups and delegate creation of those to
 separat private methods. And use Panels for reusability.

 Cheers
 Hans



 -
 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: reverse proxy / http / https

2010-12-06 Thread Markus
Hi Martin

Sysadmins were trying to change location header to https in
ProxyPassReverse, but was not working.

Thanks a lot for helping.

Markus

On 06.12.2010 12:21, Martin Makundi wrote:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Link-with-proxy-server-wrong-hostname-td1878181.html
 http://www.mail-archive.com/users@wicket.apache.org/msg32818.html

 2010/12/6 Markus Meixner m.simb...@gmail.com:
   
 Hi everybody

 Perhaps this is more a apache reverse proxy configuration thing, but
 perhaps you can help me anyway.

 My application runs behind a reverse proxy, which is terminating https
 request and forwarding http requests to the wicket application.

 If wicket now responds with redirects, it does this with absolute links
 http://host/context-path/ which is normally fine and working.

 Problem now is, that those redirects are passed to the client and are
 not changed to https://host/context-path/ which will break the redirects.

 Question: Is there an easy way to change the URLs protocol/scheme of the
 redirects from http to https? And where could I do this?

 Thanks anybody for help.

 Markus

 -
 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