• Tim Byrnes
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Nimble Advantage


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 7
    Replies
I'm probably overlooking something simple, but in attempting to postback with a apex:selectList with a size set to 1, nothing happens.  Ever.

I got frustrated and started a brand new visualforce page that exactly mimicked the one found here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm

That worked as expected. (The rerender was correct when selecting items from the selectList.)

Then I tweaked it ever so slightly to look like this:

First, the page:
<apex:page controller="sampleCon">
    <apex:form>
        <apex:selectList value="{!countries}" size="1" >
            <apex:selectOptions value="{!items}"/>
        </apex:selectList><p/>

        <apex:commandButton id="thisButton" value="{!countLabel}" action="{!test}" rerender="thisButton"/>

    </apex:form>
</apex:page>

Now my controller:
public class sampleCon {
        String[] countries = new String[]{};
        public String countLabel {get; set;}

        private Integer iClicks {get; set;}
             
        public sampleCon() {
        	iClicks = 1;
        	countLabel = 'Test ' + iClicks;
        }

        public PageReference test() {
        	iClicks++;
        	countLabel = 'Test ' + iClicks;
            return null;
        }
             
        public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('US','US'));
            options.add(new SelectOption('CANADA','Canada'));
            options.add(new SelectOption('MEXICO','Mexico'));
            return options;
        }
             
        public String[] getCountries() {
            return countries;
        }
             
        public void setCountries(String[] countries) {
            this.countries = countries;
        }      
    }

You'll see that clicking the commandButton does absolutely nothing to the label, nothing changes.  However, if you simply remove the size="1" attribute from the selectList everything will function perfectly. (At least that's what I'm seeing.)

Can anyone else verify, (or refute) this?
 
I'm probably overlooking something simple, but in attempting to postback with a apex:selectList with a size set to 1, nothing happens.  Ever.

I got frustrated and started a brand new visualforce page that exactly mimicked the one found here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm

That worked as expected. (The rerender was correct when selecting items from the selectList.)

Then I tweaked it ever so slightly to look like this:

First, the page:
<apex:page controller="sampleCon">
    <apex:form>
        <apex:selectList value="{!countries}" size="1" >
            <apex:selectOptions value="{!items}"/>
        </apex:selectList><p/>

        <apex:commandButton id="thisButton" value="{!countLabel}" action="{!test}" rerender="thisButton"/>

    </apex:form>
</apex:page>

Now my controller:
public class sampleCon {
        String[] countries = new String[]{};
        public String countLabel {get; set;}

        private Integer iClicks {get; set;}
             
        public sampleCon() {
        	iClicks = 1;
        	countLabel = 'Test ' + iClicks;
        }

        public PageReference test() {
        	iClicks++;
        	countLabel = 'Test ' + iClicks;
            return null;
        }
             
        public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('US','US'));
            options.add(new SelectOption('CANADA','Canada'));
            options.add(new SelectOption('MEXICO','Mexico'));
            return options;
        }
             
        public String[] getCountries() {
            return countries;
        }
             
        public void setCountries(String[] countries) {
            this.countries = countries;
        }      
    }

You'll see that clicking the commandButton does absolutely nothing to the label, nothing changes.  However, if you simply remove the size="1" attribute from the selectList everything will function perfectly. (At least that's what I'm seeing.)

Can anyone else verify, (or refute) this?
 

I'm trying to sign an XML document in one of my Apex classes.  Does Apex have any built in classes for signing XML documents?  Ie, like using the javax.xml.crypto.dsig.XMLSignature class or the Apache Santuario library?  I've looked at the Crypto.sign function, but I don't think it does what I need it to do (or if it does, please let me know!).

 

Thanks for any suggestions!

 

Kelly