Re: continueToOriginalDestination issue

2013-10-02 Thread shimin_q
I enter URL "http:///awol"  which should direct to my
application's home page which is set to be MainPage.class:

My Application class sets the home page to be MainPage:

public Class getHomePage() {
 return MainPage.class;
 }

 @Override
 protected Class getSignInPageClass() {
return HomePage.class;
}

I used to check continueToOriginalDestination() return code and
setResponsePage(MainPage.class) if it is false.  But
continueToOriginalDestination() no longer returns a code.  Marcel suggested
that I would just call both one after another, as the following:

continueToOriginalDestination();
setResponsePage(new MainPage());

if continueToOriginalDestination() finds the originalDestination, it will
throw an exception to go on to that originalDestination.  The
setResponsePage() won't get called.

Is this what you were suggesting by "send your user to a default home page"? 
Other than this, is my code converting a Form to a StatelessForm looking all
right?  Thanks for your help!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661669.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: continueToOriginalDestination issue

2013-10-02 Thread shimin_q
Thanks - that sounds exactly what I observed in my case where the login page
(HomePage class) gets redisplayed after I entered the user name and
password.

I am looking at some sample code with Stateless login forms, in addition to
using StatelessForm instead Form, a bind() is called too after
authenticate().  So I changed my LoginForm as follows (note that LoginForm
is part of my HomePage class):

public class LoginForm extends StatelessForm {

private static final Logger logger =
LoggerFactory.getLogger(LoginForm.class);

private static final long serialVersionUID = 1L;

private TextField username;
private PasswordTextField password;

public LoginForm(String id) {
super(id, new CompoundPropertyModel(new Login()));

username = new TextField("username");
username.setRequired(true);
add(username);
password = new PasswordTextField("password");
add(password);
}

@Override
protected void onSubmit() {
Login login = getModelObject();

AuthenticatedWebSession session = AuthenticatedWebSession.get();
if(session instanceof AwolAuthenticatedWebSession) {
logger.debug("session is AwolAuthenticatedWebSession");
}
if (session.authenticate(login.getUsername(), 
login.getPassword())) {
logger.debug("authentication successful");
if (session.isTemporary()) {
logger.debug("session temporary, bind to 
permanent");
session.bind();  // according to sample code, 
this makes the temporary
session used by the stateless login page permanent
} 

this.continueToOriginalDestination();
}
else {
error("Invalid credentials");
}
}

But this code change does not seem to work either.  The first time I log in,
the session.isTemporary returns true, so it did session.bind().  But after
continueToOriginalDestination(), it is still the login page displayed, it
does not go on to MainPage.  If I enter username/password again, this time,
the code seems to get a session.isTemporary returns false, and
continueToOriginalDestination() still does not go on to MainPage.

Anything else I am missing here?  Thanks for your help!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661667.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: continueToOriginalDestination issue

2013-10-02 Thread shimin_q
Just to make sure the problem I am seeing is due to the timed out Login
page...when you say 

"the original login page displayed would have timed out and the attempted
login wont succeed."

When your attempted login failed, does another page come up with some
generic browser error message or does it stay on the login page?

In my case, after I entered the username/password, it just stays on the
login page without the "Invalid credentials" error for failed
authentication.  That was why I suspected my authenticate() was OK, it was
the continueToOriginalDestination() not continuing on.  

Thanks for the help as I try to figure this out!!

Shi-Min



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661665.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: continueToOriginalDestination issue

2013-10-02 Thread shimin_q

OK, could it be as simple as changing the following line:

public class LoginForm extends Form 

to 

public class LoginForm extends StatelessForm

as you can see my login page (HomePage class) is really simple (only 3
components: a label, a LoginForm, a FeedbackPanel), right?

Thanks,
Shi-Min



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661664.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: continueToOriginalDestination issue

2013-10-02 Thread shimin_q
This could explain the intermittent nature of the problem.  Thanks, Nick! 
Could you elaborate on what you mean by stateless login page?  Here is my
Login page and Login Form inside it.  Could you please tell me what I need
to change?

public class HomePage extends WebPage {

public HomePage() {
add(new Label("headerMessage", "OmniVista 8770 Login"));

add(new LoginForm("form"));

add(new FeedbackPanel("feedback"));
}

}

public class LoginForm extends Form {

private static final Logger logger =
LoggerFactory.getLogger(LoginForm.class);

private static final long serialVersionUID = 1L;

private TextField username;
private PasswordTextField password;

public LoginForm(String id) {
super(id, new CompoundPropertyModel(new Login()));

username = new TextField("username");
username.setRequired(true);
add(username);
password = new PasswordTextField("password");
add(password);
}

@Override
protected void onSubmit() {
Login login = getModelObject();

AuthenticatedWebSession session = AuthenticatedWebSession.get();
if (session.authenticate(login.getUsername(), 
login.getPassword())) {
logger.debug("authentication successful");
this.continueToOriginalDestination();
}
else {
error("Invalid credentials");
}
}

}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661662.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: continueToOriginalDestination issue

2013-10-02 Thread shimin_q
Hi Martin, 

No, I did not use that.  

My understanding is that the URL ("http:///awol") takes me to
my app's home page (MainPage.class), but is intercepted by the login page
(HomePage.class in my case).  After login is successful, the
continueToOriginalDestination() SOMETIMES does not seem to continue on to
MainPage.  

I am not sure how the interception happened and why sometimes
continueToOriginalDestination() does not continue on.  I am really new to
wicket...

Could you please let me know what caused this intermittent problem? 

Thanks,
Shi-Min




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661658.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: continueToOriginalDestination issue

2013-10-02 Thread shimin_q
Here is the flow of my app:

My Application class sets the home page to be MainPage:

> public Class getHomePage() {
> return MainPage.class;
> }
>
> @Override
> protected Class getSignInPageClass() {
> return HomePage.class;
> }
> 

So whenever I type the following URL

"http:///awol"

(
/awol is defined in apache httpd conf to be the location for my app: 

ProxyPass ajp://localhost:8010/awol
ProxyPassReverse ajp://localhost:8010/awol

)


it goes to my MainPage which is specified as the application's home page. 
And it is intercepted by the HomePage (which contains LoginForm).  The
intermittent problem for me is it appears the
continueToOriginalDestination() does not take me to MainPage after
authentication is successful.

Hope it clarifies.  Any ideas?

Thanks!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661657.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



continueToOriginalDestination issue

2013-10-02 Thread shimin_q
Hello,

My homepage URL is "http:///awol", and it is linked to
MainPage.html and MainPage.java.  I also have a HomePage.html/HomePage.java
that is essentially a login page and contains a LoginForm. 

public Class getHomePage() {
return MainPage.class;
}

@Override
protected Class getSignInPageClass() {
return HomePage.class;
}

 I use continueToOriginalDestination() once LoginForm submitted
username/password and was authenticated:

protected void onSubmit() {
Login login = getModelObject();

AuthenticatedWebSession session = AuthenticatedWebSession.get();
if (session.authenticate(login.getUsername(), 
login.getPassword())) {
logger.debug("authentication successful");
this.continueToOriginalDestination();
}
else {
error("Invalid credentials");
}
}

I am expecting that continueToOriginalDestination would take me to the
MainPage after user successfully logged in, but intermittently,
continueToOriginalDestination() just stays on the HomePage (with the
LoginForm) even after the user name/password is authenticated.

What could be the issue?  Please help!!

Thanks!!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654.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: How to add line breaks in the summary text of Wizard properties file

2013-08-01 Thread shimin_q
Thanks Paul!  For now, creating a MultiLineHeader class to replace Header
class, as Sven suggested, did the trick.  But I will keep your point in mind
for any future customization of the default Wizard.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4660626.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: How to add line breaks in the summary text of Wizard properties file

2013-08-01 Thread shimin_q
That was it!  How did I not think of this?  :-)  Thanks Sven!

The only issue, as I found out quickly, is that I have to introduce the
MultiLineHeader inner class in many of my classes that extend WizardStep. 
And since wicket id does not support different namespaces, I will have to
use different wicket ids for the MultiLineLabels for each class.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4660625.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: How to add line breaks in the summary text of Wizard properties file

2013-07-31 Thread shimin_q
Thanks for the suggestion!  Yes, I am extending WizardStep.  Here is what I
did to my code following your suggestion (the Header class is a final class,
so I had to create a new MultiLineHeader class extends Panel directly to add
new MultiLineLabel instead of the default new Label line in Header class. 
But I am getting error:

2013-07-31 16:35:45,813 [5245418@qtp-15847288-0] ERROR
org.apache.wicket.DefaultExceptionMapper  - Unexpected error occurred
org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup file
associated. MultiLineHeader: [MultiLineHeader [Component id = header]]
at
org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97)
at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:447)

Here is the code I put in:

private final class OXEDetailsStep extends WizardStep implements
ICondition
{
private static final long serialVersionUID = 1L;
/**
 * Construct.
 */
public OXEDetailsStep()
{
  ...
 }

public Component getHeader(final String id, final Component parent,
final IWizard wizard)
{
return new MultiLineHeader(id, wizard);
}


private final class MultiLineHeader extends Panel
{
private static final long serialVersionUID = 1L;

/**
 * Construct.
 * 
 * @param id
 *The component id
 * @param wizard
 *The containing wizard
 */
public MultiLineHeader(final String id, final IWizard wizard)
{
super(id);
setDefaultModel(new 
CompoundPropertyModel(wizard));
add(new MultiLineLabel("title", new 
AbstractReadOnlyModel()
{
private static final long serialVersionUID = 1L;

@Override
public String getObject()
{
return getTitle();
}
}));
add(new MultiLineLabel("summary", new 
AbstractReadOnlyModel()
{
private static final long serialVersionUID = 1L;

@Override
public String getObject()
{
return getSummary();
}
}));
}
}

}

Any ideas about the error?

Thanks so much for your help!






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4660595.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



How to add line breaks in the summary text of Wizard properties file

2013-07-31 Thread shimin_q
Hi,

I am using wicket Wizard extension to create a create metaprofile wizard.  I
am having trouble incorporating line breaks in the summary text of the
properties file.  As you can see below, the summary text for the steps are
long, and I intended to break into several lines, but  does not seem to
work:

NewMetaProfileWizard.properties:

otstep2.summary=Based on the OT node you selected ('$\{otNodeName\}'), you
must further define the following properties that are available on the node:
 (1) a free directory number range,  (2) a site linking the OT
node to an OXE node,  (3) an OT user template  For (1)-(6), you
will be prompted with a list of options available for that property. The
options for (1)-(3) are also configurable on the node, please consult the
user guide to configure those options on the OT node and perform a sync
operation for the node before proceeding with the metaprofile creation.
otstep3.title=Define OT Properties (Step 3)
otstep3.summary=Last step in creating an OT metaprofile: please define the
following properties:  (1) an OXE user profile available on the OXE
node linked via site,  and optionally, (2) a SIP domain name,  (3)
a voice mail server  (4) a voice mail profile nameFor (1), if
you want an OXE user profile that is not in the list, you can configure a
user profile on the OXE node linked by the site.  A sync operation for the
node should be performed before proceeding with the metaprofile creation.

Any ideas or suggestions would be appreciated!!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589.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: AjaxFormComponentUpdatingBehavior onUpdate() not triggered sometimes

2013-01-15 Thread shimin_q
Thanks, Martin.  I use wicket 6.3.0.  I know 6.4.0 is out now, which jquery
version that goes with 6.4.0?

I tried putting the drop down directly under Form, it did not work, so that
was not the problem.  I will try changing the event name as you suggested.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-onUpdate-not-triggered-sometimes-tp4655361p4655404.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



AjaxFormComponentUpdatingBehavior onUpdate() not triggered sometimes

2013-01-14 Thread shimin_q
Hi,

I have a DropDownChoice that I  implemented an
AjxFormComponentUpdatingBehavior onUpdate() method.  I have been battling
with a problem with its onUpdate() not being triggered/executed every time
user selects a choice from the DropDownChoice.  In Firefox, it sometimes is
triggered, sometime not; in IE9/Safari/Chrome, it's not triggered at all.  

Now I have another DropDownChoice with onUpdate() behavior implemented, it
seems to work every time.  The only difference I can see is that this
DropDownChoice is directly placed in a Form; while the one that does not
work is placed in a table under a Form. 

The one that works:




 
Profile Type:

default
OXE
OT



The one that does not work some times:





  
 
 
 User Type
 
  default
   OXE
   OT
 


The java code for two DropDownChoice is similar, where userTypeBox is a
DropDownChoice component:

userTypeBox.add(new 
AjaxFormComponentUpdatingBehavior("onChange") {
private static final long serialVersionUID = 1L;
protected void onUpdate(AjaxRequestTarget target) {
resetFieldsPerUserType(target);
target.add(salutationRow);
target.add(firstNameRow);
target.add(lastNameRow);
target.add(metaProfileRow);

Anyone can tell me if being directly under a Form or not would make the
difference here?  Thanks!!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-onUpdate-not-triggered-sometimes-tp4655361.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: wicket-extensions Wizard buttons not working

2013-01-11 Thread shimin_q
Unfortunately, overriding the newForm() of Wizard as suggested did not do the
trick.   Actually none of the buttons (Next, Cancel, Previous, ...) is
working so my initial hunch was incorrect.  

Could you provide the location of the Wizard source code for wicket 6.x?  

In the 1.5 version, I see a addDefaultCssStyle flag for Wizard, which by
default is true.  I wonder if it might be a problem when I use the jquery
mobile css



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-extensions-Wizard-buttons-not-working-tp4655280p4655299.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: wicket-extensions Wizard buttons not working

2013-01-11 Thread shimin_q
Thanks for your suggestions!  I am trying to locate the source code for the
Wicket-extensions Wizard, and found the following at 

http://svn.apache.org/viewvc/wicket/branches/wicket-1.5.x/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/Wizard.java?view=markup

I am using Wicket 6.3.0, is this the right place for the wicket-extensions
code?  I guess if Wizard code hasn't been changed since 1.5, I am looking at
the right code here:

 protected  Form newForm(final String id)
{
return new Form(id);
}

So i could overwrite this and do "return new MyForm(id)" instead, where
MyForm has an empty appendDefaultButtonField().   I hope taking out this
won't affect the other Wizard functionalities.  

I will give it a try and let you know.  Thanks!!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-extensions-Wizard-buttons-not-working-tp4655280p4655291.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



wicket-extensions Wizard buttons not working

2013-01-10 Thread shimin_q
Hi,

I am using the Wizard in 6.3.0 wicket-extensions in my code.  After I
switched the header includes to Jquery Mobile CSS and js, the buttons in the
Wizard stopped working, i.e., clicking on them does not appear to do
anything.  I think I might have to step through the Wizard source to see
what the problem lies or find out if there is anything I could do to get
those buttons working again.  My questions are two fold:

1) Has anyone used the Wicket Wizard with Jquery Mobile header includes? Did
anyone hit the same problem with the Wizard buttons?  My suspicion, by
looking at the generated html below is that jquery mobile does not like this
part of the script:->  is it possible for me to modify this?



2) How do I obtain the Wizard source code so I can step through?

For your reference, here is the generated final html for my first WizardStep
page (you can see I basically just commented out the original header, and
added the jquery and jquery mobile headers)

http://wicket.apache.org/";>



http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css"; />  
  
  

Metaprofile Creation Wizard





 

 
  
 

  Cancel <./metaprofilehelp?0-1.ILinkListener-back>  

 
 
Metaprofile Creation Wizard

  
  
 [back to the wizard index] <./8770uum>  
  

  
http://wicket.apache.org";>


 

  



   



 

http://wicket.apache.org";>

  Profile
Name and Type
  Create a new metaprofile by
providing a profile name and a profile type.


 
 

http://wicket.apache.org";>
 

  

Profile
Name

  
  

Profile
Type

Choose One
OXE
OXE_WITH_OT
OXE_WITH_ICS
OT
 
  
 


 
 


  

 
 

http://wicket.apache.org";>


  
  
  
  
  



 


   
  
 




  
  

  

  









--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-extensions-Wizard-buttons-not-working-tp4655280.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: Styling lost when a component is set visible during AJAX call

2012-12-10 Thread shimin_q
The two divs are similar in the HTML:





the data-theme attribute determines the style.

The wicket java code for the two divs are similar too, except the second div
was hidden, made visible later in an ajax onUpdate().



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Styling-lost-when-a-component-is-set-visible-during-AJAX-call-tp4654656p4654668.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: Styling lost when a component is set visible during AJAX call

2012-12-10 Thread shimin_q
Thanks, Paul.  

The first  (profileTypeRow) has the correct styling.  The only
difference between the "profileTypeRow"  and the "oxeNodeRow"  is
that "profileTypeRow"'s visibility was never manipulated in the code, so it
is visible throughout while "oxeNodeRow" was initially hidden
(setVisible(false)) then setVisible(true) in the ajax update call.  So I
think the styling got lost when I set the div visible again.  If I took out
the setVisible(false) and setVisible(true) for "oxeNodeRow", it did show up
with the correct styling.

Do you think I need to call some other methods in addition to
setVisible(true) to get the style applied to the newly visible ?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Styling-lost-when-a-component-is-set-visible-during-AJAX-call-tp4654656p4654663.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



Recommended way to hide and show table rows dynamically?

2012-12-06 Thread shimin_q
I have a table that includes only two rows when it is first loaded, but
later, depending on the selected value of the first row, I will need to add
a number of rows to the table.  I assume it is a quite common AJAX task, is
there a recommended way to do this?  My existing way of handing this has run
into an issue where all the DropDownChoice (select option menu on HTML)
components that were dynamically added to the table are unable to display
the selected value after user selection, so I am trying to figure out if it
is due to my existing AJAX code...   (I am using latest wicket 6.3 and
jQuery mobile 1.8.2)

Here is the html portion:





message



  

  
  
  
 
 Metaprofile Type
 
  default
 


 
 Metaprofile 
Name
  
  




 
 OXE Node

  OXENode



 
 Free Number Range
 


 
  Device Type
 
  SIP Extension
 

...


Now the Wicket code for these:

profileTypeBox = new DropDownChoice("type",
new PropertyModel(profile, 
"type"),
Arrays.asList(MetaProfileType.values()),
new IChoiceRenderer() {
private static final long 
serialVersionUID = 1L;
@Override
public Object 
getDisplayValue(MetaProfileType object) {
return object.name();
}
@Override
public String 
getIdValue(MetaProfileType object, int index) {
return object.name();
}
}
);
profileTypeBox.setOutputMarkupId(true);
add(profileTypeBox);
 
profileTypeBox.add(new 
AjaxFormComponentUpdatingBehavior("onChange") {
private static final long serialVersionUID = 1L;
protected void onUpdate(AjaxRequestTarget target) {
resetFieldsPerProfileType(target);
//add any component that will be called in 
resetFieldsPerProfileType()
target.add(oxeNodeAsteriskImg);
target.add(oxeNodeLabel);
target.add(oxeNodeBox);
target.add(rangeAsteriskImg);
target.add(rangeLabel);
target.add(freeNumRangeBox);
target.add(deviceTypeAsteriskImg);
target.add(deviceTypeLabel);
target.add(deviceTypeBox);
//...
};
});

//...
oxeNodeModel = new 
LoadableDetachableModel>() {
private static final long serialVersionUID = 1L;
@Override
protected List load() {
try {
List names = null;
if ((profile!=null) && 
(profile.getType().equals(MetaProfileType.OXE)
|| profile.getType().equals(MetaProfileType.OXE_WITH_OT)))
names = 
getOXENodeList();
if (names == null)
return 
Collections.emptyList();
else {
return names;
}
}
catch (Exception e) {
return Collections.emptyList();
}
}
};
}
oxeNodeBox = new DropDownChoice("oxeNode",
new PropertyModel(profile, "oxeNodeName"), 
oxeNodeModel);   

IChoiceRenderer rendererd = new 
IChoiceRenderer() {
private static final long serialVersionUID = 1L;
  pub

DropDownChoice box does not display the value I selected

2012-11-26 Thread shimin_q
I have a DropDownChoice box that loads a list of values on load(), but when I
selected a value from the list, the selected value does not show up in the
box, even though it appears that getModelObject() does return the correct
value (the value I selected).  It's just the box does not display it.  I use
Wicket 6.3.0, locally tested using jetty server 6.1.26 and FireFox 17.0,
JQuery Mobile 1.2.0, JQuery 1.8.3.  Any suggestions or ideas?

Here is the Wicket code:

IModel> oxeNodeModel = null;
oxeNodeModel = new LoadableDetachableModel>() {
   private static final long serialVersionUID = 1L;
@Override
protected List load() {
try {
List names = null;
if ((profile!=null) && 
(profile.getType().equals(MetaProfileType.OXE) ||
profile.getType().equals(MetaProfileType.OXE_WITH_OT)))
names = getOXENodeList();

if (names == null)
return Collections.emptyList();
else {
return names;
}

}catch (Exception e) {
  return Collections.emptyList();
}
}
};

oxeNodeBox = new DropDownChoice("oxeNode",
new PropertyModel(profile, "oxeNodeName"), 
oxeNodeModel);   

oxeNodeBox.setEnabled(true);
oxeNodeBox.setOutputMarkupId(true);
add(oxeNodeBox);

The html template is:


 
 OXE Node

  OXENode








--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-box-does-not-display-the-value-I-selected-tp4654236.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: AJAX not working after migrating from wicket 1.5.5 to 6.3.0

2012-11-26 Thread shimin_q
Just to add a bit more info.  The newmetaprofile link on the "8770main" page
looks like the following:


  Create <./newmetaprofile>  
   

Any suggestions/ideas for me to try would be appreciated!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065p4654235.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: AJAX not working after migrating from wicket 1.5.5 to 6.3.0

2012-11-26 Thread shimin_q
After a lot of tries, here is what I obeserved so far in my envionment. 
Basically, it appears how the page with AJAX is loaded affects whether AJAX
listeners are enabled on the page.  Could anyone please take a look at below
and let me know why this is the case and what I need to do to fix it? 
Thanks a lot!!

I turned on the web console in my Firefox browser and watched the logging
messages.   

The page with AJAX is "http://127.0.0.1:7999/newmetaprofile";.  The page that
contains a link to the "newmetaprofile" page is
"http://127.0.0.1:7999/8770main";.  When the "newmetaprofile" page is loaded
by clicking on the newmetaprofile link on the "8770main" page, AJAX does not
work.  Here is the log (after the transition from the "8770main" page to the
"newmetaprofile" page, nothing happens)

[13:16:44.637] GET http://127.0.0.1:7999/8770main [HTTP/1.1 200 OK 342ms]
[13:16:54.010] GET http://127.0.0.1:7999/newmetaprofile [HTTP/1.1 302 Found
2766ms]
[13:16:56.886] GET http://127.0.0.1:7999/newmetaprofile?13 [HTTP/1.1 200 OK
37ms]

But if I type "http://127.0.0.1:7999/newmetaprofile"; in the address bar to
load the page manually or if I refresh/reload the
"http://127.0.0.1:7999/newmetaprofile"; page, a whole bunch of things happen
including the ajax scripts being called:

--
[13:18:54.754] GET http://127.0.0.1:7999/newmetaprofile [HTTP/1.1 302 Found
2761ms]
[13:18:57.494] GET http://127.0.0.1:7999/newmetaprofile?14 [HTTP/1.1 200 OK
79ms]
[13:18:57.621] GET
http://127.0.0.1:7999/wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-ver-1353527137996.js
[HTTP/1.1 304 Not Modified 300ms]
[13:18:57.622] GET
http://127.0.0.1:7999/wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1353527137996.js
[HTTP/1.1 304 Not Modified 276ms]
[13:18:57.622] GET
http://127.0.0.1:7999/wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-ajax-jquery-ver-1353527137996.js
[HTTP/1.1 304 Not Modified 290ms]
[13:18:57.623] GET
http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css [HTTP/1.1
304 Not Modified 165ms]
[13:18:57.623] GET http://code.jquery.com/jquery-1.8.3.min.js [HTTP/1.1 304
Not Modified 186ms]
[13:18:57.624] GET
http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js [HTTP/1.1 304
Not Modified 154ms]
...

Subsequently, AJAX behaves as expected, it resets fields when a metaprofile
type is selected.  I diff'd the newmetaprofile page source for the above two
scenarios.  Everything is the same, EXCEPT one difference in the generated
baseUrl:

Wicket.Ajax.baseUrl="newmetaprofile";  vs.
Wicket.Ajax.baseUrl="newmetaprofile?13";

For your reference, the entire header is attached below:::


http://wicket.apache.org/";>





Create Metaprofile

http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css"; />  
  








Create Metaprofile







  
 
 
  Metaprofile Type
 
Choose One
OXE
OXE_WITH_OT
OXE_WITH_ICS
OT
 

...




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065p4654234.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: AJAX not working after migrating from wicket 1.5.5 to 6.3.0

2012-11-21 Thread shimin_q
I have in the HTML head:


http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css"; />  
  


I need the jquery-mobile stuff, so should I just comment out the   ?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065p4654076.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: How to override URLs generated by bookmarkable mapper

2012-11-21 Thread shimin_q
Just want to report that the #mountPage() option first suggested by Martin
seems to have done the trick for me.

Now I am hit with the AJAX onUpdate() not getting called problem with Wicket
6.3.0 after I tested the same wicket code fine in 1.5.5, see the new message
I posted with my code snippet:

http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tc4654065.html

Martin, any ideas what I need to do to get the AJAX onUpdate() to work with
wicket 6.3.0?  Thanks a lot for your help!!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-URLs-generated-by-bookmarkable-mapper-tp4654005p4654072.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: AJAX not working after migrating from wicket 1.5.5 to 6.3.0

2012-11-21 Thread shimin_q
Well, maybe the problem is not in this part of wicket code.  As I mentioned,
everything worked fine for me with wicket 1.5.5.  And the problem occurred
right after I switched the wicket library from 1.5.5 to 6.3.0.  Perhaps I
need to tweak my environment or configuration or set up somewhere, or
anywhere else should I look to find the root cause for my problem?  Any
suggestions would be appreciated.  Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065p4654073.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: AJAX not working after migrating from wicket 1.5.5 to 6.3.0

2012-11-21 Thread shimin_q
Yes, it appears the onUpdate() was never called with wicket 6.3.0 when I
update the value in the DropDownChoice.  I am not sure what I need to do to
get it working with wicket 6, it was working fine in 1.5.5.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065p4654070.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



AJAX not working after migrating from wicket 1.5.5 to 6.3.0

2012-11-21 Thread shimin_q
I have a wicket application that implements a Form with multiple fields. 
AJAX form updating behavior onChange() is implemented so that a value change
in one field will trigger reset of some other fields.  All have been tested
working fine in wicket 1.5.5.  Now I just migrated to 6.3.0, none of this
AJAX behavior is working! :-(   Here is the code snippet that worked for
1.5.5.  Could anyone please tell me what I need to change to get the AJAX
behavior to work with wicket 6.3.0?  Thanks a lot!

public class MetaProfileForm extends Form {
  ...
DropDownChoice profileTypeBox = new
DropDownChoice("type",
new PropertyModel(profile, 
"type"),
Arrays.asList(MetaProfileType.values()),
new IChoiceRenderer() {
private static final long 
serialVersionUID = 1L;
@Override
public Object 
getDisplayValue(MetaProfileType object) {
return object.name();
}
@Override
public String 
getIdValue(MetaProfileType object, int index) {
return object.name();
}
}
);
profileTypeBox.setOutputMarkupId(true);
add(profileTypeBox);
 
profileTypeBox.add(new 
AjaxFormComponentUpdatingBehavior("onChange") {
private static final long serialVersionUID = 1L;
protected void onUpdate(AjaxRequestTarget target) {
resetFieldsPerProfileType(target);
//add any component that will be called in 
resetFieldsPerProfileType()
target.add(oxeNodeBox);
target.add(freeNumRangeBox);
target.add(oxeProfileBox);
...

};
}); 

In resetFieldsPerProfileType(),

protected void resetFieldsPerProfileType(AjaxRequestTarget target) {
MetaProfileType selectedProfileType = 
profileTypeBox.getModelObject();
if (selectedProfileType.equals(MetaProfileType.OXE))
{
oxeNodeAsteriskImg.add(new AttributeModifier("style", 
"display:"));
oxeNodeLabel.add(new AttributeModifier("class", 
"requiredLabel"));
oxeNodeBox.setChoices(getOXENodeList());
...
  } else if (selectedProfileType.equals(MetaProfileType.OT))
{
   //reset and reload some other fields
   ...
  }
 }

The corresponding HTML snippet:


 
 Metaprofile 
Type
 
  default
 

 


 
 OXE Node

  OXENode


 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065.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: How to override URLs generated by bookmarkable mapper

2012-11-20 Thread shimin_q
Thanks, Martin! 

I just updated wicket to 6.3.0 and removed the href="#" from my html
template.  Wicket does generate a relative url in "href=" relative to the
current url.   This, however, does not solve the issue with JQuery Mobile,
which loads
href="com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage"
based on the first page it loads, not the current url.  

The following links to JQuery Mobile explain its model: 

http://jquerymobile.com/demos/1.2.0/docs/pages/page-links.html
http://jquerymobile.com/demos/1.2.0/docs/pages/page-navmodel.html

Basically in JQM the first page of a site that is visited is a "base". It
constructs the URLs for other pages by appending # and the URL to that page
to the base URL. So, if the first page visited is
http://example.com/index.html and the user then clicks on a link to
someotherpage.html, the URL is
http://example.com/index.html#someotherpage.html. But it fixes up the URL
shown in the navigation bar of your browser so that it appears as
http://example.com/someotherpage.html.  

In my case, the first page of my site is http://127.0.0.1:7999, which is the
"base", so the URLs of all the other pages of this site are constructed
based on this "base", not the current url.  Therefore, if 

href="./com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage"

JQM will load 

http://127.0.0.1:7999/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage

which will not find the page since Wicket has the page at 

http://127.0.0.1:7999/wicket/bookmarkable/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage

I also posted the question at JQM forum, it appears there is no way to
change JQM behavior.  So my remaining options are to change my wicket code
to either 1) generate href= with absolute/full path (i.e.,
href="wicket/bookmarkable/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage)
 
OR 2) override the wicket default bookmarkable mapper not to store the page
under wicket/bookmarkable but to the base so
href="com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage"
will find the page.

Could you suggest any mechanisms in Wicket, which I hope exists, to
accomplish either 1) or 2) above?   some code example/snippet would be even
better.   I have been struggling with this issue for a long while... your
help would be much appreciated!!  Thanks.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-URLs-generated-by-bookmarkable-mapper-tp4654005p4654045.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



How to override URLs generated by bookmarkable mapper

2012-11-19 Thread shimin_q
I have an Apache Wicket-based application that I'd like to integrate with
JQuery Mobile on so it looks more pleasing on mobile devices. 
Unfortunately, I am getting "Error Loading Page" errors for all the
bookmarkable page links, which I never had problems with before JQuery
Mobile was added to the mix.  The root cause appears to be the URLs
contained in the HTTP requests.  I used Wicket 1.5.5, locally tested using
jetty server 6.1.26 and FireFox 16.0, JQuery Mobile 1.2.0, JQuery 1.8.0. 
Here is the code snippet:



   List <#>  
  


The corresponding java code:

add(new BookmarkablePageLink(  

"metaprofileList", MetaprofileListPage.class));

 
Based on the above, Wicket correctly replaced "#" in href="#" with real URLs
where the pages are, so the final HTML looks like the following:


   List
  
  


When the link is clicked , Jetty server sends the following HTTP Request
with the following URL:

GET
http://127.0.0.1:7999/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage
[HTTP/1.1 404 Not Found 0ms]

This is not a correct URL for the MetaprofileListPage.  As I understand,
with the default bookmarkable mapper in Wicket, the correct URL is: 

http://127.0.0.1:7999/wicket/bookmarkable/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage

As far as I know, I have no way of changing the way that JQuery Mobile
constructs the URLs from the href=, I am looking for ways in Wicket to
override the default "wicket/bookmarkable" context path to just "/"...

 
For your reference, the only JQuery Mobile-related change I did was
switching the headers in the HTML file from:







To the standard boilerplate jquery mobile includes:


http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css"; /> 
 
   

I have been struggling with this for 2 weeks now :-(  What do I need to do
to get Wicket and Jquery mobile to work loading the correct urls/pages? 
Please help!!  Many thanks!!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-URLs-generated-by-bookmarkable-mapper-tp4654005.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