Re: [Wicket-user] [Question] wicket.markup.html.form.Radio

2007-08-10 Thread Alex Objelean

You mean that in IE you have to click twice?
Use onclick event instead...



jq58 wrote:
 
 This works to an extent.  It appears that sometimes (totally random as far
 as I can tell) I have to click twice to get it to actually invoke the ajax
 action.
 
 But, once it is invoked, I am trying to enable the drop down and disable
 the text box via: 
 [code]
   private void setupAjaxRadio(final Panel panel, 
   final RadioGroup radioGroup, 
   final Radio radio) { 
 radioGroup.add(radio.add(new AjaxEventBehavior(onchange) { 
 
   private static final long serialVersionUID = 1L;
   protected void onEvent(AjaxRequestTarget target) { 
   radioGroup.processInput(); 
   if
 (radioGroup.getConvertedInput().equals(Component.getApplyToRadioGroupChoices().get(Component.AMOUNT_TYPE_GLOBAL))
 ) {
   radioGroup.get(percentGFId).setEnabled(true);
   radioGroup.get(amount).setEnabled(false);
   } else {
   radioGroup.get(percentGFId).setEnabled(false);
   radioGroup.get(amount).setEnabled(true);
   }
   target.addComponent(panel); 
   } 
 [/code]
 
 However, the enabling and disabling of the controls under the radio group
 are being ignored.
 Any idea why?
 
 Thanks.
 
 Kent Tong wrote:
 
 Alex Objelean alexandru.objelean at isdc.ro writes:
 
 Thank you Jan! Sad thing is that 1.2.x branch will never support this
 feature.
 
 Try:
 
 Form f = ...;
 RadioGroup rg2 = new RadioGroup(rg2, ...);
 rg2.setOutputMarkupId(true);
 setupAjaxRadio(f, rg2, new Radio(r3, new Model(abc)));
 setupAjaxRadio(f, rg2, new Radio(r4, new Model(def)));
 ...
 
   private void setupAjaxRadio(final Form form, 
   final RadioGroup radioGroup,
   final Radio radio) {
 radioGroup.add(radio.add(new AjaxEventBehavior(onchange) {
   protected void onEvent(AjaxRequestTarget target) {
 radioGroup.processInput();
 target.addComponent(form);
   }
   protected CharSequence getEventHandler() {
 return getCallbackScript(new AppendingStringBuffer(
 wicketAjaxPost(').append(getCallbackUrl()).append(
 ', wicketSerialize(document.getElementById('
 + radio.getMarkupId() + '))), null, null);
   }
 
 }));
   }
 
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-Question--wicket.markup.html.form.Radio-tf3926549.html#a12086224
Sent from the Wicket - User (OLD) mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
IMPORTANT NOTICE:

This mailing list is shutting down. Please subscribe to the Apache Wicket user 
list. Send a message to: users-subscribe at wicket.apache.org and follow the 
instructions.
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Replacing panels inside a ModalWindow

2007-08-10 Thread al que
Hello,
 I am trying to replace a panel inside a modal
window for a new panel on an AjaxButton click event.
Every thing seems to work fine but the second panel is
never shown in the modal window. 
In the wicket ajax debug window of the modal panel i
can see the correct html markup of the new panel being
sent to the modal window.
I get no java exceptions nor javascript errors in the
browser, just a blank page.

Im am using a WebPage as the modal window content.
The page has a WebMarkupContainer wich has the panel
element as child (the one that is ment to be
replaced).

The markup of the page is the following:

...

body
div wicket:id=container 
div wicket:id=content  /div
/div
/body
... 

The content panel is added correctly on page
construction and the modal window is rendered fine. 

The content panel element has an AjaxButton wich
should replace the content panel for another panel
when clicked.

The code for the AjaxButton onClick method is the
following:

  NewPanel newPanel = new
NewPanel(currentPanel.getId());  

  parentContainer.replace(newPanel); 
 
 target.addComponent(parentContainer);


(The parentContainer is the container element in the
markup )

when the button is cliked the panel is replaced, the
container is re-rendered and the old content
disappears but no new content is shown. Just a blank
page.

i am using wicket-1.3.0-incubating-SNAPSHOT.

Did anybody encountered a similar problem?

Thanks in advance.
Alina.



 





   

Sé un Mejor Amante del Cine 
¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
http://advision.webevents.yahoo.com/reto/entretenimiento.html

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
IMPORTANT NOTICE:

This mailing list is shutting down. Please subscribe to the Apache Wicket user 
list. Send a message to: users-subscribe at wicket.apache.org and follow the 
instructions.
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user