Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startPhaseZero(blocDemoThreshold, blocVotingThreshold) {
- var blocJSON = {blocDemographicThreshold: blocDemoThreshold, blocVotingThreshold: blocVotingThreshold}
- let xhr = new XMLHttpRequest();
- xhr.open('POST', './MyServlet?action=startPhaseZero');
- xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.responseType = 'json';
- xhr.onload = function() {
- if (xhr.status !== 200) {
- console.error("Error starting phaseZero");
- } else {
- // parse the JSON
- this.setState({divVisible: true})
- }
- }
- xhr.send(JSON.stringify(blocJSON));
- }
- render() {
- return <div>
- <PhaseZeroComponent></PhaseZeroComponent>
- Bloc Demographic Threshold<br></br>
- <input type="range" min="1" max="100" value={this.state.slider1} onChange={this.changeValue} step="1" class="slider" id="1"></input>{this.state.slider1}<br></br>
- Bloc Voting Threshold<br></br>
- <input type="range" min="1" max="100" value={this.state.slider2} onChange={this.changeValue} class="slider" id="2"></input>{this.state.slider2}<br></br>
- <button type="button" class = "btn btn-success" onclick = {this.startPhaseZero(this.state.slider1, this.state.slider2)}>Start PhaseZero</button><br></br>
- Slider 3<br></br>
- <div style = {visibility : divVisible ? block : hidden}> table </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement