• andye
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies

Hi all,

 

I've got an issue which is driving my absolutely crazy and it seems like a really stupid problem! I simply want to populate the value of an inputText. Now, here's the strage part:

 

This works:

 

 

function checkLicenses() { var licInputs = document.getElementsByName('license'); var licTextBox = document.getElementById('{!$Component.licenseAssignments.licenseWiz2Form.txtSelectedLicenses}'); licTextBox.value = licInputs.length; }

 

This also works:

 

 

function checkLicenses() { var licInputs = document.getElementsByName('license'); var licTextBox = document.getElementById('{!$Component.licenseAssignments.licenseWiz2Form.txtSelectedLicenses}'); licTextBox.value = 999; }

 

However, this does not work:

 

function checkLicenses() { var licInputs = document.getElementsByName('license'); var licTextBox = document.getElementById('{!$Component.licenseAssignments.licenseWiz2Form.txtSelectedLicenses}'); licTextBox.value = 'hello'; }

 and it breaks all the other javascript on my page.

 

It's really starting to drive me up the wall! Does anyone have any suggestions as to what could be causing the problem?

 

Thanks,

 

Andy

 

 

 

 

 

 

  • August 13, 2009
  • Like
  • 0

Hi all,

 

I'm having a problem getting a pageblock and/or a pageblocktable to rerender. I have a table of quote lines displayed on a visualforce page. One of the fields in the quoteline object is called 'Order' as our sales people want to be able to order the lines how they see fit.

 

I'd like to have up and down arrows in this table that, when clicked, move that line up or down (ie. change the 'order' field and rerender the table). However, when I click the buttons, the order is changed but the table isn't rerendered - if I refresh the page I can see the change in order.

 

My code is as follows:

 

VF page:

 

<apex:pageBlock title="Current Quote Lines" id="quotelinetable">
<apex:pageblocktable value="{!quoteLines}" var="quote_line_v2__c" border="1" cellpadding="2">
<apex:column width="80px">
<apex:facet name="header">Move</apex:facet>
<apex:facet name="footer">&nbsp;</apex:facet>
<apex:outputtext >
<apex:commandbutton action="{!moveUp}" reRender="quotelinetable" image="{!URLFOR($Resource.UpArrow)}">
<apex:param name="moveId" value="{!quote_line_v2__c.id}" />
<apex:param name="moveOrder" value="{!quote_line_v2__c.Order__c}" />
</apex:commandbutton>
<apex:commandbutton action="{!moveDown}" reRender="quotelinetable" image="{!URLFOR($Resource.DownArrow)}">
<apex:param name="moveId" value="{!quote_line_v2__c.id}" />
<apex:param name="moveOrder" value="{!quote_line_v2__c.Order__c}" />
</apex:commandbutton>
</apex:outputtext>
</apex:column>

.

.

.

 

 Controller:

 

public pageReference moveUp() {
id qlId = apexpages.currentPage().getParameters().get('moveId');
quote_line_v2__c ql = [select id, Order__c from quote_line_v2__c where id=:qlId];
ql.Order__c -= 1;
update ql;
return null;
}


public pageReference moveDown() {
id qlId = apexPages.currentpage().getParameters().get('moveId');
quote_line_v2__c ql = [select id, Order__c from quote_line_v2__c where id=:qlId];
ql.Order__c
update ql;
return null;
}

 I also need to re-order the lines that follow so I don't get duplicates but that's not a problem. I'll handle that once I get the rerendering sorted.

 

If I hit either the moveUp or moveDown buttons, nothing happens. Nothing is reflected on screen. However, when I refresh the page the order column is changed to reflect the button click.

 

Any help would be hugely appreciated.

 

Thanks,

 

Andy

 

  • June 11, 2009
  • Like
  • 0

Hi all,

 

I've got an issue which is driving my absolutely crazy and it seems like a really stupid problem! I simply want to populate the value of an inputText. Now, here's the strage part:

 

This works:

 

 

function checkLicenses() { var licInputs = document.getElementsByName('license'); var licTextBox = document.getElementById('{!$Component.licenseAssignments.licenseWiz2Form.txtSelectedLicenses}'); licTextBox.value = licInputs.length; }

 

This also works:

 

 

function checkLicenses() { var licInputs = document.getElementsByName('license'); var licTextBox = document.getElementById('{!$Component.licenseAssignments.licenseWiz2Form.txtSelectedLicenses}'); licTextBox.value = 999; }

 

However, this does not work:

 

function checkLicenses() { var licInputs = document.getElementsByName('license'); var licTextBox = document.getElementById('{!$Component.licenseAssignments.licenseWiz2Form.txtSelectedLicenses}'); licTextBox.value = 'hello'; }

 and it breaks all the other javascript on my page.

 

It's really starting to drive me up the wall! Does anyone have any suggestions as to what could be causing the problem?

 

Thanks,

 

Andy

 

 

 

 

 

 

  • August 13, 2009
  • Like
  • 0

Hi all,

 

I'm having a problem getting a pageblock and/or a pageblocktable to rerender. I have a table of quote lines displayed on a visualforce page. One of the fields in the quoteline object is called 'Order' as our sales people want to be able to order the lines how they see fit.

 

I'd like to have up and down arrows in this table that, when clicked, move that line up or down (ie. change the 'order' field and rerender the table). However, when I click the buttons, the order is changed but the table isn't rerendered - if I refresh the page I can see the change in order.

 

My code is as follows:

 

VF page:

 

<apex:pageBlock title="Current Quote Lines" id="quotelinetable">
<apex:pageblocktable value="{!quoteLines}" var="quote_line_v2__c" border="1" cellpadding="2">
<apex:column width="80px">
<apex:facet name="header">Move</apex:facet>
<apex:facet name="footer">&nbsp;</apex:facet>
<apex:outputtext >
<apex:commandbutton action="{!moveUp}" reRender="quotelinetable" image="{!URLFOR($Resource.UpArrow)}">
<apex:param name="moveId" value="{!quote_line_v2__c.id}" />
<apex:param name="moveOrder" value="{!quote_line_v2__c.Order__c}" />
</apex:commandbutton>
<apex:commandbutton action="{!moveDown}" reRender="quotelinetable" image="{!URLFOR($Resource.DownArrow)}">
<apex:param name="moveId" value="{!quote_line_v2__c.id}" />
<apex:param name="moveOrder" value="{!quote_line_v2__c.Order__c}" />
</apex:commandbutton>
</apex:outputtext>
</apex:column>

.

.

.

 

 Controller:

 

public pageReference moveUp() {
id qlId = apexpages.currentPage().getParameters().get('moveId');
quote_line_v2__c ql = [select id, Order__c from quote_line_v2__c where id=:qlId];
ql.Order__c -= 1;
update ql;
return null;
}


public pageReference moveDown() {
id qlId = apexPages.currentpage().getParameters().get('moveId');
quote_line_v2__c ql = [select id, Order__c from quote_line_v2__c where id=:qlId];
ql.Order__c
update ql;
return null;
}

 I also need to re-order the lines that follow so I don't get duplicates but that's not a problem. I'll handle that once I get the rerendering sorted.

 

If I hit either the moveUp or moveDown buttons, nothing happens. Nothing is reflected on screen. However, when I refresh the page the order column is changed to reflect the button click.

 

Any help would be hugely appreciated.

 

Thanks,

 

Andy

 

  • June 11, 2009
  • Like
  • 0