Quantcast

RadioChoice model not updated in tomcat with liferay portal

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RadioChoice model not updated in tomcat with liferay portal

sap2000
Following code works fine on jettty 6.1.22 but not on tomcat 6.0.24 with Liferay 5.2
To be specific, the following line always returns string "optionB" although other option is selected.
String selectedOption = searchChoice.getModelObject();

Can anybody please point out reason for this behaviour? related code snippet from wicket Page is given below:
-------------------------------------------------------------------------
final RadioChoice<String> searchChoice = new RadioChoice<String>("searchChoice", new Model<String>("optionA"), searchOptions);

searchChoice.add(new AjaxFormChoiceComponentUpdatingBehavior() {

                        @Override
                        protected void onUpdate(AjaxRequestTarget target) {
                                String selectedOption = searchChoice.getModelObject(); //***
                                if(selectedOption .equals("optionA")){
                                        // doSomething
                                }else if(selectedSearch.equals("optionB")){
                                        // doSomethingElse
                                }
                        }
                });

-------------------------------------------------------------------------
Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RadioChoice model not updated in tomcat with liferay portal

Igor Vaynberg-2
we do not support portlets, i am afraid you are on your own there.

-igor

On Wed, Jun 1, 2011 at 3:16 AM, sap2000 <[hidden email]> wrote:

> Following code works fine on jettty 6.1.22 but not on tomcat 6.0.24 with
> Liferay 5.2
> To be specific, the following line always returns string "optionB" although
> other option is selected.
> String selectedOption = searchChoice.getModelObject();
>
> Can anybody please point out reason for this behaviour? related code snippet
> from wicket Page is given below:
> -------------------------------------------------------------------------
> final RadioChoice<String> searchChoice = new
> RadioChoice<String>("searchChoice", new Model<String>("optionA"),
> searchOptions);
>
> searchChoice.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>
>                        @Override
>                        protected void onUpdate(AjaxRequestTarget target) {
>                                String selectedOption = searchChoice.getModelObject(); //***
>                                if(selectedOption .equals("optionA")){
>                                        // doSomething
>                                }else if(selectedSearch.equals("optionB")){
>                                        // doSomethingElse
>                                }
>                        }
>                });
>
> -------------------------------------------------------------------------
> Thank you.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioChoice-model-not-updated-in-tomcat-with-liferay-portal-tp3565419p3565419.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RadioChoice model not updated in tomcat with liferay portal

Gabriel Landon
In reply to this post by sap2000
I'm using liferay 6.0.5 with Tomcat and RadioChoice works perfectly even with ajax (wicket 1.4.17).

Have you tried to debug your code and see what's going on?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RadioChoice model not updated in tomcat with liferay portal

sap2000
Yes, Gabriel I did remote debug using eclipse.
My project uses the same wicket version as yours i.e. 1.4.17

Default selection is correct as set in default model inside constructor of RadioChoice.
Once OptionB is selected, one can not toggle between radio buttons.
It doesn't even allow to select optionA when user tries to select it. It goes back to optionB immidietly.
No wonder the getModelObject() always returns optionB.
Is there any alternative implementation for RadioChoice or it's behaviour to which I can give a try?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RadioChoice model not updated in tomcat with liferay portal

sap2000
Changed to RadioGroup and implemented following code.
----------------------------------------------------------------
radioBtnOptionA.add(new AjaxEventBehavior("onclick") {
        @Override
        protected void onEvent(AjaxRequestTarget target) {

             // doSomething;
            radioGroup.setModelObject("optionA");
}
                });
----------------------------------------------------------------

Implemented above code also for optionB radio button.
(you need to implement this for each radio button and add button to radio group)
It worked.
Thank you for your time.

Regards,
Shantanu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RadioChoice model not updated in tomcat with liferay portal

sauli.ketola
In reply to this post by Igor Vaynberg-2
So you don't support portlets in version 1.4.x either anymore? I thougt the portlet support was dropped from 1.5.x.

Shouldn't you remove portlet support also from future versions of 1.4. to not to cause confusion? (I was under the impression that portlet support exists 1.4 as it is threre).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RadioChoice model not updated in tomcat with liferay portal

Martin Grigorov-4
Support for portlets is dropped because none of the active Wicket
developers uses this technology and knows its internals.
We still accept patches from users like you.

For Wicket 1.5 you can use/help/contribute to
https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/portlet-parent.
See also WICKET-4019

On Fri, Nov 11, 2011 at 11:09 AM, sauli.ketola <[hidden email]> wrote:

> So you don't support portlets in version 1.4.x either anymore? I thougt the
> portlet support was dropped from 1.5.x.
>
> Shouldn't you remove portlet support also from future versions of 1.4. to
> not to cause confusion? (I was under the impression that portlet support
> exists 1.4 as it is threre).
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioChoice-model-not-updated-in-tomcat-with-liferay-portal-tp3565419p4030812.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RadioChoice model not updated in tomcat with liferay portal

Gabriel Landon
In reply to this post by sauli.ketola
Portlets are supported in wicket 1.4.x.
I use wicket 1.4.19 with liferay 6.0.5 at the moment and it's working fine.
Loading...