Results 1 to 4 of 4
  1. #1

    data-fieldtype="extra" data-update="src">

    Hi,

    I'm testing

    web client
    <img data-source="lightstreamer" data-field="statusImg" data-fieldtype="extra" data-update="src">

    java adapter
    if(status = 1) {
    data.put("statusImg","img/on.png");
    } else {
    data.put("statusImg","img/off.png");
    }

    but without success !!!

    could you please give an example, thank you

    Note : the others fields are updating fine

    Thank you

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    718
    Hi kimi,

    We have an example of img which changes depending on the updates received in real time from Lightstreamer server in our StockList Demo: https://github.com/Lightstreamer/Lig...index.html#L77

    Please consider also that you need to specify all the node typed the grid will map: https://github.com/Lightstreamer/Lig...ndex.html#L186

    Regards,
    Giuseppe

  3. #3
    Hi,

    I have a similar issue and stuck with it for quite sometime now. Can someone please guide me. I need to bind a onclick event to an anchor element dynamically, I checked the examples that Giuseppe's pointed out but still no luck. Let's say I have my html code like :

    <td id="msg" class="revSubject highlight" style="text-align:left;" nowrap="">
    <a href="#" data-source="lightstreamer" data-field="click" data-update="onclick">
    <span><div data-source="lightstreamer" data-field="msg"></div></span>
    </a>
    </td>


    In my js code I did set node types as well :
    grid.setNodeTypes(["div","tr","a"]);

    From my java adapter I'm send the click field :
    map.put("click", "getCCSInboxMsgBody(109539,0,&quot;SysTrdInbox&quo t;return false;");

    but still the event is not getting attached to the <a> element, I'm using DynaGrid with ADD command.
    Last edited by Krishna Teja K; August 1st, 2023 at 07:08 AM. Reason: Didn't provide complete deatails yet

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    718
    Hi Krishna Teja K,

    The snippet of code you attached seems correct to me and the onclick should be actually updated.
    Could you please try to trace if indeed your page receives the update with the click field? You could add a listener to your subscription, something like this:

    dynaGrid.addListener({
    onVisualUpdate: function(key,info,domNode) {
    if (info == null) {
    return;
    }

    info.forEachChangedField(tracefieldvalue);

    }
    })

    Regards,
    Giuseppe

 

 

Similar Threads

  1. Replies: 2
    Last Post: March 29th, 2013, 02:59 AM
  2. Replies: 1
    Last Post: August 20th, 2009, 08:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 10:25 PM.
Lightstreamer Logo