You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Archana.AA" <ar...@gmail.com> on 2011/07/27 19:42:14 UTC

DropDownChoice updates onchange event.

Hi All,

I am using a DropDownChoice with a list of values. The choice list come from
DB in a sorted order.
When I new AjaxFormComponentUpdatingBehavior("onchange") event, the
onUpdate(AjaxRequestTarget target) method is excecuted and it updates some
values. After this method executed, choice list is sequence in the
DropDownChoice changes. I am not updating the sequence any where in the
onUpdate().

I am very new to wicket. So I am not able to understand where I am going
wrong. Please help me out to resolve this.

Thanks in advance.

-----
Thanks,
Archana
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699271.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: DropDownChoice updates onchange event.

Posted by Archana <ar...@gmail.com>.
I am using a Arraylist.

-----
Thanks & Regards,
Archana
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699493.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: DropDownChoice updates onchange event.

Posted by Archana <ar...@gmail.com>.
I am using a List.

-----
Thanks & Regards,
Archana
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699387.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: DropDownChoice updates onchange event.

Posted by Adam Gray <ad...@gmail.com>.
What type of collection are you using in the model object?

On Wed, Jul 27, 2011 at 2:09 PM, Martin Grigorov <mg...@apache.org>wrote:

> I didn't see the question.
>
> On Wed, Jul 27, 2011 at 8:42 PM, Archana.AA
> <ar...@gmail.com> wrote:
> > Hi All,
> >
> > I am using a DropDownChoice with a list of values. The choice list come
> from
> > DB in a sorted order.
> > When I new AjaxFormComponentUpdatingBehavior("onchange") event, the
> > onUpdate(AjaxRequestTarget target) method is excecuted and it updates
> some
> > values. After this method executed, choice list is sequence in the
> > DropDownChoice changes. I am not updating the sequence any where in the
> > onUpdate().
> >
> > I am very new to wicket. So I am not able to understand where I am going
> > wrong. Please help me out to resolve this.
> >
> > Thanks in advance.
> >
> > -----
> > Thanks,
> > Archana
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699271.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: DropDownChoice updates onchange event.

Posted by Martin Grigorov <mg...@apache.org>.
I didn't see the question.

On Wed, Jul 27, 2011 at 8:42 PM, Archana.AA
<ar...@gmail.com> wrote:
> Hi All,
>
> I am using a DropDownChoice with a list of values. The choice list come from
> DB in a sorted order.
> When I new AjaxFormComponentUpdatingBehavior("onchange") event, the
> onUpdate(AjaxRequestTarget target) method is excecuted and it updates some
> values. After this method executed, choice list is sequence in the
> DropDownChoice changes. I am not updating the sequence any where in the
> onUpdate().
>
> I am very new to wicket. So I am not able to understand where I am going
> wrong. Please help me out to resolve this.
>
> Thanks in advance.
>
> -----
> Thanks,
> Archana
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699271.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



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

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


Re: DropDownChoice updates onchange event.

Posted by Archana <ar...@gmail.com>.
The savedReportsDropDownList Arraylist contains a collection of
SelectedTrackProfileVO. trackingProfileVO is a type of TrackingProfileVO,
which contains the selected object which is of type SelectedTrackProfileVO.
profileDropDown is of type SelectedTrackProfileVO. TrackingProfileVO is
added to the form.

-----
Thanks & Regards,
Archana
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3702308.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: DropDownChoice updates onchange event.

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
Hi,

I've looked at your code but is not clear to me how and when you read 
the selected value in savedReportsDropDown. Is trackingProfileVO an 
instance of SelectedTrackProfileVO?


> Here is the code:
>
> private DropDownChoice<SelectedTrackProfileVO>  savedReportsDropDown;
>
> savedReportsDropDown = new
> DropDownChoice<SelectedTrackProfileVO>("profileDropDown",savedReportsDropDownList);
> savedReportsDropDown.setChoiceRenderer(new
> ChoiceRenderer<SelectedTrackProfileVO>("reportName", "cstmReportId"));
> savedReportsDropDown.setOutputMarkupId(true);
> savedReportsDropDown.setOutputMarkupPlaceholderTag(true);
> savedReportsDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange"){
>
>
>      private static final long serialVersionUID = 1L;
>
>      @Override
>      protected void onUpdate(AjaxRequestTarget target) {
>
>          try {
>               TrackingProfileVO trackingProfileVOFromDB = gets the value from
> DB.
>
>
> trackingProfileVO.setReportLabel(trackingProfileVOFromDB.getReportLabel());
>
> trackingProfileVO.setProfileDesc(trackingProfileVOFromDB.getProfileDesc());
>
> trackingProfileVO.setShipmentSearch(trackingProfileVOFromDB.getShipmentSearch());
>               trackingProfileVO.getLstSelectedSHVReportColumn().clear();
>
> trackingProfileVO.getLstSelectedSHVReportColumn().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>               trackingProfileVO.getSortFirstColumnList().clear();
>               trackingProfileVO.getSortSecondColumnList().clear();
>               trackingProfileVO.getSortThirdColumnList().clear();
>
> trackingProfileVO.getSortFirstColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> trackingProfileVO.getSortSecondColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> trackingProfileVO.getSortThirdColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> trackingProfileVO.setShareFlag(trackingProfileVOFromDB.isShareFlag());
>               shareFlag.setDefaultModel(new
> Model<Boolean>(trackingProfileVOFromDB.isShareFlag()));
>               if(trackingProfileVOFromDB.getResultsPerPage() != null){
>
> trackingProfileVO.setResultsPerPage(trackingProfileVOFromDB.getResultsPerPage());
>                   resultsPerPage.setModel(new
> Model<DDChoice>(trackingProfileVOFromDB.getResultsPerPage()));
>               }
>
> trackingProfileVO.getLstSHVReportColumn().removeAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
>
>
> displaySortingPanel.getSortFirst().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> displaySortingPanel.getSortSecond().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> displaySortingPanel.getSortThird().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> trackingProfileVO.setSortFirst(trackingProfileVOFromDB.getSortFirst());
>
> trackingProfileVO.setSortSecond(trackingProfileVOFromDB.getSortSecond());
>
> trackingProfileVO.setSortThird(trackingProfileVOFromDB.getSortThird());
>               displaySortingPanel.getSortFirst().setDefaultModel(new
> Model<SHVReportColumnGridVO>(trackingProfileVO.getSortFirst()));
>               displaySortingPanel.getSortSecond().setDefaultModel(new
> Model<SHVReportColumnGridVO>(trackingProfileVO.getSortSecond()));
>               displaySortingPanel.getSortThird().setDefaultModel(new
> Model<SHVReportColumnGridVO>(trackingProfileVO.getSortThird()));
>               displaySortingPanel.setDefaultModel(new
> Model<TrackingProfileVO>(trackingProfileVO));
>               target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getMarkupId()+ "' );");
>
>               target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getSortFirst().getMarkupId()+ "' );");
>               target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getSortSecond().getMarkupId()+ "' );");
>               target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getSortThird().getMarkupId()+ "' );");
>
>               target.addComponent(displaySortingPanel.getSortFirst());
>               target.addComponent(displaySortingPanel.getSortSecond());
>               target.addComponent(displaySortingPanel.getSortThird());
>
>               target.addComponent(displaySortingPanel);
>               target.addComponent(form);
>          } catch (SHVServiceException e) {
>
>          LOG.error("createSavedReportsDropDown() : Exception",e);
>          }
>
>
>      }
>
>      @Override
>      protected IAjaxCallDecorator getAjaxCallDecorator() {
>
>          return new AjaxCallDecorator() {
>              private static final long serialVersionUID = 1L;
>
>              @Override
>              public CharSequence decorateScript(CharSequence script) {
>
>                      final StringBuffer scriptBuffer = new StringBuffer();
>
> scriptBuffer.append("Ricola.page.showPleaseWait('Processing');");
>                      scriptBuffer.append(script);
>                      return scriptBuffer.toString();
>
>              }
>          };
>
>      }
>
> });
>
> -----
> Thanks&  Regards,
> Archana
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699850.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>


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


Re: DropDownChoice updates onchange event.

Posted by Archana <ar...@gmail.com>.
Here is the code:

private DropDownChoice<SelectedTrackProfileVO> savedReportsDropDown;

savedReportsDropDown = new
DropDownChoice<SelectedTrackProfileVO>("profileDropDown",savedReportsDropDownList); 
savedReportsDropDown.setChoiceRenderer(new
ChoiceRenderer<SelectedTrackProfileVO>("reportName", "cstmReportId")); 
savedReportsDropDown.setOutputMarkupId(true); 
savedReportsDropDown.setOutputMarkupPlaceholderTag(true); 
savedReportsDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange"){ 

    
    private static final long serialVersionUID = 1L; 

    @Override 
    protected void onUpdate(AjaxRequestTarget target) { 
        
        try { 
             TrackingProfileVO trackingProfileVOFromDB = gets the value from
DB. 
              
            
trackingProfileVO.setReportLabel(trackingProfileVOFromDB.getReportLabel()); 
            
trackingProfileVO.setProfileDesc(trackingProfileVOFromDB.getProfileDesc()); 
            
trackingProfileVO.setShipmentSearch(trackingProfileVOFromDB.getShipmentSearch()); 
             trackingProfileVO.getLstSelectedSHVReportColumn().clear(); 
            
trackingProfileVO.getLstSelectedSHVReportColumn().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
             trackingProfileVO.getSortFirstColumnList().clear(); 
             trackingProfileVO.getSortSecondColumnList().clear(); 
             trackingProfileVO.getSortThirdColumnList().clear(); 
            
trackingProfileVO.getSortFirstColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
            
trackingProfileVO.getSortSecondColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
            
trackingProfileVO.getSortThirdColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
            
trackingProfileVO.setShareFlag(trackingProfileVOFromDB.isShareFlag()); 
             shareFlag.setDefaultModel(new
Model<Boolean>(trackingProfileVOFromDB.isShareFlag())); 
             if(trackingProfileVOFromDB.getResultsPerPage() != null){ 
                
trackingProfileVO.setResultsPerPage(trackingProfileVOFromDB.getResultsPerPage()); 
                 resultsPerPage.setModel(new
Model<DDChoice>(trackingProfileVOFromDB.getResultsPerPage())); 
             } 
            
trackingProfileVO.getLstSHVReportColumn().removeAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
              
              
            
displaySortingPanel.getSortFirst().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
            
displaySortingPanel.getSortSecond().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
            
displaySortingPanel.getSortThird().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn()); 
            
trackingProfileVO.setSortFirst(trackingProfileVOFromDB.getSortFirst()); 
            
trackingProfileVO.setSortSecond(trackingProfileVOFromDB.getSortSecond()); 
            
trackingProfileVO.setSortThird(trackingProfileVOFromDB.getSortThird()); 
             displaySortingPanel.getSortFirst().setDefaultModel(new
Model<SHVReportColumnGridVO>(trackingProfileVO.getSortFirst())); 
             displaySortingPanel.getSortSecond().setDefaultModel(new
Model<SHVReportColumnGridVO>(trackingProfileVO.getSortSecond())); 
             displaySortingPanel.getSortThird().setDefaultModel(new
Model<SHVReportColumnGridVO>(trackingProfileVO.getSortThird())); 
             displaySortingPanel.setDefaultModel(new
Model<TrackingProfileVO>(trackingProfileVO)); 
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getMarkupId()+ "' );"); 
              
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getSortFirst().getMarkupId()+ "' );"); 
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getSortSecond().getMarkupId()+ "' );"); 
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getSortThird().getMarkupId()+ "' );"); 
              
             target.addComponent(displaySortingPanel.getSortFirst()); 
             target.addComponent(displaySortingPanel.getSortSecond()); 
             target.addComponent(displaySortingPanel.getSortThird()); 

             target.addComponent(displaySortingPanel); 
             target.addComponent(form); 
        } catch (SHVServiceException e) { 
            
        LOG.error("createSavedReportsDropDown() : Exception",e); 
        } 
        
        
    } 
    
    @Override 
    protected IAjaxCallDecorator getAjaxCallDecorator() { 

        return new AjaxCallDecorator() { 
            private static final long serialVersionUID = 1L; 

            @Override 
            public CharSequence decorateScript(CharSequence script) { 
                
                    final StringBuffer scriptBuffer = new StringBuffer(); 
                   
scriptBuffer.append("Ricola.page.showPleaseWait('Processing');"); 
                    scriptBuffer.append(script); 
                    return scriptBuffer.toString(); 
                
            } 
        }; 
        
    } 
    
});

-----
Thanks & Regards,
Archana
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699850.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: DropDownChoice updates onchange event.

Posted by Andrea Del Bene <an...@libero.it>.
Hi,

attach the code from onUpdate(AjaxRequestTarget target)  method. This 
should be responsible of  changing order.
>> I mean to say before the onUpdate was executed the DropDownChoice contains in
>> the order of (A, B, C, D).
>> But after the execution of onUpdate() the DropDownChoice contains in the
>> order of (D, B, A, C) which is totally a new order. I have not updated the
>> sequence of the elements. But still the order changed. How can I make the
>> DropDownChoice to diaplay the elements in the order of (A, B, C, D).
>>
>> -----
>> Thanks&  Regards,
>> Archana
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699383.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>


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


Re: DropDownChoice updates onchange event.

Posted by Clint Checketts <ch...@gmail.com>.
Show the code for savedReportsDropDownList. I suspect you aren't using a
Model.

Also a couple of tweaks to your code. Your calls to 'setChoices' indicate a
'pushing data' approach. Like you are setting the lists in those components
instead of using models there to. I think that is where you are hitting your
snag.

Include the html for your 'displaySortingPanel' please.

-Clint

On Wed, Jul 27, 2011 at 4:19 PM, Archana
<ar...@gmail.com>wrote:

> private DropDownChoice<SelectedTrackProfileVO>
> savedReportsDropDown;savedReportsDropDown = new
>
> DropDownChoice<SelectedTrackProfileVO>("profileDropDown",savedReportsDropDownList);
> savedReportsDropDown.setChoiceRenderer(new
> ChoiceRenderer<SelectedTrackProfileVO>("reportName", "cstmReportId"));
> savedReportsDropDown.setOutputMarkupId(true);
> savedReportsDropDown.setOutputMarkupPlaceholderTag(true);
> savedReportsDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange"){
>
>
>    private static final long serialVersionUID = 1L;
>
>    @Override
>    protected void onUpdate(AjaxRequestTarget target) {
>
>        try {
>             TrackingProfileVO trackingProfileVOFromDB = gets the value from
> DB.
>
>
> trackingProfileVO.setReportLabel(trackingProfileVOFromDB.getReportLabel());
>
> trackingProfileVO.setProfileDesc(trackingProfileVOFromDB.getProfileDesc());
>
>
> trackingProfileVO.setShipmentSearch(trackingProfileVOFromDB.getShipmentSearch());
>             trackingProfileVO.getLstSelectedSHVReportColumn().clear();
>
>
> trackingProfileVO.getLstSelectedSHVReportColumn().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>             trackingProfileVO.getSortFirstColumnList().clear();
>             trackingProfileVO.getSortSecondColumnList().clear();
>             trackingProfileVO.getSortThirdColumnList().clear();
>
>
> trackingProfileVO.getSortFirstColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
>
> trackingProfileVO.getSortSecondColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
>
> trackingProfileVO.getSortThirdColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> trackingProfileVO.setShareFlag(trackingProfileVOFromDB.isShareFlag());
>             shareFlag.setDefaultModel(new
> Model<Boolean>(trackingProfileVOFromDB.isShareFlag()));
>             if(trackingProfileVOFromDB.getResultsPerPage() != null){
>
>
> trackingProfileVO.setResultsPerPage(trackingProfileVOFromDB.getResultsPerPage());
>                 resultsPerPage.setModel(new
> Model<DDChoice>(trackingProfileVOFromDB.getResultsPerPage()));
>             }
>
>
> trackingProfileVO.getLstSHVReportColumn().removeAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
>
>
>
> displaySortingPanel.getSortFirst().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
>
> displaySortingPanel.getSortSecond().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
>
> displaySortingPanel.getSortThird().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
>
> trackingProfileVO.setSortFirst(trackingProfileVOFromDB.getSortFirst());
>
> trackingProfileVO.setSortSecond(trackingProfileVOFromDB.getSortSecond());
>
> trackingProfileVO.setSortThird(trackingProfileVOFromDB.getSortThird());
>             displaySortingPanel.getSortFirst().setDefaultModel(new
> Model<SHVReportColumnGridVO>(trackingProfileVO.getSortFirst()));
>             displaySortingPanel.getSortSecond().setDefaultModel(new
> Model<SHVReportColumnGridVO>(trackingProfileVO.getSortSecond()));
>             displaySortingPanel.getSortThird().setDefaultModel(new
> Model<SHVReportColumnGridVO>(trackingProfileVO.getSortThird()));
>             displaySortingPanel.setDefaultModel(new
> Model<TrackingProfileVO>(trackingProfileVO));
>             target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getMarkupId()+ "' );");
>
>             target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getSortFirst().getMarkupId()+ "' );");
>             target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getSortSecond().getMarkupId()+ "' );");
>             target.appendJavascript("Ricola.init( '#" +
> displaySortingPanel.getSortThird().getMarkupId()+ "' );");
>
>             target.addComponent(displaySortingPanel.getSortFirst());
>             target.addComponent(displaySortingPanel.getSortSecond());
>             target.addComponent(displaySortingPanel.getSortThird());
>
>             target.addComponent(displaySortingPanel);
>             target.addComponent(form);
>        } catch (SHVServiceException e) {
>
>                LOG.error("createSavedReportsDropDown() : Exception",e);
>        }
>
>
>    }
>
>    @Override
>    protected IAjaxCallDecorator getAjaxCallDecorator() {
>
>        return new AjaxCallDecorator() {
>            private static final long serialVersionUID = 1L;
>
>            @Override
>            public CharSequence decorateScript(CharSequence script) {
>
>                    final StringBuffer scriptBuffer = new StringBuffer();
>
> scriptBuffer.append("Ricola.page.showPleaseWait('Processing');");
>                    scriptBuffer.append(script);
>                    return scriptBuffer.toString();
>
>            }
>        };
>
>    }
>
> });
>
> -----
> Thanks & Regards,
> Archana
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699847.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: DropDownChoice updates onchange event.

Posted by Archana <ar...@gmail.com>.
private DropDownChoice<SelectedTrackProfileVO>
savedReportsDropDown;savedReportsDropDown = new
DropDownChoice<SelectedTrackProfileVO>("profileDropDown",savedReportsDropDownList);
savedReportsDropDown.setChoiceRenderer(new
ChoiceRenderer<SelectedTrackProfileVO>("reportName", "cstmReportId"));
savedReportsDropDown.setOutputMarkupId(true);
savedReportsDropDown.setOutputMarkupPlaceholderTag(true);
savedReportsDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange"){

   
    private static final long serialVersionUID = 1L;

    @Override
    protected void onUpdate(AjaxRequestTarget target) {
       
        try {
             TrackingProfileVO trackingProfileVOFromDB = gets the value from
DB.
             
            
trackingProfileVO.setReportLabel(trackingProfileVOFromDB.getReportLabel());
            
trackingProfileVO.setProfileDesc(trackingProfileVOFromDB.getProfileDesc());
            
trackingProfileVO.setShipmentSearch(trackingProfileVOFromDB.getShipmentSearch());
             trackingProfileVO.getLstSelectedSHVReportColumn().clear();
            
trackingProfileVO.getLstSelectedSHVReportColumn().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
             trackingProfileVO.getSortFirstColumnList().clear();
             trackingProfileVO.getSortSecondColumnList().clear();
             trackingProfileVO.getSortThirdColumnList().clear();
            
trackingProfileVO.getSortFirstColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
            
trackingProfileVO.getSortSecondColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
            
trackingProfileVO.getSortThirdColumnList().addAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
            
trackingProfileVO.setShareFlag(trackingProfileVOFromDB.isShareFlag());
             shareFlag.setDefaultModel(new
Model<Boolean>(trackingProfileVOFromDB.isShareFlag()));
             if(trackingProfileVOFromDB.getResultsPerPage() != null){
                
trackingProfileVO.setResultsPerPage(trackingProfileVOFromDB.getResultsPerPage());
                 resultsPerPage.setModel(new
Model<DDChoice>(trackingProfileVOFromDB.getResultsPerPage()));
             }
            
trackingProfileVO.getLstSHVReportColumn().removeAll(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
             
             
            
displaySortingPanel.getSortFirst().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
            
displaySortingPanel.getSortSecond().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
            
displaySortingPanel.getSortThird().setChoices(trackingProfileVOFromDB.getLstSelectedSHVReportColumn());
            
trackingProfileVO.setSortFirst(trackingProfileVOFromDB.getSortFirst());
            
trackingProfileVO.setSortSecond(trackingProfileVOFromDB.getSortSecond());
            
trackingProfileVO.setSortThird(trackingProfileVOFromDB.getSortThird());
             displaySortingPanel.getSortFirst().setDefaultModel(new
Model<SHVReportColumnGridVO>(trackingProfileVO.getSortFirst()));
             displaySortingPanel.getSortSecond().setDefaultModel(new
Model<SHVReportColumnGridVO>(trackingProfileVO.getSortSecond()));
             displaySortingPanel.getSortThird().setDefaultModel(new
Model<SHVReportColumnGridVO>(trackingProfileVO.getSortThird()));
             displaySortingPanel.setDefaultModel(new
Model<TrackingProfileVO>(trackingProfileVO));
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getMarkupId()+ "' );");
             
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getSortFirst().getMarkupId()+ "' );");
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getSortSecond().getMarkupId()+ "' );");
             target.appendJavascript("Ricola.init( '#" +
displaySortingPanel.getSortThird().getMarkupId()+ "' );");
             
             target.addComponent(displaySortingPanel.getSortFirst());
             target.addComponent(displaySortingPanel.getSortSecond());
             target.addComponent(displaySortingPanel.getSortThird());

             target.addComponent(displaySortingPanel);
             target.addComponent(form);
        } catch (SHVServiceException e) {
            
        	LOG.error("createSavedReportsDropDown() : Exception",e);
        }
        
        
    }
    
    @Override
    protected IAjaxCallDecorator getAjaxCallDecorator() {

        return new AjaxCallDecorator() {
            private static final long serialVersionUID = 1L;

            @Override
            public CharSequence decorateScript(CharSequence script) {
                
                    final StringBuffer scriptBuffer = new StringBuffer();
                   
scriptBuffer.append("Ricola.page.showPleaseWait('Processing');");
                    scriptBuffer.append(script);
                    return scriptBuffer.toString();
                
            }
        };
        
    }
    
});

-----
Thanks & Regards,
Archana
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699847.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: DropDownChoice updates onchange event.

Posted by Pedro Santos <pe...@gmail.com>.
The DropDownChoice should respect the list sequence, show some code so
we can track the source of the problem.

On Wed, Jul 27, 2011 at 3:16 PM, Archana
<ar...@gmail.com> wrote:
> I mean to say before the onUpdate was executed the DropDownChoice contains in
> the order of (A, B, C, D).
> But after the execution of onUpdate() the DropDownChoice contains in the
> order of (D, B, A, C) which is totally a new order. I have not updated the
> sequence of the elements. But still the order changed. How can I make the
> DropDownChoice to diaplay the elements in the order of (A, B, C, D).
>
> -----
> Thanks & Regards,
> Archana
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699383.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Pedro Henrique Oliveira dos Santos

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


Re: DropDownChoice updates onchange event.

Posted by Archana <ar...@gmail.com>.
I mean to say before the onUpdate was executed the DropDownChoice contains in
the order of (A, B, C, D).
But after the execution of onUpdate() the DropDownChoice contains in the
order of (D, B, A, C) which is totally a new order. I have not updated the
sequence of the elements. But still the order changed. How can I make the
DropDownChoice to diaplay the elements in the order of (A, B, C, D).

-----
Thanks & Regards,
Archana
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699383.html
Sent from the Users forum mailing list archive at Nabble.com.

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