NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: bergsj on September 22, 2009, 02:28:33 AM

Title: refresh child-source when selected row changes
Post by: bergsj 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?
Title: Re: refresh child-source when selected row changes
Post by: Bruce 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
Title: Re: refresh child-source when selected row changes
Post by: bergsj 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
Title: Re: refresh child-source when selected row changes
Post by: Bruce 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
Title: Re: refresh child-source when selected row changes
Post by: bergsj 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?
Title: Re: refresh child-source when selected row changes
Post by: Bruce 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