cancel
Showing results for 
Search instead for 
Did you mean: 

How to send structured data from one page to another(HTTP Post action)

Former Member
0 Kudos

Hi guys,

I want to send bulk data from one page to another, how can I achieve this in MII, I noticed there is a HTTP Post action block in the WEB, it may be what I am looking for, could you please give me some sample code about how to send data from one page, and how to get the data from another page. Thanks a lot.

Regards,

Tony.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

i think rick's idea is nice.

and maybe you can also try the Applet.setProperty(),Applet.getProperty() method.

Former Member
0 Kudos

hi, Tony

where is ur data from? is it on ur local pc or just from the page, i mean the data is typed in through UI

Former Member
0 Kudos

David,

Source data is retrieved from one MII applet in one page, I want to pass the data to other pages.

Thanks,

Tony.

jcgood25
Active Contributor
0 Kudos

Do you realize that APPLETS query the data themselves? Aside from a roundabout data source push into a parameter in a BLS transaction underneath an XacuteQuery, the APPLETS request their own data and you cannot force data into them via javascript, etc. APPLETS run on the client and communicate with the server.

Regards,

Jeremy

Former Member
0 Kudos

Here's a twist: You can actually store the content as a string in the user session, and using "bound parameters" in a BLS transaction along with an Xacute Query, can deliver them back to any other "consumer" applets. This way, the data can be stored in memory and can be specific to a single user "context".

0 Kudos

Hey Rick,

Interesting idea. Are there any size limitations?

Mike

jcgood25
Active Contributor
0 Kudos

This is the "roundabout data source push" I mentioned in my earlier post, but experience tells us that more than likely there is a much better way to implement the requirements...

Former Member
0 Kudos

Hi Rick,

I am using Queue actions to share the data between pages now. The background is: I have around 11 pages. First there is a Main page and search button on it. Click on the search button will trigger a icommand to retrieve data from db via bunch of complicated SQLs, then these "raw data" will be sent to a Queue. Also several of links will be enabled on the Main page after search. Click on a link will open a new page which will get "raw data" from the Queue, calculate and display them via certain applet. The design is to ensure "get data from db one time" because it is a time consuming action.

Thanks,

Tony.

Former Member
0 Kudos

Hi, Tony.

How are you ensuring that the data in the queue is specific to a user/session? Do you create a queue per user?

Rick

Former Member
0 Kudos

Rick,

I use the same queue id, but the message id is generated randomly using "guid" function of MII (Queue_Put.ID=guid)in Main page, then I use JS code as follows to pass the message id to other pages.

url = "certain_page.htm" + "?MsgID=" + var_MsgID...

window.open(url, ...)

The reason I send the message id rather than message itself in the url is url has the size limit and the message content is rather big.

This will ensure the unique message id in the every session.

The problem is when to delete the message, I am going to keep the queue but delete the message when user close the main page, is it a right design?

Thanks,

Tony.

Former Member
0 Kudos

You could use an "expiration date" or something like that, along with a scheduled BLS transaction that emptied the queue of "expired" content.

I still think there might be a way to use the session (and getProperty/setProperty) to make it work, but I don't have a way to test/experiment.

Former Member
0 Kudos

You could set the your values in session using the API applet.setPropertyValue(String strPropName, String strPropValue) and later get this property value from session using the API applet.getPropertyValue(String strPropName).

We have used these APIs in some of our applications and works very well. But only the usual isssue with storing values in session is cleaning these session values at the right time.

Thanks,

Sara

Former Member
0 Kudos

Sara,

Thanks for the input, is there any size limit on "Property value" ?

Thanks,

Tony.

Former Member
0 Kudos

I don't think any size limit on this property.

Thanks,

Sara