• ALEJO CARPENZANO
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
Hi!. I need to pass a list of records grouped on a list (<ul> <apex:repeat var="account"...><li>{!account.name}</li></apex:repeat></ul>) to my controller to update the field value of this records. ¿There's any way to do this? Thanks!
Hi!¿Does anyone have an working example of two sortable lists with a save button?
The save button must update field values of the records that where dragged and dropped in another list.
Thank you!
Hi!, in visualforce i got an UL with Account records. Now i must to set the value of a custom field of that record with a new value.¿How can i pass the list of records to my controller? Thanks!
Hi!, i got three sortable lists where i can drag and drop accounts records from one to another list. Now , when an account has dragged from one list to another, the value of a custom field in the Account object must to change, how can i did it?
thank you!
Hi!
Please anybody help me to solve this u.u

I must to translate this:
 
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Sortable - Connect lists</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
  #sortable1, #sortable2 {
    border: 1px solid #eee;
    width: 142px;
    min-height: 20px;
    list-style-type: none;
    margin: 0;
    padding: 5px 0 0 0;
    float: left;
    margin-right: 10px;
  }
  #sortable1 li, #sortable2 li {
    margin: 0 5px 5px 5px;
    padding: 5px;
    font-size: 1.2em;
    width: 120px;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#sortable1, #sortable2" ).sortable({
      connectWith: ".connectedSortable"
    }).disableSelection();
  } );
  </script>
</head>
<body>
 
<ul id="sortable1" class="connectedSortable">
  <li class="ui-state-default">Item 1</li>
  <li class="ui-state-default">Item 2</li>
  <li class="ui-state-default">Item 3</li>
  <li class="ui-state-default">Item 4</li>
  <li class="ui-state-default">Item 5</li>
</ul>
 
<ul id="sortable2" class="connectedSortable">
  <li class="ui-state-highlight">Item 1</li>
  <li class="ui-state-highlight">Item 2</li>
  <li class="ui-state-highlight">Item 3</li>
  <li class="ui-state-highlight">Item 4</li>
  <li class="ui-state-highlight">Item 5</li>
</ul>
 
 
</body>
</html>

to visualforce and apex lenguages. You can see the demo in : https://jqueryui.com/sortable/#connect-lists

I must to be able to reorder and change account records listed in three lists using the mouse (drag and drop).
When we move an account from a list to other, the value of a custom field created on the account objects must to change.
The custom field of account object must be named "Level" and can get three values (level1,level2,level3).
Each list is filled with accounts that meets its values.

eg.:

Lv1accounts
account1
account2
account3

Lv2accounts
account4
account5
account6

Lv3accounts
account4
account5
account6


Thank you very much!
Hi!, in visualforce i got an UL with Account records. Now i must to set the value of a custom field of that record with a new value.¿How can i pass the list of records to my controller? Thanks!
Hello everyone, I'm new in salesforce
I want to use drag and drop in my pageblock but I can't. I've created a custom field in Accounts and display data by customfield (level__c). I want to group the accounts by groups (level 1, level 2, level 3).

This is my code:

Controller:
public with sharing class TheController {
    
    public List<Account> accounts {get;set;}
    public String[] levels {get;set;}
    
    public void load(){
        accounts = [SELECT Id, Name, level__c FROM Account WHERE level__c IN ('level 1', 'level 2', 'level 3')];
        
        Set<String> levelSet = new Set<String>();
        for (Account a : accounts)
            levelSet.add(a.level__c);
        
        levels = new String[levelSet.size()];
        Integer i = 0;
        for (String level : levelSet){
            levels[i] = level;
            i++;
        }
    }
}
 
<apex:page controller="TheController" action="{!load}">
    <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"/>
    <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"/>

    <apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css"/>

    <script>
    	$(document).ready(function(){
            implementSortable();
            });
    
    	function implementSortable(){
        	$( "#sortable" ).sortable();
            $( "#sortable" ).disableSelection();
        }
    </script>

    	<apex:repeat value="{!levels}" var="level">
            <apex:pageBlock title="{!level}">
            		<apex:repeat value="{!accounts}" var="account">
                    	<apex:outputPanel id="sortable" rendered="{!IF(level=account.level__c,true,false)}">
                    		{!account.Name} - {!account.level__c}<br/>         
                    	</apex:outputPanel>                                                                      
                	</apex:repeat>
            </apex:pageBlock>
        </apex:repeat>   
</apex:page>

Thank you, greetings

Hi,

 

I can easily dragged the text area field. How can i restrict user from dragging or stretching textarea??

 

Cheers,

Devendra S

 
     We are having two Lists of check box groups which are displayed in two pageblocksections> our requirement is to display the two groups in two columns.The code is like this
                        <apex:pageblockSection title="Rules" columns="0">
                        <apex:selectCheckboxes value="{!selectedRules}">
                                <apex:selectOptions value="{!rules}"/><br/>
                        </apex:selectCheckboxes><br/>
                                   </apex:pageblockSection>
                       
                 <apex:pageblockSection title="Agents">
                    <apex:selectCheckboxes value="{!selectedAgents}">
                            <apex:selectOptions value="{!agents}"/><br/></p>
                    </apex:selectCheckboxes><br/></p>
                   </apex:pageblockSection>
    Could any one suggest on how to align these two as two columns in a pageblock?