instance refresh

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

instance refresh

Pepijn Noltes
Hi All,
 
I have a page with a view on a instance, which i like to refresh every 5 seconds.
 
I have now done this with use of the following javascript:
 
<script>
    function submit() {
     var button = document.getElementById(id);
     //button.click(); ONLY WORKS IN IE
     xformsFireEvents(
      new Array(xformsCreateEventArray(button, "DOMActivate", null)));
     setTimeout("submit()", 5000);
    }
 
    setTimeout("submit()", 5000);
    var id = "sub"
</script>
 
and an hidden xforms:submit:
 
<div style="display:none">
   <xforms:submit submission="retrieve-instance" ev:event="DOMActivate" id="sub">
        <xforms:label>test</xforms:label>
   </xforms:submit>
</div>
 
 
 
Although it works, i think its a bit ugly. Anybody knows a "cleaner" way of doing this ?
 
Thanks in advance,
 Pepijn


--
The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: instance refresh

Erik Bruchez
Administrator
Pepijn,

Good question. I fact just this week we entered this bug:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305532&group_id=168&atid=350207

Implementing this would provide a clean interface to fire XForms events
from client-side JavaScript.

-Erik

Pepijn Noltes wrote:

> Hi All,
>  
> I have a page with a view on a instance, which i like to refresh every 5
> seconds.
>  
> I have now done this with use of the following javascript:
>  
> <script>
>     function submit() {
>      var button = document.getElementById(id);
>      //button.click(); ONLY WORKS IN IE
>      xformsFireEvents(
>       new Array(xformsCreateEventArray(button, "DOMActivate", null)));
>      setTimeout("submit()", 5000);
>     }
>  
>     setTimeout("submit()", 5000);
>     var id = "sub"
> </script>
>  
> and an hidden xforms:submit:
>  
> <div style="display:none">
>    <xforms:submit submission="retrieve-instance" ev:event="DOMActivate"
> id="sub">
>         <xforms:label>test</xforms:label>
>    </xforms:submit>
> </div>
>  
>  
>  
> Although it works, i think its a bit ugly. Anybody knows a "cleaner" way
> of doing this ?
>  
> Thanks in advance,
>  Pepijn
>
> ------------------------------------------------------------------------
> --
> The information contained in this communication and any attachments is
> confidential and may be privileged, and is for the sole use of the
> intended recipient(s). Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient,
> please notify the sender immediately by replying to this message and
> destroy all copies of this message and any attachments. ASML is neither
> liable for the proper and complete transmission of the information
> contained in this communication, nor for any delay in its receipt.
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: instance refresh

Marcus-2
Hi,
 
i saerch the forum for just this case - fire xform-events by client-side javascript.
Is there a solution to do that right now?
 
For more details, i'll try to explain MY problem:
OK, i'm devolping a database application for a project. Searching for information gives the user back results in more than 1 step.
 
1. The user gets a list with all available search results that may suit his search-term. The topic and the document id.
2. By clicking the topic the user should get the whole document, but there should also be some links inside which
a) refer to web-links, b) to some detail information that should only be opend at a popup
 
Normally i would surround those links with an <a href="">-tag and call there a script to open a new window or a popup.
The problem i'm having is, that i need the xforms-submission to retrieve the document or the detail information from my exist-db, tranform it with some xslt-sheet and display the data within my application. So linking the documents internal with a stylesheet won't work, i have to do this also by xpl and therefore need the submission i think, or am i wrong?
 
Other solutions or possibilites?
Thanks, Marcus


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: instance refresh

Erik Bruchez
Administrator
Marcus,

Did you look at this section:

http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-javascript-events

But wouldn't xforms:load work for this? You can write:

<xforms:load resource="{dynamically compute resource here}"
              xxforms:target="my-target"/>

and run this when the user presses a trigger.

-Erik

Marcus wrote:

> Hi,
>  
> i saerch the forum for just this case - fire xform-events by client-side
> javascript.
> Is there a solution to do that right now?
>  
> For more details, i'll try to explain MY problem:
> OK, i'm devolping a database application for a project. Searching
> for information gives the user back results in more than 1 step.
>  
> 1. The user gets a list with all available search results that may suit
> his search-term. The topic and the document id.
> 2. By clicking the topic the user should get the whole document, but
> there should also be some links inside which
> a) refer to web-links, b) to some detail information that should only be
> opend at a popup
>  
> Normally i would surround those links with an <a href="">-tag and call
> there a script to open a new window or a popup.
> The problem i'm having is, that i need the xforms-submission to retrieve
> the document or the detail information from my exist-db, tranform it
> with some xslt-sheet and display the data within my application. So
> linking the documents internal with a stylesheet won't work, i have to
> do this also by xpl and therefore need the submission i think, or am i
> wrong?
>  
> Other solutions or possibilites?
> Thanks, Marcus

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: instance refresh

Marcus-2
Hi Erik,
i'll have a look at this section now and perhaps that will do.
I think that the xforms:load doesn't fullfill my needs, because the trigger
would be the link by itself!
Just like on the most search-pages, the results are always href-links, but
in my case i need the IDs saved in the data to refer to other resources,
which i have to load from the db.

BTW, is there a way to define "my-target" in your example code as a popup
window, just i could do in javascript? open.window(...) and deactivate all
browser menus i.e.?
That would be great at another place where i could need this option!

Thanks,
Marcus


----- Original Message -----
From: "Erik Bruchez" <[hidden email]>
To: <[hidden email]>
Sent: Monday, May 14, 2007 8:37 PM
Subject: Re: [ops-users] instance refresh


> Marcus,
>
> Did you look at this section:
>
> http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-javascript-events
>
> But wouldn't xforms:load work for this? You can write:
>
> <xforms:load resource="{dynamically compute resource here}"
>              xxforms:target="my-target"/>
>
> and run this when the user presses a trigger.
>
> -Erik
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: instance refresh

Erik Bruchez
Administrator
I think the idea is:

* Each link is in fact a trigger (appearance="minimal")
* Pressing trigger causes
** XForms submission to fetched relevant data
** xforms:load to be executed

Currently, the target doesn't allow you to specify any options like
window.open().

BTW you may have to have popup windows, but in most cases popup windows
are really annoying to users. Have you considered using xxforms:dialog
instead?

-Erik

Marcus wrote:

> Hi Erik,
> i'll have a look at this section now and perhaps that will do.
> I think that the xforms:load doesn't fullfill my needs, because the
> trigger would be the link by itself!
> Just like on the most search-pages, the results are always href-links,
> but in my case i need the IDs saved in the data to refer to other
> resources, which i have to load from the db.
>
> BTW, is there a way to define "my-target" in your example code as a
> popup window, just i could do in javascript? open.window(...) and
> deactivate all browser menus i.e.?
> That would be great at another place where i could need this option!
>
> Thanks,
> Marcus
>
>
> ----- Original Message ----- From: "Erik Bruchez" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, May 14, 2007 8:37 PM
> Subject: Re: [ops-users] instance refresh
>
>
>> Marcus,
>>
>> Did you look at this section:
>>
>> http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-javascript-events 
>>
>>
>> But wouldn't xforms:load work for this? You can write:
>>
>> <xforms:load resource="{dynamically compute resource here}"
>>              xxforms:target="my-target"/>
>>
>> and run this when the user presses a trigger.
>>
>> -Erik
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws