Hi,

the wizard's next button registers itself as the default submitting button of the form.

Thus Form renders an additional hidden input which submits with this button when enter is pressed in a textfield, see Form#appendDefaultButtonField() javadoc.

You can override Wizard#newForm() and return a subclass of Form which does nothing in #appendDefaultButtonField(). Then check whether this was the cause for your jQuery Mobile problem.

Regards
Sven


On 01/11/2013 06:48 AM, shimin_q wrote:
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?

<input type="submit" name="buttons:next" onclick=" var
b=document.getElementById('next2'); if
(b!=null&amp;&amp;b.onclick!=null&amp;&amp;typeof(b.onclick) != 'undefined')
{  var r = Wicket.bind(b.onclick, b)(); if (r != false) b.click(); } else {
b.click(); };  return false;"  />

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)

<html xmlns:wicket="http://wicket.apache.org/";>
<head><link rel="stylesheet" type="text/css"
href="./wicket/resource/org.apache.wicket.extensions.wizard.Wizard/Wizard-ver-1353430614243.css"
/>

     <meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1.0, user-scalable=no">
     <link rel="stylesheet"
href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css"; />
<title wicket:id="pageTitle">Metaprofile Creation Wizard</title>

</head>

<body>
<div data-role="page" data-theme="b" id="container">
        

<div data-role="header" data-theme="b" id="header">
                 <div style="position:relative">
                <div class="leftButton">
                          Cancel <./metaprofilehelp?0-1.ILinkListener-back>
                </div>
                 </div>
Metaprofile Creation Wizard

       </div>
       <div>
         <wicket:link> [back to the wizard index] <./8770uum>  </wicket:link>
       </div>
<div>
         <wicket:panel xmlns:wicket="http://wicket.apache.org";>
<div class="wicketExtensionsWizard">
<form wicket:id="form" class="wicketExtensionsWizardForm" id="form1"
method="post"
action="./metaprofilehelp?0-1.IFormSubmitListener-createMPWizard-form"><div
style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"><input
type="hidden" name="form1_hf_0" id="form1_hf_0" /></div><div
style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"><input
type="text" autocomplete="off"/><input type="submit" name="buttons:next"
onclick=" var b=document.getElementById('next2'); if
(b!=null&amp;&amp;b.onclick!=null&amp;&amp;typeof(b.onclick) != 'undefined')
{  var r = Wicket.bind(b.onclick, b)(); if (r != false) b.click(); } else {
b.click(); };  return false;"  /></div>
        
        
        <wicket:panel xmlns:wicket="http://wicket.apache.org";>
<div>
   <div wicket:id="title" class="wicketExtensionsWizardHeaderTitle">Profile
Name and Type</div>
   <div wicket:id="summary"
class="wicketExtensionsWizardHeaderSummary">Create a new metaprofile by
providing a profile name and a profile type.</div>
</div>
</wicket:panel>
        <div wicket:id="view"
class="wicketExtensionsWizardViewInner"><wicket:panel
xmlns:wicket="http://wicket.apache.org";>
                <wicket:message key="profileName"><strong>Profile
Name</strong></wicket:message>
                <input type="text" wicket:id="profile.name" value=""
name="view:profile.name"/>
                <wicket:message key="profileType"><strong>Profile
Type</strong></wicket:message>
                <select id="profileType" wicket:id="profile.type"
name="view:profile.type">
<option selected="selected" value="">Choose One</option>
<option value="0">OXE</option>
<option value="1">OXE_WITH_OT</option>
<option value="2">OXE_WITH_ICS</option>
<option value="3">OT</option>
</select>
</wicket:panel></div>
        <wicket:panel>
</wicket:panel>
        <wicket:panel xmlns:wicket="http://wicket.apache.org";>

<div>
          <input wicket:id="previous" type="submit" value="&lt; Previous"
name="buttons:previous" disabled="disabled" id="previous3"/>
          <input wicket:id="next" type="submit" value="Next &gt;"
name="buttons:next" id="next2"/>
        
          <input wicket:id="cancel" type="submit" value="Cancel"
name="buttons:cancel" id="cancel4"/>
          <input wicket:id="finish" type="submit" value="Finish"
name="buttons:finish" disabled="disabled" id="finish5"/>
</div>

</wicket:panel>
</form>
</div>
</wicket:panel>
       </div>
       <div id="feedback">
         <wicket:panel>
</wicket:panel>
       </div>


</div>
</body>
</html>




--
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



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

Reply via email to