• Andrasko
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies

Hy everyone!

 

I have a inexplicable problem:

- I have 2 select in my VF page

- The select value connect to varibale of controller

 

1.) If I open the page and don't modify the generated SELECT element everything is ok.

 

2.) If I modify the generated SELECT element (with javascript or firebug) - add or remove options - something go wrong: I click on the save button and the page is reloaded without my controller's code run.

 

If anyone knows what is the problem, please tell me, because I spent a lot of time to solve this problem... :S

 

 

 

VF PAGE:

 

<apex:page controller="modifyuserGroupController" tabStyle="Admin__tab" >
    <script type="text/javascript">  
        function moveOptions(sourceID, destID) {
            var src=document.getElementById(sourceID);
            var dest = document.getElementById(destID);
            
            for(var count=0; count < src.options.length; count++) {
                if(src.options[count].selected == true) {
                    var option = src.options[count];
                    
                    var newOption = document.createElement("option");
                    newOption.value = option.value;
                    newOption.text = option.text;
                    newOption.selected = true;
                    try {
                        dest.add(newOption, null); //Standard
                        src.remove(count, null);
                     }catch(error) {
                        dest.add(newOption); // IE only
                        src.remove(count);
                     }
                    count--;
                }
            }
        }
    </script>
    
        <apex:form id="createUG" >
            <table class="dfTable" >
              <th colspan="3" class="tableHeader" >Add users to the usergroup</th>
              <tr>
                 <td>Actual users</td>
                 <td>&nbsp;</td>
                 <td>Available users</td>
              </tr>
              <tr class="odd">
              <td class="column1">
                  <apex:selectList id="actUser" value="{!selectedUserID}" multiselect="true" styleClass="actualRoles" size="6" >
                        <apex:selectOptions value="{!items2}" ></apex:selectOptions>
                  </apex:selectList>
               </td>
               <td>
                   <a href="#" id="add" onClick="moveOptions('{!$Component.actUser}','{!$Component.availableUser}')" >&gt;&gt;</a>
                   <br />
                   <br />
                   <a href="#" id="remove" onClick="moveOptions('{!$Component.availableUser}', '{!$Component.actUser}')" >&lt;&lt;</a>
                 </td>
                 <td>
                     <apex:selectList id="availableUser" multiselect="true" styleClass="availableRoles" size="6" >
                          <apex:selectOptions value="{!items}" ></apex:selectOptions>
                      </apex:selectList>    
                  </td>
             </tr>
                    
          </table>
               
          <apex:commandButton action="{!cancel}" title="Cancel" styleClass="commandBtn" value="Cancel"  />
          <apex:commandButton action="{!save}" title="Save" styleClass="commandBtn" value="Save"  />
                
       </apex:form>
 </apex:page>

 

 

CONTROLLER:

 

public class modifyuserGroupController {
    
    String[] selectedUserID = new String[]{};
    String[] availableUserID = new String[]{};

    public void setSelectedUserID (String[] selectedUserID){ this.selectedUserID = selectedUserID; }
    public String[] getSelectedUserID (){ return this.selectedUserID; }
    
    public void setAvailableUserID (String[] availableUserID){ this.availableUserID = availableUserID; }
    public String[] getAvailableUserID (){ return this.availableUserID; }

    ...
public PageReference save(){
  return Page.modifyusergroupcheck;
}

 

 

Hy everyone,

 

I have a vf page with a form. The form consists of input fields and two select. I use javascript to change the two select itmes. After I insert the javascript code to my page, the command button go wrong. If I clicks on the button the page reloaded.

 

Here is my simplified page:

 

<apex:page ..." >
  
  <script type="text/javascript">  
    function moveOptions(sourceID, destID) {
            ...
  </script>
   
    <apex:form id="id_01" >
      <table class="dfTable">
        <tr class="odd">
          <td class="column1">Name*:</td>
          <td>
            <apex:inputText value="{!name}"/>
          </td>
        </tr>
        <tr class="odd">
          <td class="column1">
            <apex:selectList id="actUser" ... >
              ...
            </apex:selectList>
          </td>
          <td>
            <a href="#" id="add" onClick="moveOptions(...)')" >&gt;&gt;</a>
          </td>
          <td>
            <apex:selectList id="availableUser" ... >
              ...
            </apex:selectList>  
          </td>
        </tr>
      </table>
      <apex:commandButton action="{!cancel}" title="Cancel" value="Cancel"  />
      <apex:commandButton action="{!save}" title="Save"  value="Save" />
    </apex:form>

 

Is anyone know why happening this? I spent a lot of time to solve it, but I haven't got any answer or solution.

 

Hy everyone!

 

I have an apex class (generated from WSDL) with the following code:

 

public class dfWS {

    public class user_x {
        public String firstName;
        public String id;
        public String lastName;
        public String loginName;

    }

}

 

 

I use this class in a cotroller class:

 

List<dfWS.User_x> users = new List<dfWS.User_x>();

users = ... // fill the List with data

 

 

And I want to display this list with dataTable:

 

<apex:dataTable id="userTable" value="{!users}" var="u">

 

 <apex:column >
 <apex:outputText >{!u.id}</apex:outputText>
 </apex:column>

</apex:dataTable>

 

 

 

But I get the following error:

Error: Unknown property 'dfWS.user_x.Id'

 


Hy everyone!

 

I got a WSDL file and I generated apex code from this WSDL. After that I check the code and I found that the class inharitance is gone. (There is a custom userFull class, that extends a custom user class in the original code).

 

It is possible that salesforce not supported inheritance when generated apex code from wsdl?

 

 

Hy everyone,

 

I need a select html element with the name of users. I find the following code in the devloper's guide:

 

<apex:selectList value="{!filterId}" size="1">

    <apex:actionSupport event="onchange" rerender="list"/>

    <apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
 
 <apex:dataList var="a" value="{!accounts}" id="list">
    {!a.name}
 </apex:dataList>

 

 

This code looks like this in the page:

http://picasaweb.google.com/adam.andrasko/Works?authkey=Gv1sRgCOWCobLA8rreUw#5559000137063594930

 

But I want to put the user in a select list:

http://picasaweb.google.com/adam.andrasko/Works?authkey=Gv1sRgCOWCobLA8rreUw#5559000137386569426

 

If anyone knows how to do this, please tell me, because I have benn trying to do this for a long time.

Hy everyone,


I want to set the organization data (for example: name, city, country) to an input field.


First I try it in visualforce page:

 

<apex:page standardController="Organization" >

<apex:inputText value="{!$Organization.Name}" />

</apex:page>

 

But I get the following error message:


Error: Unknown property 'OrganizationStandardController.$Organization'

 

After that I change the controllert to MyController.

 

Anyone knows how can I get the Organization data with apex code.


Hy everyone,

 

I have a vf page with a form. The form consists of input fields and two select. I use javascript to change the two select itmes. After I insert the javascript code to my page, the command button go wrong. If I clicks on the button the page reloaded.

 

Here is my simplified page:

 

<apex:page ..." >
  
  <script type="text/javascript">  
    function moveOptions(sourceID, destID) {
            ...
  </script>
   
    <apex:form id="id_01" >
      <table class="dfTable">
        <tr class="odd">
          <td class="column1">Name*:</td>
          <td>
            <apex:inputText value="{!name}"/>
          </td>
        </tr>
        <tr class="odd">
          <td class="column1">
            <apex:selectList id="actUser" ... >
              ...
            </apex:selectList>
          </td>
          <td>
            <a href="#" id="add" onClick="moveOptions(...)')" >&gt;&gt;</a>
          </td>
          <td>
            <apex:selectList id="availableUser" ... >
              ...
            </apex:selectList>  
          </td>
        </tr>
      </table>
      <apex:commandButton action="{!cancel}" title="Cancel" value="Cancel"  />
      <apex:commandButton action="{!save}" title="Save"  value="Save" />
    </apex:form>

 

Is anyone know why happening this? I spent a lot of time to solve it, but I haven't got any answer or solution.

 

Hy everyone!

 

I have an apex class (generated from WSDL) with the following code:

 

public class dfWS {

    public class user_x {
        public String firstName;
        public String id;
        public String lastName;
        public String loginName;

    }

}

 

 

I use this class in a cotroller class:

 

List<dfWS.User_x> users = new List<dfWS.User_x>();

users = ... // fill the List with data

 

 

And I want to display this list with dataTable:

 

<apex:dataTable id="userTable" value="{!users}" var="u">

 

 <apex:column >
 <apex:outputText >{!u.id}</apex:outputText>
 </apex:column>

</apex:dataTable>

 

 

 

But I get the following error:

Error: Unknown property 'dfWS.user_x.Id'

 


Hy everyone,


I want to set the organization data (for example: name, city, country) to an input field.


First I try it in visualforce page:

 

<apex:page standardController="Organization" >

<apex:inputText value="{!$Organization.Name}" />

</apex:page>

 

But I get the following error message:


Error: Unknown property 'OrganizationStandardController.$Organization'

 

After that I change the controllert to MyController.

 

Anyone knows how can I get the Organization data with apex code.