InputRichText to display output - javascript

I want inputRichText to display the output from the database which it was inputted earlier. The reason is the user get chance to input and display the data in same page. After inputting the data he can save it and retrieve it in the same inputRichText. Can you let me know if this work by in built or should i customize the js code? If so i would appreciate if someone have the js scripts. Also alternate idea are appreciated too. Right now i am using Icefaces component for inputRichText.

You can use the value attribute to set the content of inputRichText as string, also can use binding with the backing bean component of type InputRichText, but previous is more preferable way.
You can re-use the same object used for persisting data, to display the content later. It will be having the value fetched from the database & the same will be displayed as text. You have to initialize the string before displaying the page.

Related

Vue.js disable dynamic binding?

I am wondering if it is possible to disable the dynamic binding for one instance of an attribute that I am displaying.
Let's just say I have something like this that is working with two way binding:
this.$children[0].$data.hits
The implementation here is that I have a vacation website where I want to display the total amount of hits which can be derived from this number.
But this number also work with binding so that when you search it gets updated. I want a single instance that does not get updated and shows me the initial count without changing when a user does search.
Is is easily possible or do I just need to set a separate attribute on my components data?
So hits is just a number? then assign it to another data prop initially, before users can search. it won't be updated.
this.originalHits = this.$children[0].$data.hits

Make edits on dynamically loaded data using jQuery and PHP

I have a dropdown, on its change I need to load the contents related to it on the same page. Which I did using jQuery. Now the question is how do I make edits on this data and store it on my database. If I am wrong in using jQuery for loading my data then what else should I use? I am using PHP as my server side scripting language.
More detail -
Simply taking there a list of details I need to display as per the country you select, which I am displaying currently in a nice grid(textboxes)!
Now the data from this grid should be copied to another textbox on "EDIT" button click from where I edit them and store it in my database. I am not able to make the values copy into a another textbox
You could do this:
Display the data in some form of editable div, textarea, or other element.
Make a hidden field somewhere and when you display the data
Set the row id from your database to the hidden field
On your change event, grab the id from the hidden field along with the edited data.
Using Jquery/ajax, send that data to a php page that will save thee data to your database using the passed in id.
You could do that.
However, if it were me (and if you're not married to your current databse / mySQL etc..), I would use parse.com. The service is free up to a significant amount of usage (which Ive never come close to) and it really simplifies everything. See the below post if you're interested in that approach:
Save and retrieve user input from database with javascript?

Sorting datatables using a particular field

I'm using datatables as show here http://railscasts.com/episodes/340-datatables
The default field for sorting is id and that is fine.
However, I also need to be able to redirect to this page from another page so that table must be sorted by another field. I find out what GET query is sent to a server, by it's very long, therefore, there must be another standard way.
So, how do I redirect to a page where this table located to that it causes it sort itself using a particular field?
You can find a solution on this post:
How can I get query string values in JavaScript?
Basically, it's exactly what you're trying to achieve, which is finding out what's coming on the query string.

How to get a vaue of a notes text field in formula language?

I have a form on which there is a text field called "Role". Onload of this form i am assigning a value to this field using javascript:
document.forms(0).Role.value=top.parent.document.all.strRole.value;
When the form opens, the required value is getting displayed in the field Role but when i try to assign the value of this field in formula language in another field on the same form it gives me blank value:
test := #GetField("Role");
The value of test comes as blank.
Can anybody tell me why this is happening? Do i have to save the form before accessing the value?
Based on the comments you added, I believe you are trying to do something that is impossible.
A computed for display field is computed on the server, before the page data is sent to the browser.
The onload event script is executed in the browser, after the page data has been fully sent and loaded.
Since your formula `test := #GetField("Role"); executes in a computed for display field, it is clear that the onload script that sets the Role field's value has not executed yet, therefore it is correctly returning blank.
Try:
test := #GetField("Role");
First of all, when you are talking about "Role", ar you talking about Notes user roles, as defined in the ACL? Second, is this a Notes client application or a web (browser) application?
If it is a web application, the computed field will be computed first, and then, after the page is done loading, the Role field is populated.
Why are you mixing Formula and Javascript? The JS code could as well be done in Formula, then I am sure it would work.
Could you describe what you are trying to do in a little more detail? Where do the roles come from?

Preview/Summary Page

New to HTML javascript programming and have an issue with implementation of my page.
I have created multipage HTML form layout(using div) which runs 4 pages with approximately 140 input values(most are optional values) all together. I need to implement a preview page before actually submit where in only filled input values along with their labels are displayed within a section of the page.I am able to collect the filled input values and the label values to an array using javascript. However the issue is, I am not able to figure out how I can pass these values to the actual in html summary page? I cannot implement .innerHTML as my labels need to be dynamically generated based on input values. Can this even be done just by javascript or HTML or do I need a server side script to implement the preview page? Does learning DHTML or AJAX help to implement a solution to this problem? I appreciate all the help. Let me know if I need to explain better.
The BEST way would be a session variable in a server-side language. If security is not an issue though, you can save the variables into a cookie though javascript.
See here.

Categories

Resources