NetTalk Central

Author Topic: refresh child-source when selected row changes  (Read 3651 times)

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
refresh child-source when selected row changes
« on: September 22, 2009, 02:28:33 AM »
Hi,
I have a browse with a source as child beneath it. When the selection of the browse changes I woulk like the source to be refreshed (ajax-style). Can this be done?
Greetz,
Sjoerd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: refresh child-source when selected row changes
« Reply #1 on: September 23, 2009, 12:32:18 AM »
Certainly.
If the source procedure has the setting
"Generate Ajax Div"
turned on, then it should be updated automatically when the browse row changes.

Cheers
Bruce

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: refresh child-source when selected row changes
« Reply #2 on: September 23, 2009, 04:55:29 AM »
Bruce,
Indeed when I put only text inside this source, it worked fine. I tested with:
packet = 'ID =' & p_web.GSV('webOrd:Identifier')

But when I try this, the button is not updated:
packet = '<div id="buttondiv" class="buttondiv"><button type="button" name="btnCarrierInfo" id="btnCarrierInfo" value="CarrierInfo" class="MainButton" onclick="window.open(''frmOrderCarrierInfo?ORD__Identifier=' & p_web.GSV('webOrd:Identifier') & '&PressedButton=change_btn'');">Carrier Info [' & p_web.GSV('webOrd:Identifier') & ']</button></div>'

Any idea?
-Sjoerd
Greetz,
Sjoerd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: refresh child-source when selected row changes
« Reply #3 on: September 23, 2009, 06:49:30 AM »
In almost all cases the problem is that the stuff you are hand-coding is not xHtml complient. The most common cause of this is "unclosed" tags, for example using <br> when you should have <br></br> - or <br /> for short.

You're ok on this front - at least overtly.

The second issue is that you are using a variable in the line which contains characters that are non-xhtml complaint.  To handle this you can make use of the _jsok method. for example;

packet = '<div id="buttondiv" class="buttondiv"><button type="button" name="btnCarrierInfo" id="btnCarrierInfo" value="CarrierInfo" class="MainButton" onclick="window.open(''frmOrderCarrierInfo?ORD__Identifier=' & p_web._jsok(p_web.GSV('webOrd:Identifier')) & '&PressedButton=change_btn'');">Carrier Info [' & p_web,_jsok(p_web.GSV('webOrd:Identifier')) & ']</button></div>'

Cheers
Bruce

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: refresh child-source when selected row changes
« Reply #4 on: September 24, 2009, 12:31:04 AM »
Bruce,
I did exactly that, but still nothing changes until I refresh the page myself.

Any clues?
Greetz,
Sjoerd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: refresh child-source when selected row changes
« Reply #5 on: September 24, 2009, 10:41:22 PM »
It works with a simple string, but not with your button.
so maybe you need to build up your string one bit at a time
until you see why it stops working?

Cheers
Bruce